|
|
|
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®
|
| [URGENT] pre rotation exposed?
|
|
|
Are the pre-rotation options (in DOF) exposed to Python? Can’t seem to locate them in the helpfile.
Any pointers will be great!
-Johan
|
|
|
|
I’m using only OR SDK, but did you look in PropertyList of FBComponent?
KxL
|
|
|
|
Ok, so you think that with
FBProperty Find ( const char pPropertyName,
bool pInternalSearch = True,
bool pMultilangLookup = True
)
I could find the pre-rotation values… it’s worth a try… or am I totally lost here… really hate the python manual, probably makes a lot of sense to real programmers :)
-Johan
|
|
|
|
I think that you can find it, but you will have to know the exact name for it. I think that it is the same as in OR, so:
“PreRotation”
“PostRotation”
but it is always good write a loop and display all of properties that component have.
Hope this will help
KxL
|
|
|
|
It does help!! I’m wondering one thing though, how do you know the exact name, in the OR documentation there’s no mentioning of PreRotation (at least searching didn’n yield any results).. is there a list somewhere, or a method to display all properties? I probably also need to set DOF to on on the objects.
Thanks!!
-Johan
|
|
|
|
I have write for you a litte script in python (btw. my first script!), so it will print in the python console all properties for a selected model (they for FBModel will be the same, but I hope this will be some kind of help for others when they will have problems with finding a interesting value)
from pyfbsdk import FBModelList, FBGetSelectedModels, FBPropertyManager
def PrintProperty( pModel ):
lPropMgr = pModel.PropertyList
for lProp in lPropMgr:
print lProp.GetName()
lModelList = FBModelList()
# Get the selected models. FBGetSelectedModels( lModelList )
for lModel in lModelList:
PrintProperty(lModel)
# Cleanup. del( lModelList, PrintProperty ) del(FBModelList, FBGetSelectedModels,FBPropertyManager)
KxL
|
|
|
|
Oh this is great! I’m a proficient maxscript/php/javascript user, but I’m having a hard time trying to understand this python implementation in Motionbuilder or maybe python overall :) , with the helpfile only showing the API in a structured way but for a non-programmer a difficult to thing to grasp. So any scripts other then the examples is a great help!
Thanks!!!
-Johan
p.s. Since you seem to grasp all this programming concepts, maybe you can start a thread about the way python is integrated in MB. Why we need to import objects and instance them before using them...(if that’s even the right terminology) the “whole workflow” of doing stuff… How to use the manual would be great too, that is offcourse if you feel like it and have some time on your hands! But I think there’s a lot of other people out there, including me :), appriciating stuff like that.
|
|
|
|
Python integration is made by using Boost_phyton library, so if something is exposed from OR, it will behave in the same way. And that’ the only reason I manage to help you, becouse I’m only using OR, and never needed to use python. About the manual...hmmm..I must say that MotionBuilder is written by great programmers, and what great programmers doesn’t do? ... They never write good documentation ;) That’s the only explanation that I have for this. Maybe someone from Autodesk can explain this?
KxL
|
|
|
|
KxL, thanks for your help.
I managed to write a script to copy the rotation values to the prerotation and reset the rotation values back to 0,0,0. Thanks for answering, I have a much better grip on the helpfile already, but it would be great if it got updated to a more artist friendly helpfile. I now realize that it’s only an API document and doesn’t say a word about python itself or it’s functionality.
So I have so reading up to do, and see if this Python beast can be tamed :P
Thanks so much for your insights,
and if anybody is interested in the script get it here http://scripts.subd.nl/?f=JHN_zeroOutRotation.py
-Johan
|
|
|
|
Hi,
I’ve had the same issue and your function actually help a lot the only problem I have is that I cannot access the “Enable Rotation DOF” in python ...
Anyone have a clue?
Best,
Technical Art Director @ Funcom Montreal
|
|
|
|
Sneaky name:
lModel.PropertyList.Find("RotationActive").Data = True
Stev
|
|
|
|
Hey thanks!
It was the only i didn’t try :)
Technical Art Director @ Funcom Montreal
|
|
|
|
| Settings
| Choose Theme color:
|
|
|
|
|
|
|
|
|