[pyext_reflection] handle bool in the reflection property __setattr__#240
Open
selcuk-i wants to merge 1 commit into
Open
[pyext_reflection] handle bool in the reflection property __setattr__#240selcuk-i wants to merge 1 commit into
selcuk-i wants to merge 1 commit into
Conversation
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>()``.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(
PropertiesProxy.__setattr__in pyext_reflection.cpp) dispatched onint / float / string / int_array, but had NO bool branch — so setting a
reflected
booldirectProperty from Python hitOrkAssert(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 = boolpathcrashed.
Add the bool branch first (before int — bool is a distinct ITyped),
casting the Python value directly with
value.cast<bool>().