USD

Research URL


Term & Concepts


  • Stage : this stands for high-level layer which contains other layers
  • Layer : this is a layer which is made up for Stage
  • Prim : the primary container object. this is comsist of Specifier (-> schema)
Term Definition Why to use
Model Hierarchy the hierarchy structure of USD ..
Kind the feature that decide type and role of prim.
There are five category
- model
- group
- assembly
- component
- subcomponent
to make usd readable and to check if the model hierarchy of usd is valid
Default prim it stands for the prim which renderer need to look at. So, it show that which prim is the core prim or basic prim. to make it easier for renderer to reference. and the rendere render a scene based on the default prims
LayerStack The ordered set of layers.
as first and strongest
 
Session Layer the layer which is targeted to work on  
Namespace this is equal to prim path
(ex : /Root/Child/SubChild )
 
  • Model Hierarchy
/World
    ├── /World/Character
    │      ├── /World/Character/Body
    │      └── /World/Character/Head
    │             ├── /World/Character/Head/Eyes
    │             └── /World/Character/Head/Mouth
    └── /World/Environment
           ├── /World/Environment/Trees
           └── /World/Environment/Sky

Scripts exmaple


Create or Open stage

from pxr import Usd, UsdGeom

root_stage_usd_path = ".../asset.usd"
cur_stage = Usd.Stage.CreateNew(root_stage_usd_path)

cur_stage = Usd.Stage.Open(root_stage_usd_path)

Create (Define) or Search Prim

prim_path = "/root/child"

xform_prim = cur_stage.DefinePrim(prim_path , "xForm")

# using schema
xform_prim = UsdGeom.Xform.Define(stage, "/Root")

# Find prim
tar_prim = cur_stage.GetPrimAtPath(prim_path)

Get and Set Defualt prim

default_prim = stage.GetDefaultPrim()
stage.SetDefaultPrim(new_prim)

Override Prim

new_prim = stage.OverridePrim(f"/{new_default_prim_name}")

Save stage or root layer

# Save all layer under the current stage
stage.Save()

# Save only current root layer
stage.GetRootLayer().Save()

Save metadata in houdini’s lop network

save_metadata_001

Bind material in houdini’s lop network

bind_mat



Arnold Render Delegate Build


1. build enviroment

OS : Rocky Linux Maya and Arnold Arnold SDK download
bashrc before build bashrc after build

2. How to

  1. clone gits (OpenUSD / arnold-usd)
  2. download arnold sdk
  3. prepare python27 (not exists as default in rocky linux anymore)
  4. do install python devel for pyconfig.h error
     dnf install python2-devel
     dnf install python3-devel
    
  5. do build
     [OpenUSD]v23.08
     /usr/bin/python3.6 ./build_scripts/build_usd.py --force-all --build-shared --no-examples --no-docs --no-python-docs --ptex --openvdb --openimageio --opencolorio --alembic --hdf5 --materialx /opt/USD
    
     [arnold-usd]7.2.3.2
     cmake -DCMAKE_BUILD_TYPE=Release -DARNOLD_LOCATION=/opt/arnold_sdk/Arnold-7.1.3.2-linux -DUSD_LOCATION=/opt/USD -DCMAKE_CXX_STANDARD=14 -DBUILD_DOCS=false -DCMAKE_INSTALL_PREFIX=/opt/arnold_usd
    
  • caution
    • Do not use python39 or other python verions with ‘dnf install python3.X’
    • Use default python3.6 version
    • Reason : There is a conflict between python paths
  1. use mayaUSD usdview to use
     {mayapy_path} /usr/autodesk/mayausd/maya2023/{mayausd_version}/mayausd/USD/bin/usdview {usd file}
    

3. Render result



Warnning Message


1. Material Bind Error

  • how to solve ?
    1. check exported data in usdview –> there is no warnning message
    2. compare between exported data and written data which is made by code
    3. /usersetup/linux/usd/OpenUSD_source/pxr/usd/usdShade/materialBindingAPI.cpp –> cause : HasAPI
    4. find difference –> prepend apiSchemas = [“MaterialBindingAPI”]
    5. Do –> geo_prim.ApplyAPI(UsdShade.MaterialBindingAPI)

2. Unresolved Reference Path

Unresolved reference path </Geometry> 
on prim @anon:000000005A89D200:LOP:rootlayer@,
@anon:000000005A89D000:LOP:rootlayer-session.usda@</asset>. 
(recomposing stage on stage @anon:000000005A89D200:LOP:rootlayer@ 
<00000001BB883200>) 

이 경고는 USD(Universal Scene Description)의 씬 구조에서 발생하는 경로 참조 문제를 나타냅니다. 경고를 해석하고 문제를 해결하려면 다음을 이해해야 합니다:

  • 경고 원인
    1. Unresolved Reference Path:
      • 경고는 경로 </Geometry>가 참조되었지만, 해당 경로에 실제로 존재하는 프림(prim)이 없음을 나타냅니다.
      • 참조 경로는 종종 다른 USD 파일의 내용을 로드하거나, 다른 레이어에서 데이터를 가져오는 데 사용됩니다. 경고는 특정 레이어 또는 파일에서 </Geometry>를 찾을 수 없음을 의미합니다.
    2. Prim 정보:
      • 경고에서 </asset> 프림이 문제의 참조를 포함하고 있는 것으로 보입니다.
      • 이 프림이 USD 레이어에 정의된 참조(references) 또는 인스턴싱(payloads) 중 하나에서 문제가 있을 수 있습니다.
      • it means that the assembly asset usd can not recognize the default prim of the referenced usd
    3. Stage 구성:
      • 경고는 해당 참조가 @anon:000000005A89D200:LOP:rootlayer@ 스테이지와 연결되어 있음을 나타냅니다. 익명의 스테이지나 세션 레이어(temporary, in-memory layers)에서 발생할 가능성이 높습니다.
  • 해결 방법

    1. 참조 경로 확인
      • USDView 또는 사용하는 DCC 툴(Houdini, Maya 등)의 Stage Viewer에서 해당 프림(</asset>)을 선택합니다.
      • references 또는 payloads 속성을 확인하여 참조 경로가 올바르게 설정되었는지 점검하세요.
      • <Geometry> 프림이 로드되지 않았다면, 참조된 파일 경로나 경로 구성이 잘못되었을 가능성이 큽니다.
    2. 참조된 파일 확인
      • @anon:000000005A89D200:LOP:rootlayer@ 또는 @anon:000000005A89D000:LOP:rootlayer-session.usda@에 정의된 내용을 확인하여 </Geometry> 프림이 존재하는지 확인하세요.
      • 만약 경로가 다른 USD 파일에 있는 데이터를 참조하려 한다면, 참조된 파일이 올바르게 로드되고 있는지 확인합니다.
    3. Check if the default prim is set correctly
      • you need to check if the default prim is set correctly to the prim which exists in that usd file.
    4. 경로 수정
      • 경로 문제를 수정하려면:
        • 파일 경로가 절대 경로인지, 상대 경로인지 확인하고 올바른 경로로 업데이트합니다.
        • references를 사용하는 경우 정확한 파일 이름과 경로를 지정하세요.
      • Example:
        def "asset"
        {
            references = @path/to/geometry_file.usda@
        }
        

results matching ""

    No results matching ""