Fix IfcSurfaceStyleRendering colour reset on save#7882
Open
falken10vdl wants to merge 1 commit intoIfcOpenShell:v0.8.0from
Open
Fix IfcSurfaceStyleRendering colour reset on save#7882falken10vdl wants to merge 1 commit intoIfcOpenShell:v0.8.0from
falken10vdl wants to merge 1 commit intoIfcOpenShell:v0.8.0from
Conversation
d4f280d to
38a660e
Compare
Member
|
Nice! I ran into this quite a bit. It's funny how some bugs you just live with, without reporting. :) |
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.
Problem
When an
IfcSurfaceStyleRenderinghadDiffuseColour,SpecularColour, orSpecularHighlightset tonullin the IFC file, loading the style into the Bonsai panel set the correspondingis_*_nullflag toTrue. Editing the colour picker did not clear the flag. On save,get_shading_style_data_from_propsread the flag and wroteNoneback, discarding the user's change and resetting the material to its default colour.tool/style.py—get_shading_style_data_from_props: before reading a colour prop, check the corresponding null flag. If it is set, writeNoneand skip. This makes live-preview and save agree on null vs. non-null.bim/module/style/prop.py: a_make_clear_null_updaterfactory produces named callbacks that clear the null flag via dict access (self[is_..._null] = False) before delegating toupdate_shader_graph. The three aliases (update_diffuse_colour,update_specular_colour,update_specular_highlight_value) are wired to all colour/ratio/class pickers. The nullBoolPropertytoggles are also wired toupdate_shader_graphso toggling them triggers an immediate preview rebuild.Cheers!