Unpin functionality in Python? (Motionbuilder)


#1

For a certain task I kept moving the whole body of a
character by selecting the hips effector, unpinning the
children, translating the hips and turning off the unpin
button.

When I tried to write a script to do this for me I
realized that I don’t know how to do the unpinning.
The documentation only covers getting the actual state
of pinning.


#2

you know about the temporary unpin button/ Q hotkey, then you don’t have to unpin anything

But there is python access to the pin settings and if I am not mistaken you can use the same command to set the pin state as you can to get the state, just set it instead of reading it. Just guessing though, I have to find the script as I can’t remember.


#3

Characters have a function like IsRotationPin() so it seems
to be read only.

Interestingly the lack of unpinning caused the code to be
more clean/easy to read so it’s cool. :slight_smile:

(And yeah, I was using the “unpin children” button. Page 9
in a certain e-book which I use as my bible. :wink:


#4

so you want to know my unpin key hack? in full body mode, unpin hot key, but key body parts, keeps the feet locked once the time updates, but lets me key the upper body and leaving my pin sets the same but move the character and I can control what stays put.

Also just sent you an email with the get/set pin scripts, might help you out with what you were trying to do.


#5

Hehe, neat trick!

Thanks for the mail, I keep forgetting how thorough
Python integration actually is. I’ll give it a spin asap.


#6

Hey.
I’m also looking for a way to script checking / setting the state of r/t pinning. Any chance I could get hold of those scripts?

Thanks :slight_smile:


#7

Sorry, I haven’t used Mobu in years, I don’t have anything left of my old projects. :\


#8

Thanks anyhow. I’ll keep diggin


#9
lRig = FBApplication().CurrentCharacter.Components[0]
lPins = {}  #dictionnary of Pins

for each in lRig.PropertyList:
	if each.GetName().find("TPin") != -1 or each.GetName().find("RPin") != -1:
		lPins[each.GetName()] = each.Data