Adding paste relative reference into TOPs python syntax?

   158   1   1
User Avatar
Member
771 posts
Joined: Aug. 2013
Offline
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)
User Avatar
Member
771 posts
Joined: Aug. 2013
Offline
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)
  • Quick Links