MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to verify if a RigidBody exists?

0 REPLIES 0
Reply
Message 1 of 1
webflashing
255 Views, 0 Replies

How to verify if a RigidBody exists?

Hello, I'm new to python and I've been ask at work to make a script which is supposed to save us a lot of time cleaning Mocap captures.

I got my code working pretty well. The idea is to get a list of components which have the FBModelMarkerOptical class, and then for each one of those, get it's RigidBody and work with it.

The problem is that MotionBuilder crashes when it finds a component which DOESN't have a RigidBody, and I don't really know how to ask if it has one.

My code looks like this:


if lMarker and lMarker.ClassName() == "FBModelMarkerOptical":
RigidObject = lMarker.GetRigidBody()
RigidObject.Done = False
RigidObject.Done = True


Earlier today, I tried with if lMarker.GetRigidBody().IsValid(): but it's still crashing when it finds a component without RigidBody.

How can I check if it has a RigidBody and then set RigidObject?

Thanks very much!
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report