Jump to content

set expression by orderMenu value


saca

Recommended Posts

hi,

the orderManu "Type" has "Asset" and "Sequence" and so on.
and I want to set "directory path" from elements.
but each "Type" bring different expression directory path from some elements.

example,in python
-------
if `chi("Type")` == 0:
    theFilePath = `chs("BaseDir")`/`chs("AssetName")`/`chs("fileName")`;
elif `chi("Type")` == 1:
    theFilePath = `chs("BaseDir")`/`chs("SceneName")`/`chs("CutName")`/`chs("fileName")`;
else:

-------
this expression error occursion.

how to set expression in this case?

 

thanks

DirctoryMaker_v001.001.hip

selector.png

Edited by saca
Link to comment
Share on other sites

hi,

this problem was fixed with this expression bellow.

in Python (theFilePath)

---

if (`ch("Type")`) == "0":
  return (ch("BaseDir")+"/"+ch("AssetName")+"/"+ch("fileName"))
elif (`ch("Type")`) == "1":
  return (ch("BaseDir")+"/"+ch("SceneName")+"/"+ch("CutName")+"/"+ch("fileName"))
else:
  return (ch("BaseDir"))

---

DirctoryMaker_v001.002.hip

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