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 / FBFindObjectsByName : issue with wildcard system
  RSS 2.0 ATOM  

FBFindObjectsByName : issue with wildcard system
Rate this thread
 
62529
 
Permlink of this thread  
avatar
  • gon2024
  • Posted: 05 December 2011 02:45 AM
  • Total Posts: 8
  • Joined: 13 April 2010 03:12 AM

Hello.

I want to share with you an issue about the method pyfbsdk.FBFindObjectsByName .

On an empty scene, just type followings commands:

>>> import pyfbsdk
>>> theListpyfbsdk.FBComponentList()
>>> 
pyfbsdk.FBFindObjectsByName"*"theListTrueTrue )
>>> print 
len(theList)
0
>>> pyfbsdk.FBFindObjectsByName"*u*"theListTrueTrue )
>>> print 
len(theList)
7
>>> //The seven prod*U*cer cameras...

I do not except the * token to return no objects, but all objets.



Replies: 0
avatar
  • gon2024
  • Posted: 05 December 2011 02:58 AM

As a workaround, you can do something like:

theRoot FBSystem().Scene.RootModel
for child in theRoot.Children:
    print 
child.Name
    
#[...] do some stuff

But it works only for Models, (under Scene Root in Navigator window)
So you have to do the same for each Property types, cameras, Materials, Textures, etc..)
(listed in: FBScene Class Reference at SDK Python refence)



Replies: 0
avatar
  • Ollie_D
  • Posted: 17 January 2012 09:35 PM

Or just get the components if you want to get everything.

theList FBSystem().Scene.Components

But your right, using “*” as a wildcard should return everything in a search.  Welcome to the world of motionbuilder API.  Where not everything is as it appears to be!



Replies: 0