Search - User list
Full Version: OTL File Callback Script for File extension
Root » The Orbolt Smart 3D Asset Store » OTL File Callback Script for File extension
I want to have a small script that checks if the insert file name has the extension in it if not it should add the correct file extension to it

as for test callback script i have made this one and it doesn't work:

// Hscrpt
if ( ${script_value:e} != “.jsx” ) then
set $script_parm = $script_value + “.jsx”

EDIT: it looks like strcmp should be used but when i insert it still won't work.

the first version i have made a python version in my script(otl /PythonModule) that works but it changes the $HIP to full path so i loss the $HIP what i don't want:

# Python
def getSelectedFile(ropNode):
node = ropNode.parm(“save_file”)
path = node.eval() # Eval doesnt come as $HIP
if path != “.jsx”:
path = path + “.jsx”
return path

has someone a solution hscript or python?

You can use hou.Parm.unexpandedString() to get the raw, unevaluated path.
thanks graham it works :-)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB