Selection in Surface Pane using script

I know how to select node by label (findNodeByLabel( "..." )).

But how to make this in Surface Pane - to example choose "Opacity" or other item here? Thanks wink

Comments

  • EdpaEdpa Posts: 46
    edited July 2016

    I tried next, but it isn't working :(

    parameters are not changed

    var oPaneMgr = MainWindow.getPaneMgr();var oPane = oPaneMgr.findPane( "DzSurfacesPane" );var item = oPane.findPropertyByLabel( "Glossiness" );if ( item) { item.setValue( 50 );}

     

    Post edited by Edpa on
  • You would do better to go to the item directly rather than through the pane. This script sample shows how to get a material from an object and access its properties http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/properties/material_properties/start

  • EdpaEdpa Posts: 46
    edited July 2016

    Ok! It's working correctly.  Changes a little and OK. Thank you very much.

    Modified place from this script :)

    // Iterate over the materials

    for( var i = 0; i < aMaterials.length; i += 1 ){

    // Get the "current" material

    oMaterial = aMaterials[ i ];

    //printMaterialPropertiesInfo( oMaterial );

    // Find a specific property by name

    oProperty = findElementProperty( oMaterial, "Horizontal Tiles", false );

    // If we found a property

    if( oProperty ){

    // Provide feedback

    oProperty.setValue(2 );

    }

    }

    // Finalize the function and invoke

    Post edited by Edpa on
Sign In or Register to comment.