How to access IK Pins via Script

SasqwachSasqwach Posts: 25

Hey folks, hope someone has the knowledge here to assist

I regularly find pinning hands & feet with either Transform Tool IK pins or ActivePose toggle pins makes far easier for "speed posing" or delicate adjustments. Rather than me navigating round many figures rotating round and finding the particular hand I want to pin, I was going to make a script to "Select figure - One button pin & unpin both feet or both hands or both hands and feet" (Check the image and you'll catch my drift.)

image

Step one as a tester was easy, select the figure pin both feet - See script below. But I wanted to make this scripts logic toggle based ie "Want to pin those feet? Is it pinned already? No? Ok then pin it! Want toUnpin those feet? Is it pinned already? YEAH! Ok then unpin it!"

But I cannot for the life of me find in the Object index, node, element properties where this is stored so I can switch it back. Tried several variations of

http://docs.daz3d.com/doku.php/artzone/wiki/user/rbtwhiz/technotes/daz_script/node_properties/start

...but no joy. Is there a method to get a nodes pins state (activepose and IK transform) so I can toggle back n forth? (The alternative is I make multiple scripts...but that’s crummy...)

Anyone know how to access so I can get value and switch accordingly?

Script So Far...

// DAZ Studio version 4.12.0.86 filetype DAZ Scriptvar scriptName = "FootPins";var mgr = MainWindow.getActionMgr();var currentSelection = Scene.getPrimarySelection();var initialSelection = Scene.getPrimarySelection();pinFunction = mgr.findAction("DzIKPinBothAction");unPinFunction = mgr.findAction("DzIKClearPinAction");var numSetectedNodes = Scene.getNumSelectedNodes();if( numSetectedNodes < 1 ){	MessageBox.information( "No Figure Selected", scriptName, "OK" );	return;}currentSelection.select(false); //clear selection to focus on feet...because...see belowif( currentSelection ){	if( currentSelection.inherits( "DzBone" ) )	{		currentSelection = currentSelection.getSkeleton();	}	if( currentSelection.inherits( "DzSkeleton" ) )	{				var leftFoot = currentSelection.findBoneByLabel( "Left Foot" );		leftFoot.select(true);			pinFunction.trigger();			leftFoot.select(false);				var rightFoot = currentSelection.findBoneByLabel( "Right Foot" );		rightFoot.select(true);		pinFunction.trigger();			rightFoot.select(false);	}}initialSelection.select( true ); //go back to initial selection for convenience... 

PS another point of notes, when performing setValue operations on a figure via script such as

 

item.getZRotControl().setValue(rotateProperty)

 

It completely ignores both IK and toggled pins...! I've noticed this even when using a lot of scripts such as those from mcasual, Riversoft, 3D Universe, etc

 

2020-02-23_21h21_44.jpg
195 x 285 - 40K
Post edited by Sasqwach on
Sign In or Register to comment.