deecue Posted September 17, 2005 Share Posted September 17, 2005 hi all, is there a hscript command that reverts all parms back to their defaults.. much like you would expect under the presets drop down menu under the top tow bar in the parameters pane.. i searched all over for this but can't find anything on it.. so for now i just have a bunch of opparm's set to their default values.. Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted September 17, 2005 Share Posted September 17, 2005 hi all, is there a hscript command that reverts all parms back to their defaults.. much like you would expect under the presets drop down menu under the top tow bar in the parameters pane..i searched all over for this but can't find anything on it.. so for now i just have a bunch of opparm's set to their default values.. 21346[/snapback] If you are using a HDA sometimes you can get away with source the creating script..... Like.... #remove all the keyframes chkeyrm * #source the creationscript source opdef:/Object/myHda?CreationScript $op But I agree...there should be some sort of revert to default hscript command Quote Link to comment Share on other sites More sharing options...
Jason Posted September 17, 2005 Share Posted September 17, 2005 But I agree...there should be some sort of revert to default hscript I'd swing over to the SESI forum and RFE it there Who knows, it might be easy enough to sneak in for the 8.0 release? PS. interesting solution, Wolfwood - ne'er thought of that approach. Quote Link to comment Share on other sites More sharing options...
deecue Posted September 18, 2005 Author Share Posted September 18, 2005 this was for an hda so sourcing the creation script works out well.. nice idea.. i basically had a bunch of presets accessible through a drop down menu and loaded them from a callback script.. but i wanted each preset to return to default before setting it's own parms.. but i'll def go RFE this over at sesi now.. thanks guys.. Quote Link to comment Share on other sites More sharing options...
grasshopper Posted September 19, 2005 Share Posted September 19, 2005 Just whipped this up so it isn't exactly throughly tested yet. Let me know how you get on. Copy it to your ../houdiniX.X/scripts folder and name it "reset.cmd". Run it in a textport by typing reset.cmd followed by the full path to the node to be reset (easiest way to do that is to select the node and drag it onto the textport). # reset.cmd - Reset a node to its defaults set node = $arg1 if (`opexist("$node")` == 0) echo "Node not found: $node" exit endif # Remove keyframes chrm ${node}/* # Remember the current path and switch to the network containing the node set savePath = `oppwf()` opcf `opfullpath ("${node}/..")` # Reset parameters to defaults by copying parms from another temporary node set nodeType = `optype ("$node")` set defaultNode = `execute("opadd -v $nodeType")` set parmList = `execute("opparm -d $defaultNode *")` set firstSpace = `index("$parmList", " ")` set chopOpparm = `substr("$parmList", $firstSpace, strlen("$parmList") - $firstSpace)` set secondSpace = `index("$chopOpparm", " ")` set defaultParms = `substr("$chopOpparm", $secondSpace, strlen("$chopOpparm") - $secondSpace)` opparm $node $defaultParms # Remove the temporary node oprm $defaultNode # Change back to the directory that called the script opcf $savePath set -u $savePath Quote Link to comment Share on other sites More sharing options...
deecue Posted September 20, 2005 Author Share Posted September 20, 2005 cool idea.. create a temp node of the same type and pull those default parms to stick in the current one.. seems to work like a charm.. thanks grasshopper Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.