Determining the selected parameter(s)

Hello folks,

actually, I have two questions:

1) is there a way to find out in a script which single parameter or group of parameters was selected in the UI parameter tab?

2) I would like to create a keyframe for the selected parameter in the current, the previous, and the following frame and set the mode of change to constant. Is there an example somewhere?

Comments

  • Stretch65Stretch65 Posts: 157

    For (1), I've asked this question myself and apparently there's no way.  The SDK might have that functionality but not for scripting.

  • PraxisPraxis Posts: 240
    edited July 2020
    metrantor said:
    1) is there a way to find out in a script which single parameter or group of parameters was selected in the UI parameter tab?

    This works for me:

    function utilities_GetSelectedPropertiesArray()      // : Array of DzProperty{  var PropArray = undefined;  var PaneMgr = MainWindow.getPaneMgr();  if( PaneMgr ) {    var PropPane = PaneMgr.findPane( 'DzParametersPane' );    if( PropPane ) {      var NodeEditor = PropPane.getNodeEditor();      if( NodeEditor ) {        PropArray = NodeEditor.getPropertySelections( true );      }    }  }  return PropArray;};  // utilities_GetSelectedPropertiesArray()

    I've forgotten how I found this, but I think it was mostly from a post by Rob a few years ago, and/or from mCasual, plus a bit of experimentation.

     

    metrantor said:

    2) I would like to create a keyframe for the selected parameter in the current, the previous, and the following frame and set the mode of change to constant. Is there an example somewhere?

    DzEnumProperty::setValueFromString()

    DzFloatProperty::setValue()

    DzIntProperty::setValue()

    ...etc., plus the various setKey*() functions (I think).

     

     

    Post edited by Praxis on
  • Stretch65Stretch65 Posts: 157

    Interesting ... 'getNodeEditor()' ??  Doesn't appear to be documented.

  • PraxisPraxis Posts: 240
    edited July 2020

    Found Rob's post that I referred to above: Self-Discovery

    I regard it as the most important and useful item ever posted to the SDK/Scripting Forums.

    The method of iterating over members can be used to discover useful undocumented info about any descendant of an ECMASCript Object - just remember that undocumented stuff is not supported: "IF you're up for a bit of self-discovery (i.e. no published documentation) and you realize that what you discover isn't officially supported. Meaning, it may change, without warning or notification."

    See also: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/properties/node_properties/start

     

    Post edited by Praxis on
  • metrantormetrantor Posts: 10
    Praxis said:
    metrantor said:
    1) is there a way to find out in a script which single parameter or group of parameters was selected in the UI parameter tab?

    This works for me:

    function utilities_GetSelectedPropertiesArray()      // : Array of DzProperty{  var PropArray = undefined;  var PaneMgr = MainWindow.getPaneMgr();  if( PaneMgr ) {    var PropPane = PaneMgr.findPane( 'DzParametersPane' );    if( PropPane ) {      var NodeEditor = PropPane.getNodeEditor();      if( NodeEditor ) {        PropArr = NodeEditor.getPropertySelections( true );      }    }  }  return PropArray;};  // utilities_GetSelectedPropertiesArray()

    I've forgotten how I found this, but I think it was mostly from a post by Rob a few years ago, and/or from mCasual, plus a bit of experimentation.

     

    metrantor said:

    2) I would like to create a keyframe for the selected parameter in the current, the previous, and the following frame and set the mode of change to constant. Is there an example somewhere?

    DzEnumProperty::setValueFromString()

    DzFloatProperty::setValue()

    DzIntProperty::setValue()

    ...etc., plus the various setKey*() functions (I think).

     

     

    Hey, Praxis,

    that was exactly what I have been looking for! Thank you very much!

  • PraxisPraxis Posts: 240

    You are welcome.

    P.

Sign In or Register to comment.