Jump to content

Parameter boxes all red for Python


TonyL

Recommended Posts

I'm trying to put some Python code into the tx parameter box of a point SOP, but I'm getting a syntax error, even when the code is super-simple (x = 1, return x).

When I changed the expression language for the Point SOP from Hscript to Python all the parameter boxes turned red. Does that maybe mean I can't use Python in a Point SOP? All of the boxes in the Point SOP already had text in them, I wonder if that means anything, like as soon as you enter text in a box it gets branded with that particular expression language and won't let you use the other even if you change it. I just tried entering some Python code in another SOP, and when I changed the language from Python to Hscript that box with the code turned red too.

Any ideas?

Link to comment
Share on other sites

OK, I figured it out. First, red does indeed mean there's a problem with the parameter box. To get rid of the problem, you have to delete everything from that box, even if the Python code is fine (or Hscript code if you've switched the language for the box from Python to Hscript). The box should now have a black background (and maybe a default 0 inserted), at which point you can now go back in and enter in the code for your new language. That's what worked for me, it seems if you already have code in your parameter box (or text is in there by default like it is for a point SOP) and you switch languages, the box still thinks it's supposed to use the old language until you clear it.

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...