Skip to content

[pyext_reflection] handle bool in the reflection property __setattr__#240

Open
selcuk-i wants to merge 1 commit into
tweakoz:developfrom
selcuk-i:pr240
Open

[pyext_reflection] handle bool in the reflection property __setattr__#240
selcuk-i wants to merge 1 commit into
tweakoz:developfrom
selcuk-i:pr240

Conversation

@selcuk-i

Copy link
Copy Markdown
Contributor

(PropertiesProxy.__setattr__ in pyext_reflection.cpp) dispatched on
int / float / string / int_array, but had NO bool branch — so setting a
reflected bool directProperty from Python hit OrkAssert(false)
("prop unhandled type"). The GETTER (.dict) already handled bool;
only the setter was missing it.

This blocks the Python archetype-declaration path for ANY component with
a reflected bool. The .ecs JSON loader
handles bool fine, so scene-file archetypes were unaffected; only the
runtime SceneData.declareArchetype + cd.properties.X = bool path
crashed.

Add the bool branch first (before int — bool is a distinct ITyped),
casting the Python value directly with value.cast<bool>().

The Python ``cd.properties.<Name> = value`` setter
(``PropertiesProxy.__setattr__`` in pyext_reflection.cpp) dispatched on
int / float / string / int_array, but had NO bool branch — so setting a
reflected ``bool`` directProperty from Python hit ``OrkAssert(false)``
("prop<X> unhandled type"). The GETTER (``.dict``) already handled bool;
only the setter was missing it.

This blocks the Python archetype-declaration path for ANY component with
a reflected bool. The .ecs JSON loader
handles bool fine, so scene-file archetypes were unaffected; only the
runtime ``SceneData.declareArchetype`` + ``cd.properties.X = bool`` path
crashed.

Add the bool branch first (before int — bool is a distinct ITyped<bool>),
casting the Python value directly with ``value.cast<bool>()``.
@selcuk-i selcuk-i changed the title pyext: handle bool in the reflection property __setattr__ [pyext_reflection] handle bool in the reflection property __setattr__ Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant