Set UI list default from enum

graham_lock
graham_lock Member Posts: 277 PRO

Hi,

I have the following:

export enum EXTRUDE_TYPES
{
annotation { "Name" : "Loft" }
EXTRUDE_TYPES_LOFT,
annotation { "Name" : "Sweep" }
EXTRUDE_TYPES_SWEEP,
}

…

annotation { "Name" : "Loft or Sweep", "Default" : EXTRUDE_TYPES.EXTRUDE_TYPES_SWEEP}
definition.extrudeType is EXTRUDE_TYPES;

I've tried various combinations but I cannot seem to make the list UI default to sweep?

Any help appreciated.

Thank you.

Comments

  • Jed_Yeiser
    Jed_Yeiser Member Posts: 62 PRO

    This appears to be correct. Are there other errors that are showing up that might be preventing the UI from displaying correctly? Are you updating this parameter using editing logic? Are you sure that it's not defaulting correctly? As embarrassing as this is to admit, I've run into similar issues only to realize that I added a default after a certain parameter had been created and set - so it stayed as I'd set it rather than displaying the default value. If that's the case, just delete your feature and create a new one - the new feature will have correct defaults.

  • graham_lock
    graham_lock Member Posts: 277 PRO

    Thanks Yed.

    I deleted the feature and then recreated it as you suggested and it works!