I'm attempting to define some display properties on a Handle in MB 2013 and I'm struggling to access some of the properties. In '3D Display' for the handle object, I want to turn on Visibility and then specify the look (e.g. to be a 'Light Cross'), but can't.
Using thehandle.PropertyList.Find( 'Show' ).Data I can set the visibility of the '2D Display' object and everything else within that category, however, under '3D Display' in properties (which is how I want it to appear), I can't get at 'Visibility', 'Color' and 'Translation Offset', or at least I don't know how to (as they exist with the same name in the 2D section).
When I set the look using this:
thehandle = FBHandle("HDL") thehandle.Look = FBMarkerLook.kFBMarkerLookLightCross
Nothing updates in the properties for the handle, and I can't turn it on anyway. There also seems to be some objects missing from the 3d objects type that used to be there e.g. capsule?
Is this a bug, or am I doing something wrong? Any help appreciated; I'm pretty new to python both in/outside of MB.
Solved! Go to Solution.
Solved by middlek. Go to Solution.
Just noticed that the code snippet I've added is incorrect as it's setting a markers properties rather than those for a handle, but the issue with accessing the handles 3D properties I'm still unsure about.
A good way to know how to find and work with the properties on an object, is to print them all out and see what's available to you:
from pyfbsdk import * for lProp in thehandle.PropertyList: print lProp.Name
With this workflow, I can read through all of the property names in the console and see if anything seems fitting with what I am trying to set. So in this case "Handler3DModelLook" and "HandlerShow3DModel" seem to describe best what property I want to access.
Then I need to do a little testing to confirm, I will print the lProp.Data to see what kind of value it takes, for Handler3DModelLook, it says the Data is 0, so I need to provide an integer, so I test by setting the values till the UI property shows me the values I wanted, in this case 2 = Light Cross.
So for your exact question, I believe the code would look something like this:
from pyfbsdk import * thehandle = FBHandle("HDL") for lProp in thehandle.PropertyList: if lProp.Name == "Handler3DModelLook": lProp.Data = 2 if lProp.Name == "HandlerShow3DModel": if lProp.Data == False: lProp.Data = True
This works for me in MotionBuilder 2014, hopefully it works for you in MotionBuilder 2013,
Hope this helps,
Kristine
Cheers, that works in 2013.
I'd managed to list out the properties using your first suggestion but failed to recognize/set what I needed in the correct fashion seemingly. Either way, many thanks.
Can't find what you're looking for? Ask the community or share your knowledge.