Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / Reach & Pull exposed in ORSDK or Python?
  RSS 2.0 ATOM  

Reach & Pull exposed in ORSDK or Python?
Rate this thread
 
30385
 
Permlink of this thread  
avatar
  • steebu
  • Posted: 01 June 2009 01:23 PM
  • Total Posts: 44
  • Joined: 09 January 2007 01:40 PM

So in the Character Settings pane you’ve got all sorts of goodies to help you with your solve.  Are any of the Reach or Pull sliders exposed in the SDK or in Python?  It doesn’t look like it ... :-(



Replies: 0
avatar
  • raitch
  • Posted: 02 June 2009 09:52 AM

You can access the Reach properties per effector this way:

from pyfbsdk import *

lEffector FBFindModelByName("LeftWristEffector")
IKReachTProperty 
lEffector.PropertyList.Find('IK Reach Translation')
IKReachTProperty
.Data 50

I am changing the value to 50 in this Python example.
The Pull property is missing from Python but it is available in the OR SDK FBCharacterManipulatorCtrlSet class.
This has been logged as an issue.
Thanks!



Replies: 0
avatar
  • steebu
  • Posted: 02 June 2009 11:51 AM

I guess I’m just dumb?  The above code doesn’t work in 2009.  I keep getting the error

AttributeError: ‘NoneType’ object has no attribute ‘PropertyList’

so apparently FBFindModelByName is finding anything named “LeftHandEffector”?



Replies: 0
avatar
  • raitch
  • Posted: 03 June 2009 03:25 AM

Hey again,

A couple of things:

#1. Make sure you have a Character with a Control Rig in the scene.  I used the tutorials/mia_characterized sample file and created the default Control Rig for her to test this.  Make sure you can select LeftWristEffector

#2. You can also find the Pull settings in Python - they live in the Property List of the Character:

from pyfbsdk import *

lEffector FBFindModelByName("LeftWristEffector")
IKReachTProperty 
lEffector.PropertyList.Find('IK Reach Translation')
IKReachTProperty
.Data 50


lCharacter 
FBSystem().Scene.Characters[0]
HeadPullProperty 
lCharacter.PropertyList.Find('Head Pull')
HeadPullProperty
.Data 50

So, sorry for the incomplete/incorrect answer yesterday and hopefully you can actually run this code with the sample file.  I am also testing in 2009 for this.

Please let me know if you can make it work?
Thanks!



Replies: 0
avatar
  • steebu
  • Posted: 03 June 2009 12:41 PM

Still can’t make it work!

I’ve plotted to a control rig and selected the LeftWristEffector.  All’s well there.

But if I do this:

for foo in lEffector.PropertyList:
print foo.Name

The resulting list doesn’t contain “IK Reach Translation”, which jives with the new error message I was getting:

Traceback (most recent call last):
File “X:/Apps/Tools/Blade/User/SP/Scripts/Python-Dev/plot_test.py”, line 11, in <module>
IKReachTProperty.Data = 50
AttributeError: ‘NoneType’ object has no attribute ‘Data’



Replies: 0
avatar
  • dancho
  • Posted: 06 February 2010 12:12 PM

raitch,

How about IK Effect Pinning?

Thanks,



Replies: 0