Path Object¶
You can find the code documentation here: (no idea how to do links in sphinx)
Examples:¶
from cgl.core.path.object import PathObject
# dictionary example
dic_ = {
"company": "premise",
"project": "ASJ",
"entity_type": "assets",
"tree": "source",
"sequence": "char",
"shot": "jesus",
"task": "rig",
"variant": "default"
}
po2 = PathObject().from_dict(dic_)
print(po2.get_path())
# path example
path_ = r"Y:/prod/premise/source/ASJ/assets/char/jesus/rig/default/tom.m/000.000/high"
po = PathObject.from_path_string(path_)
print(po.user)
print(po.resolution)
# high res
# create a publish version of the pathObject
po = po.copy(user="publish", latest=True)
print(po.get_render_path())
po.set_attrx("resolution", "prv")
print(po.get_render_path())
# get the animation resolution path
po.set_attrx("resolution", "anm")
print(po.get_render_path())
# get the crd resolution path
po.set_attrx("resolution", "crd")
print(po.get_render_path())
print(po.get_data_path())
There’s much more you can do with pathObject, but those cover a lot of the basics.