Hello!
From Python, I'd like to be able to list all file paths referenced from a project file the same way that the Path Manager does. Is this possible in Python, and can someone point me to it?
Thank you!
attrs = ix.api.OfAttr.get_path_attrs()
for attr in attrs:
path = attr.get_string()
attr_name = attr.get_name()
obj_name = attr.get_parent_object().get_name()
is_output = ix.api.OfAttr.get_visual_hint_name(
attr.get_visual_hint()) == "VISUAL_HINT_FILENAME_SAVE"
type_val = "output" if is_output else "input"
info = {"object": obj_name, "attribute":attr_name, "path": path, "type": type_val}
ix.log_info(info)
attrs = ix.api.OfAttr.get_path_attrs()
for i in range(attrs.get_count()):
attr = attrs[i]
Traceback (most recent call last):
File "<string>", line 5, in <module>
File "/opt/clarisse5/clarisse/python2/base.py", line 981, in <lambda>
__getattr__ = lambda self, name: _swig_getattr(self, CoreBaseObject, name)
File "/opt/clarisse5/clarisse/python2/base.py", line 80, in _swig_getattr
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'CoreBaseObject' object has no attribute 'get_count'
attrs = ix.api.OfAttr.get_path_attrs()
print(attrs.get_class_info())
# same сlass in 4 and 5 versions
<base.CoreClassInfo; proxy of <Swig Object of type 'CoreClassInfo *' at 0x7fb153b30ba0> >
# but in errors as on this command:
print(attrs.get_name())
# I get different information
#Clarisse 4
Traceback (most recent call last):
...
AttributeError: 'OfAttrSet' object has no attribute 'get_name'
#Clarisse 5
Traceback (most recent call last):
...
AttributeError: 'CoreBaseObject' object has no attribute 'get_name'