Jump to content

setting a string parm to python script in HDA?


jonp

Recommended Posts

I'm a bit lost on how to set the default value of a string parameter in a HDA to be a python command. Typing my script command into the default value just gets it interpreted as a regular string value. Any advice?

Link to comment
Share on other sites

I'm a bit lost on how to set the default value of a string parameter in a HDA to be a python command. Typing my script command into the default value just gets it interpreted as a regular string value. Any advice?

I got around it by using `pythonexprs` in the parameter default, which works well enough for me... solved!

Link to comment
Share on other sites

Setting default parameter values/strings to be python isn't currently possible. Your pythonexprs method is one of the alternatives. Another way it could be done is using an OnCreated script that would set that parameters expression type to being Python when the node is instantiated. This way you could just leave the default value as your python script and when the node is created that expression is set to being Python.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...