Skip to content
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

get_rendering_string: don't use 'source.Proxy.type' attr to choose RenderHandler #193

Merged
merged 1 commit into from Jun 11, 2022

Conversation

alexneufeld
Copy link
Contributor

ref: https://forum.freecadweb.org/viewtopic.php?style=4&f=10&t=69321

Scripted objects can create/set arbitrary attributes in their Proxy
objects. Formerly, if an object's Proxy had a 'type' attribute, it would
be used to determine which Rendering Handler should be used. This behavior
caused errors e.g. for FastenersWB objects, which used the type param
to indicate the specification of a fastener.

This commit changes the behavior of the get_rendering_string function
to check if an object needs a specific handler using the Proxy's python type.

The example file in the linked forum post now works properly with this fix.

…derHandler

Scripted objects can create/set arbitrary attributes in their Proxy
objects. Formerly, if an object's Proxy had a 'type' attribute, it would
be used to determine which Rendering Handler should be used. This behaviour
caused errors e.g. for FastenersWB objects, which used the type param
to indicate the specification of a fastener.

This commit changes the behaviour of the get_rendering_string function
to check if an object needs a specific handler using the Proxy's python type.
@alexneufeld alexneufeld changed the title get_rendering_string: don't use 'source.Proxy.type' attr to chose RenderHandler get_rendering_string: don't use 'source.Proxy.type' attr to choOse RenderHandler Jun 10, 2022
@alexneufeld alexneufeld changed the title get_rendering_string: don't use 'source.Proxy.type' attr to choOse RenderHandler get_rendering_string: don't use 'source.Proxy.type' attr to choose RenderHandler Jun 11, 2022
@howetuft
Copy link
Collaborator

howetuft commented Jun 11, 2022

Thank you for your contribution!
Please note however it will break an old compatibility with ArchTexture.PointLight (see here)... Therefore I'm going to accept gratefully your PR, but there may have some refactoring to do on it to restore this compat...

@howetuft howetuft merged commit 118354b into FreeCAD:master Jun 11, 2022
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.

None yet

2 participants