@@ -119,7 +119,7 @@ def detect_current_context():
119119 return None
120120
121121
122- def get_sceneobject_cls (item , context = None , sceneobject_type = None ):
122+ def get_sceneobject_cls (item , context = None ):
123123 """Get the scene object class for a given item in the current context. If no context is provided, the current context is detected.
124124 If the exact item type is not registered, a closest match in its inheritance hierarchy is used.
125125
@@ -129,8 +129,6 @@ def get_sceneobject_cls(item, context=None, sceneobject_type=None):
129129 The item to get the scene object class for.
130130 context : Literal['Viewer', 'Rhino', 'Grasshopper', 'Blender'], optional
131131 The visualization context in which the pair should be registered.
132- sceneobject_type : :class:`~compas.scene.SceneObject`, optional
133- The scene object type to use.
134132
135133 Raises
136134 ------
@@ -156,17 +154,15 @@ def get_sceneobject_cls(item, context=None, sceneobject_type=None):
156154 context = detect_current_context ()
157155
158156 itemtype = type (item )
159- cls = None
160157
161- if sceneobject_type is not None :
162- cls = sceneobject_type
163- else :
164- context = ITEM_SCENEOBJECT [context ]
158+ context = ITEM_SCENEOBJECT [context ]
159+
160+ cls = None
165161
166- for inheritancetype in inspect .getmro (itemtype ):
167- cls = context .get (inheritancetype , None )
168- if cls is not None :
169- break
162+ for inheritancetype in inspect .getmro (itemtype ):
163+ cls = context .get (inheritancetype , None )
164+ if cls is not None :
165+ break
170166
171167 if cls is None :
172168 raise SceneObjectNotRegisteredError ("No scene object is registered for this data type: {} in this context: {}" .format (itemtype , context ))
0 commit comments