Jump to content

How to write a multi-line script inside Callback Script parameter in P


magneto

Recommended Posts

Hi,

 

I am adding a parameter to an existing op so it's not gonna be a new op, and I want to write a multi-line Python script inside the Callback Script parameter. But when I do so, and save, Houdini just makes them 1 big line with spaces in between lines, which obviously doesn't work.

 

Since there is no place for me to store a script, if I am not wrong, I need to write it here.

 

 

Thanks :)

Link to comment
Share on other sites

If the parameter is a one off then in this situation I would stick the code in hou.session since it just has to be among for the ride in the hip file. If it's more of a preset type of thing then it's probably easier to just shove in a module somewhere. You can easily have simple multiple python statements on a single line (separated by ; ) but trying to do more advanced things breaks quickly.

  • Like 1
Link to comment
Share on other sites

Guest mantragora

...(separated by ; )...

Oh yeah, it was semicolon :D. But the comma works too, just that it would be good to have confirmation from SESI that it's not a bug

 

Anyway, if you forget what is used as a separator for "multiple statements in one line", you can refer to this table in wikipedia.

  • Like 1
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...