-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MissingMemberException
when trying to extend SceneObject
#1273
Comments
@chenkasirer if the item is a data class, how come it doesn't have a name attribute? |
Does it have to be a |
the entire setup is based on pairing |
otherwise perhaps just use |
Gotcha. |
it's a container for several (different) geometries and was thinking of a text label as well, but still figuring stuff out with the new |
let me know if you need help... |
If it's ok I'm closing this now, as our plan will be #1276 |
Been trying to create a new
SceneObject
implementation for something in COMPAS Timber and got this issue where it expects whatever item it wraps to have aname
attribute.I think the culprit is this line:
compas/src/compas/scene/sceneobject.py
Line 71 in 5bcf737
It seems it's supposed to take it from
kwargs
, from the instance or use the class name if the other two don't work. But really if the instance doesn't havename
it always breaks.Admittedly, I had to ask ChatGPT why this doesn't work cause for the life of me I couldn't figure it out, apparently the stuff around the
or
always gets evaluated..@Licini maybe
getattr(item, "name", item.__class__.__name__)
instead?To Reproduce
Steps to reproduce the behavior:
SceneObject
name
asitem
.Expected behavior
Not assume
name
fromitem
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: