Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Appending Existing Item/s in FBList via Python

2 REPLIES 2
Reply
Message 1 of 3
ronel_dejesus
481 Views, 2 Replies

Appending Existing Item/s in FBList via Python

I'm trying to do a Python script where I want to append an Item from an FBList to another FBList. What I want to happen is, I don't want to prevent appending the same Item in the other FBList once it is already appended. I know how if/else condition works, I just don't know yet how to properly apply it in this case. Here's the sample BTW.

 

def addHeadCall(control, event):

   addOpt = optList.Items[optList.ItemIndex]

   headList.Items.append(addOpt)

   print addOpt, "has been added to Head"

 

And how do you get the size of the FBList, in order to avoid getting an error if I accidentally remove an item from an empty FBList?

 

I'm sorry,  I'm still completely new to Python especially for Motionbuilder. I can only apply a few of my knowledge for MEL scripting.

Again, thanks in advance for the help.

Labels (2)
2 REPLIES 2
Message 2 of 3

Never mind. Solved it on my own already

Message 3 of 3

My mistake. I only solved my 2nd problem.

 

How do you set to unsolve this forum post?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report