Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / [URGENT] pre rotation exposed?
  RSS 2.0 ATOM  

[URGENT] pre rotation exposed?
Rate this thread
 
1166
 
Permlink of this thread   Subscribe to this thread
avatar
  • Total Posts: 162
  • Joined: 24 August 2006 03:52 AM

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



Replies: 0
avatar
  • KxL
  • Posted: 30 October 2007 07:03 AM

I’m using only OR SDK, but did you look in PropertyList of FBComponent?
KxL



Replies: 0
avatar

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



Replies: 0
avatar
  • KxL
  • Posted: 30 October 2007 07:22 AM

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



Replies: 0
avatar

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



Replies: 0
avatar
  • KxL
  • Posted: 30 October 2007 08:23 AM

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 FBModelListFBGetSelectedModelsFBPropertyManager

def PrintProperty
pModel ):
    
lPropMgr pModel.PropertyList
    
for lProp in lPropMgr:
    print 
lProp.GetName()

lModelList FBModelList()

# Get the selected models.
FBGetSelectedModelslModelList )
for 
lModel in lModelList:
    
PrintProperty(lModel)

# Cleanup.
dellModelListPrintProperty )
del(FBModelListFBGetSelectedModels,FBPropertyManager)

KxL



Replies: 0
avatar

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.



Replies: 0
avatar
  • KxL
  • Posted: 30 October 2007 09:31 AM

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



Replies: 0
avatar

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



Replies: 0
avatar
  • jsDude
  • Posted: 03 March 2010 08:21 AM

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

Replies: 0
avatar
  • _stev_
  • Posted: 03 March 2010 08:38 AM

Sneaky name:

lModel.PropertyList.Find("RotationActive").Data True

Stev



Replies: 0
avatar
  • jsDude
  • Posted: 04 March 2010 02:03 AM

Hey thanks!
It was the only i didn’t try :)



Technical Art Director @ Funcom Montreal

Replies: 0




   
  Settings Choose Theme color: