Zero Pose of Node and all children Script

agashwoodagashwood Posts: 8
edited October 2020 in Daz Studio Discussion

Hi All,

I quite often have to select a node and all its children and zero out their poses when I get in a mess. This could be a finger, a hand, a whole limb or the whole figure for that matter.

I found several scripts to hide a node and all it's children but nothing to zero poses. Can anybody give me an example script to do this?

Cheers

Post edited by agashwood on

Comments

  • OmnifluxOmniflux Posts: 383

    This script will Restore selected nodes and their children when run, and Zero selected nodes and their children when run with the control key pressed.

    (function(){	var aActions = [["DzRestorePoseAction", "Restore"], ["DzZeroPoseAction", "Zero"]]	if (Scene.getNumSelectedNodes() == 0)		MessageBox.warning (qsTr ("You must select one or more nodes to perform this action."), qsTr ("Selection Error"), qsTr ("&OK"), "");	else	{		// Restore by default, Zero if control key is pressed		var aAction = aActions[(App.modifierKeyState() & 0x04000000) ? 1 : 0]		// Save selected node list		var aSelectedNodes = Scene.getSelectedNodeList();				beginUndo();		aSelectedNodes.forEach (function (x) { x.getNodeChildren (true).forEach (function (y) { y.select (true) })});		MainWindow.getActionMgr().findAction (aAction[0]).trigger();		acceptUndo (qsTr (aAction[1] + " Selected Item(s)"));				// Restore selected node list		Scene.selectAllNodes (false);		aSelectedNodes.forEach (function (x) { x.select (true) })	}})();

     

  • Are you wanting to write a script or have one written? If the latter please edit the first post and change the forum to Daz Studio Discussion or Product Suggestions.

  • That works great Omniflux, thanks.

  • Severely underrated post - thank you! This should be a base feature.

Sign In or Register to comment.