Search - User list
Full Version: Adding paste relative reference into TOPs python syntax?
Root » Technical Discussion » Adding paste relative reference into TOPs python syntax?
Mark Wallman
Hi all, I am trying to make TOPs python code to pick up the paste relative reference to make a few folders. Im not really having any luck, Does anyone know what I am doing wrong here? Thanks in advance!

So far I have tried:

import os
import hou

folderPath = hou.(`chs("../../fileDIR")`)
subFolder = "test"

# Combine them directly inside the function
os.makedirs(os.path.join(folderPath, subFolder), exist_ok=True)

--------------------------------------------

import os
import hou

folderPath = hou.expandString(`chs("../../fileDIR")`)
subFolder = "test"

# Combine them directly inside the function
os.makedirs(os.path.join(folderPath, subFolder), exist_ok=True)

------------------------------------------------

import os
import hou

folderPath = "(`chs("../../fileDIR")`)"
subFolder = "test"

# Combine them directly inside the function
os.makedirs(os.path.join(folderPath, subFolder), exist_ok=True)

----------------------------------------------------

import os
import hou

folderPath = hou.node(`chs("../../fileDIR")`)
subFolder = "test"

# Combine them directly inside the function
os.makedirs(os.path.join(folderPath, subFolder), exist_ok=True)

--------------------------------------------------

import os
import hou

folderPath = parm(`chs("../../fileDIR")`)
subFolder = "test"

# Combine them directly inside the function
os.makedirs(os.path.join(folderPath, subFolder), exist_ok=True)
Mark Wallman
Fixed:

import sys, os
import hou

folder_path = hou.evalParm("../../fileDIR")

print (folder_path)


# Combine them directly inside the function
#os.makedirs(os.path.join(folderPath, subFolder), exist_ok=True)
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