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 / Selection, list etc. Global Functions
  RSS 2.0 ATOM  

Selection, list etc. Global Functions
Rate this thread
 
57658
 
Permlink of this thread  
avatar
  • Zeedorf
  • Posted: 05 July 2011 04:29 AM
  • Location: Budapest
  • Total Posts: 11
  • Joined: 11 July 2009 03:03 PM

Hi Everyone

I’m just fustrated by selection and things like that. In Maya it seems so simple. It might be because in Maya MEL everything in connection with objects’ names and attributes are strings. In MotionBuilder Pyhton those are classes. As far as I understand if I want to for eg. delete an object first of all I have to know what its class is and whether there is a class function like delete. If there is no delete function I have to find the upper class which have the delete function.
So the question arisen whether are Global Functions in MotionBuilder (pyfbsdk) I mean independently from classes like ls (list) in Maya. Ok it might be stupid question. The help file doesn’t describe things like that at all.

So one current problem.
I’m searching the easiest way to get the selected objects’ names.

Thanks



Replies: 0
avatar
  • Neill3d
  • Posted: 05 July 2011 06:43 AM

Hi,

if you like Maya syntax, try pymobu library for Python - http://code.google.com/p/pymobu/



Replies: 0
avatar
  • Zeedorf
  • Posted: 07 July 2011 12:41 AM

Thanks

It seems very interesting. I haven’t tried yet but I checked the link and the examples. Pymobu is very promising. Great effort! I hope 1.0 is coming soon :)



Replies: 0
avatar
  • melvin3d
  • Posted: 31 July 2011 06:43 PM

Hey man ..
I know its frustrating .. But i still lean to the traditional Mobu way of getting names or objects inside Mobu selected objects .. so..here..

from pyfbsdk import FBGetSelectedModels

# FBLlist instance
lModels = FBModelList()

# get the selected models in the scene
FBGetSelectedModels(lModels)

# get me my names ..
print[obj.Name for obj in lModels]

# or the more traditional way
for obj in lModels:
print obj.Name

# both should work ..:) ...let me know if that helps..Not Maya i know but you get used to it.:)

Cheers

Melvin3d



Replies: 0
avatar
  • Zeedorf
  • Posted: 19 October 2011 01:29 AM

Thanks, it is useful.

I still have the feeling something wrong with the documentation MotionBuilder SDK Help. The FBGetSelectedModels function is a good example. If I try to find what this function does I have to go through a lot of search result pages find it at the end of doc File List / pyfbsdk.h.
I have to stress I would never found this function if somebody hadn’t told me that.



Replies: 0