PythonScript - GetPath()

   1492   1   1
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
Hi, I doing something where I need to get usd data and am using the docs examples as a way to learn how to do this.

https://www.sidefx.com/docs/houdini/nodes/lop/pythonscript.html [www.sidefx.com]

however when I try to use GetPath() I get python errors saying object has no attribute GetPath.

I'm assuming the way I am referencing is wrong hence it can't ‘see’ it?

# Add code to modify the stage.
# Use drop down menu to select examples.

from pxr import UsdGeom

node = hou.pwd()
stage = node.editableStage()

#cube = stage.GetPath("/obj/Set_EXR_FileNames/lopnet1/CHECKPOINT")
cube = stage.GetPath("/sopimport1/mesh_0")

# Change attributes directly
#cube.GetAttribute("size").Set(3.5)

Attachments:
Python_USD_GetPath.hiplc (858.2 KB)

User Avatar
Staff
4443 posts
Joined: July 2005
Offline
That's a typo… It should be “GetPrimAtPath”.
  • Quick Links