Jump to content

expressions in Material SOPs?


Recommended Posts

This seems like it should be simple:

I'm trying to use an expression (python) to assign a material named after the object, by putting an expression in a Material SOP like this:

hou.node("../../shopnet/" + hou.node("../").name()).path()

( /obj/geo1 should get assigned the full path to ../../shopnet/geo1 )

but it's not evaluating, I get a warning:

The node "hou.node("../...." was not found or was the wrong type for this operation.

I've tried this same expression in an Attribute Create SOP and it works, how can I force this to evaluate for the Material SOP?

Thanks for any help!

-JS-

Link to comment
Share on other sites

Dunno, seems to work here?

eetu.

hmm weird! your file works for me, but I try the exact same thing in my file and it doesn't do anything, the parameter field doesn't even turn green. SOP flakyness? Oh well, I got around it by using an attribute create SOP (which didn't work at first, but then started working when I tried it again 10 minutes later)

-JS-

Link to comment
Share on other sites

Ah, I think I got it.

When you click on the parameter name it toggles the field between the "value" and "source" modes (as you full well know)

I guess you've just pasted/written the expression when the field was in the "value" mode...

eetu.

Link to comment
Share on other sites

Ah, I think I got it.

When you click on the parameter name it toggles the field between the "value" and "source" modes (as you full well know)

I guess you've just pasted/written the expression when the field was in the "value" mode...

eetu.

hmm that's a little wonky but you're right, I had to toggle the blank field (?) and then it worked. Thanks!

-JS-

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