-
Notifications
You must be signed in to change notification settings - Fork 426
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
--Configuration support for Magnum Vector2, Vector4, Color3 and Color4, UserDefinedAttr support of str Lists #2028
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
We might want to consider supporting Mn::Vector2
as well.
3b67d2a
to
1927d98
Compare
…ctor4. Note, to properly read from JSON into a color4 or a quaternion, the keyed-ConfigValue needs to be initialized on construction as the appropriate type
--Type of field is either determined by pre-existing field's type or by tag substrings in the label. Otherwise, defaults to Mn::Vector4.
--Folows the same precedent as Mn::Color4 - type of field will be specified by substrings "clr" or "color" in the label, name-insensitive.
The magnum vector3 and vector4 types can be queried as colors
--Added the ability to access vector config fields as colors, to expose special color functionality.
1927d98
to
a5ea061
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing and adding things here. Also appreciate the typo fixes throughout. :)
Motivation and Context
This PR adds Configuration support for Magnum Vector4. With regard to the user_defined attributes, the type for equivalently sized fields in JSON is determined by substring tags found in the numeric fields' labels - 'orient', 'quat', or 'rotat' will denote a quaternion for a size 4 numeric field, and otherwise the size 4 fields will be Magnum vector4 's.
These are some features that I worked on some before my last contract ended and felt would be useful to add now.
NOTE : I removed Explicit Color3 and Color4 since these were superfluous, but I retrained accessors that would treat Color3 and Color4 getter requests the same as Vector3 and Vector4 respectively.
NOTE : I also added support of user-defined attributes containing a list of variable length of strings, which was already specified as supported in the documentation :) .
How Has This Been Tested
All Python and C++ tests pass. C++ tests were added to exhaustively test label-based type inference.
Types of changes
Checklist