bvh import improvement - rotate 90 degrees on import #26599
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#26599
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%A small fix, suggested by ideasman_42. Adds a check box to the import dialog if the user wants to rotate the animation around the X axis.
This is very useful, as most motion capture animations import sideways (see screenshots).
Works for both Armature and Object (empties) importing.
Attached is a diff file (created from \blender\release\scripts\addons, on main repo that's https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons)
Also attached are the actual 2 script files I changed, in case you want to apply that way.
And a few screenshots showcasing the added functionality.
Cheers,
Benjy Cook%%%
Changed status to: 'Open'
%%%Looking over the patch a few things I noticed...
To support reload properly, try to access a package var, if it's there, reload everything
This gives more work to review the patch because I cant tell what you modify is important or not, but UNDO for instance is important, some of the other changes too.
As for the actual patch, IMHO would be best if the import/export operators create a 3x3 matrix and pass this on, the 3x3 matrix can be created the same way you are doing now, but it allows for easier extending later on without having to add more keyword arguments, (FBX does it this way).%%%
%%%Campbell,
Thank you for your detailed response.
I shall work on these notes and hope to have an updated patch in the next few days.%%%
%%%Updated diff file and scripts uploaded, suffixed with _2.
I apologize for using an out-of-date version. Rookie mistake. All that is fixed now, I worked on the latest revision (1736).
Now a global matrix is created in the init script, according to user choice and applied later to the skeleton.
Scale is still done with the global_scale variable and not this matrix, unlike fbx. But that's for another patch.
Also, file.close() was added at the end of bvh_read.%%%
%%%Updated diff file, suffixed with _3.
Now rest pose is changed, and object export supports the fix.
The code is slightly bulkier, because other approaches resulted in many bugs and artifacts across different bvh files.
For objects, root bones receive the transform.
For armatures, at the end of the original process, all bones are disconnected from their parents, rotated around their center, and reconnect to the original parent.
While sounding strange, this copies the animation perfectly.
For your review, Benjy%%%
%%%the functionality is in trunk now. closing.%%%
Changed status from 'Open' to: 'Archived'