Select an object through a DUF/script whatever

Is there anywhere a template for creating a script which, when clicked, will select the object specified in it, in an opened scene? As in, if I have a figure or object named "Bob", when I click on that item, Bob gets selected in the viewport?

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,747

    Use DzScene findNode methods, by label if you want to go by the text from the scene pane, check you have a hit, then use dzNode.select( true ) on it.

    Something like

    var oTarget = Scene.findNodeByLabel( "Bob" );if ( oTarget ) {	oTarget.select( true );}

    Bear in mind that if there is more than one Bob in the scene its label will get extra numbes added to it, if you need tio deal with that getting all nodes and then using the string functions to check the beginnings of their labels might be necessary.

Sign In or Register to comment.