|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| how to find key value and key time on kFBPT_double custom property?
|
|
|
I’m new to python and I would like to know how i can find and read all key value and key time of each fcurve of all kFBPT_double custom properties from a marker.
I try to dig into the doc but it’s kind of difficult to understand for me.
If any one can help me, it would be great.
|
|
|
|
I was trying as well to find all custom properties from a marker and print each custom property name but I just find the function to find the custom property by name in the doc…
Any advice?
Thanks
|
|
|
|
Here’s a little example that should help.
from pyfbsdk import *
nullObj = FBFindModelByName('Null') prop = nullObj.PropertyList.Find('CustomKeyedNumber') # Get the animation node of a property animNode = prop.GetAnimationNode() # The FCurve of the node has the key data for k in animNode.FCurve.Keys:
# Each key has attributes like Time, Value, Bias, Continuity, etc.
print 'Key at time %s = %.3f' % (k.Time.GetTimeString(), k.Value)
Stev
|
|
|
|
Thanks a lot.
I understand now how to read and store key value and key time of a known custom property.
My problem is that I’m trying to read data from an FBX file that contains markers with lots of custom properties and I would like to find all these custom properties. As I don’t know any of these custom property names, how can I find them and get these names?
My goal is to automatically find custom property and store names and keys (if there are keys) whatever is the name of the custom property.
Thanks
|
|
|
|
I think something like this should work:
from pyfbsdk import *
nullObj = FBFindModelByName('Null') # Check all properties for prop in nullObj.PropertyList:
# If the property isn't a user prop, skip it
if not prop.IsUserProperty(): continue
print 'Showing Keys for Property: %s' % prop.Name
# Get the animation node of a property
animNode = prop.GetAnimationNode()
# The FCurve of the node has the key data
for k in animNode.FCurve.Keys:
# Each key has attributes like Time, Value, Bias, Continuity, etc.
print 'Key at time %s = %.3f' % (k.Time.GetTimeString(), k.Value)
|
|
|
|
Thanks _stev_.
This is exactly what I was looking for.
Now I understand how I can check if a property isn’t a custom property.
I just need to add a test for any custom property type that doesn’t have a direct animation node like Color where you have to go to r g b or text that don’t have any animation. I will see if I can succeed and post the result.
Thanks again!
|
|
|
|
|
|