File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,15 @@ def obj_user_data_to_dict(obj) -> dict:
256256
257257 for description_id , base_container in obj .GetUserDataContainer ():
258258 key = base_container [c4d .DESC_NAME ]
259- value = obj [description_id ]
259+
260+ try :
261+ value = obj [description_id ]
262+ except AttributeError :
263+ # Fix #23: Silently ignore values that are not wrapped to Python
264+ # because we know user data we are interested in isn't any of
265+ # those anyway. Avoids object unknown in Python error.
266+ continue
267+
260268 user_data [key ] = value
261269
262270 return user_data
@@ -290,7 +298,13 @@ def read(node) -> dict:
290298def get_object_user_data_by_name (obj , user_data_name ):
291299 for description_id , base_container in obj .GetUserDataContainer ():
292300 if base_container [c4d .DESC_NAME ] == user_data_name :
293- return obj [description_id ]
301+ try :
302+ return obj [description_id ]
303+ except AttributeError :
304+ # Fix #23: Silently ignore values that are not wrapped to
305+ # Python because we know user data we are interested in isn't
306+ # any of those anyway. Avoids object unknown in Python error.
307+ continue
294308
295309
296310def get_siblings (obj , include_self = True ):
You can’t perform that action at this time.
0 commit comments