Blender 5.2 here, maybe 2-3 day old. Latest Daily Bonsai is still 250415 (No updates since release of Bonsai official)
Will update Blenders and maybe go to BonsaiPR.
Yes it looks different here.
When I apply the Render Diffuse Color it is there, in Settings and Render View - until I press Save
But (only) when I have selected any "Reflection method", the Render Diffuse Color shows only in Settings, not in Render View !?
The first one seems to fit well the https://github.com/IfcOpenShell/IfcOpenShell/pull/7882
So if I got it correct your bug fixing is pretty new and not included in Daily Bonsai is still 250415 ?
Otherwise I have to boot the PC and test there.
At first Surface Styles seemed to work.
Then I also added Reflection Method (Glass for Glass and Plastic for Frame). Not 100% sure but I think I had some intermediate loss ?
But when I save and close the IFC and reopen it, my Frame lost their red in Viewport. Interestingly the Setting was still there but save "Render" did not bring it back. I needed to save "Shade" to get it back. But reopening the File and its gone again
So for me it works better - but still has quirks.
(If you adit and save multiple Tabs like Render and Shade, add Reflection Methods, edit Diffuse and Surface Colors
And my other big problem ....
In Daily Builds I had Metadata set to ".metadata.blend" and it had worked.
When I switched to BonsaiPR, metadata was off. After reactivating I looked at the name option and set it to "_metadata.blend". (save metadata option in IFC file was still activated)
When saving the IFC I thought I missed the metadata saving in status bar. And yes, in Finder there was the old ".metadata.blend" with old save date - I instead would have expected a second "_metadata.blend".
Thought it needs some file changes beside just view changes, to save. Tried a few times and I saw the status bar confirming - but no "_metadata.blend".
I thought this may be a problem - and deleted the old metadata - but still no "_metadata.blend".
So I went to PR Settings and set filename back to ".metadata.blend". (because it may insist on the same File Name as the IFC !?) - but still no "_metadata.blend".
If I save the IFC and switch to Finder immediately I see that the Temp File for the Metadata appears. But it soon goes away, without the writing the real ".metadata.blend".
@theoryshaw said:
No ha vuelto a suceder, pero te avisaré si ocurre, o cuando ocurra.
I'm learning Spanish, so thought I'd practice. :)
It hasn't happened again, but I will let you know if or when it does.
Perfecto. ¡Muchas gracias! (usas subjuntivo... eso son palabras mayores ;) buen trabajo.)
Cool. Thanks! I think that in one of the versions the copying of the external shader nodes was not checking if there was already one (second switch). Hopefully it is now ok. I am asking the ok for https://github.com/IfcOpenShell/IfcOpenShell/pull/7882 from @Andrej730 and @Moult
I think that in order to make this as fast as possible both flat/pretty shaders should be loaded in memory but only have active one (I have read that blender will not move the non active chain to the GPU, it will only consume CPU memory). Then have the current bpy.ops.bim.update_current_style for fast switching between them and then add another button (operator) to reload from disk in case one has changed the external files.
Cheers!
BTW
From a Viz point of view I would wish for a Surface Style Interface more similar to Blender's standard Material Interface .... where you have access to all Options at a time (not devided to Shaded/Render/...) as it makes it very complicated and (user)error prone to me. Therefore I would also like to save all edit at a time - or better just automatically/instantly save all edits (as in Blender). Maybe with an Undo option for all edits combined.
Usually my View is in Rendered Mode (as long as it causes no lags) and I edit Surface Style mainly for "Render". But I also edit Shaded color because I need it for Speckle (which unfortunately so far does not display Materials (but keep some Mat data and share/export these) or even supports image textures)
OK, I "saved as" my test file with a new name and thank god I now got my ".metadata.blend". Back !
(Not sure what exactly the problems was ? setting the "_metadata.blend" ending, having had a "similar" metadata already, deleting the former metadata, ..... ?
But my Render Surfaces still go back to default in Viewport when I re-open the File.
The "Render" settings are still there (maybe it changed/mixed the Reflection option ?) but saving "Render" again has no Effect.
But when I then open and save "Shaded" - Now "Shaded" Color appears in my rendered(!) Viewport WTF
and when I then open and save "Render" - all Render Settings are reverted by defaults (!?)
and then I can finally reset them and get them back and see them in rendered Viewport - what's up ?
(at least for that Blender Session ?)
So I still have to think there is some sabotaging dark force somewhere in the Surface Style Editor Code ?
BTW,
When I activate a Reflectance Mode (e.g. Glass) - I realized that a text appears "Supported Reflectance Modes are ..." Physical (!) (where can I find this it ? Sounds great. Can I control it by Setting an IOR like in "everything has Fresnell"-VRay ? SNCR Flat and Notdefined (Obviously by far the most boring of all offered Reflections options)
So it seems I allowed myself to eat from the forbidden fruits of the reflectance tree. My bad.
@zoomer I have not looked to the actual implementation of the modes in "Render" mode. I was more looking to make sure that the infoo is saved and can be later retrieved (it looks that not working in some of your use cases) and also have a precedence order in so if one mode is not available it will use the next one in the precedence order.
Cheers!
Still have not tested if it works on Windows - I am a bit distracted by also playing with Freecad and finally getting a bit used to it and even having some fun.
@theoryshaw said:
Something along the way doubled up the material definitions.
So that might be the cause of the bim.activate_drawing delay.
will key an eye out if it happens again.
Uiuiuiui ...
Could it be that this happens because your whole IFC file doubled inside Blender ?
This what happened here.
I realised I have IfcProject/My_Project and IfcProject/My_Project.001 in my Outliner!?
I tried to move Walls and check their connections reliability. When moving the first Wall I got 2 Walls, the moved one and a ghost at the previous position. Similar strange behaviour when updating geometry. But when I selected I saw only half of my selection in Outliner, until I got that Outliner scrolls up and down. So I realized the Project doublet.
Strange, I do not see double Render Nodes as in your screenshot.
But I see that the IFC SurfacesStyle's resemblance, the Blender Materials are doubled.
I can't replicate (?)
The original yesterday Testfile, which I "saved as" because it would not create the metablend, did not have the doublets. And was again able to save the metadat - far a short time ....
When I tried to delete the Project doublets (this time it was 4 !?) from Outliner it left one doublet. Tried again and it asked for unlocking Spatial. I did, pressed delete and Blender crashed .....
Lots of strange things happen. I think I should go back from Blender Alpha to 5.1.1 official. Maybe for Bonsai too.
also probably worth saying, i don't use the ".metadata.blend" approach, I just use the old .blend/.ifc syncing way. Not sure that makes a difference here.
Will try.
Or maybe it has to do with my Start File or AddOns or ...
I tested all from scratch again in Blender 5.1 and daily build Bonsai. It is all so strange and I think worse than it was in PR.
I got the Materials of the Door in Blenders Shader Panel - but whatever I do, doing Surface Style edits, there is no transfer to Blender Shaders.
And of course while editing Styles I may see my Diffuse Color edits in View - but as soon as I save the Style it gets defaulted again here.
The debug output makes the bug crystal clear. Let me trace through it:
Root cause: _remove_external_branch only walks connected links backward from BIM_Output_External, leaving orphan nodes from the external material stranded. Every subsequent update_external_branch call re-pastes all 22 nodes (including new copies of those 5 orphans), which get renamed to .006/.007, .008/.009, etc., growing indefinitely.
From the first _remove_external_branch call:
Removed (connected to output): 17 nodes
Left behind orphans from ext material: Image Texture.004, Image Texture.005, RGB to BW.001, Color Ramp.001, Brightness/Contrast.001
Next paste adds them again as Image Texture.006, Image Texture.007, RGB to BW.002, etc. Each subsequent toggle adds 5 more orphan duplicates.
The fix is to rewrite _remove_external_branch to keep only the flat-branch nodes (walk backward from BIM_Output_Flat) and remove everything else:
Fix IfcSurfaceStyleRendering colour reset on save#7882 has already been merged :) Thanks @Moult for reviewing it!
Next step I will issue another PR to establish a precedence of Blender representation based on what styles are available so we try to avoid showing "white" colors if somthing is alrady available. Currently if you have a "Shade" style but no "Render" style, Blender will default to "white" if your Viewport Shading is set to Material_Preview or Rendered. The idea is that in this case it uses principled BSDF from "Shade" so in the end we have as proposed above but using the already used terminology in Bonsai:
"Shading (maybe this one could be renamed Shade/Render or Flat)" (Precedence chain: Render → Shade)
Solid: Flat colour (color_type=MATERIAL)
Material Preview/Rendered: IFC node graph (Render, or Shade colour)
"External (maybe this one could be renamed Texture/External or Pretty)" (Precedence chain: External → Render+Texture → Render → Shade):
Solid: UV texture (color_type=TEXTURE, UVs on demand)
Material Preview/Rendered: External .blend → IFC node graph fallback
In https://github.com/IfcOpenShell/IfcOpenShell/issues/8001 tagehedin has been asking how to fetch external styles (no need to open the external blend file in blender, but rather to select it in the "External" menu of Bonsai Styles. See below a video:
This will add an entry to IFC file so Bonsai know how to retrieve it (so relative path is important if you want to package this to open it in another computer)
#110=IFCSURFACESTYLE('StoneStyle',.BOTH.,(#111));
#111=IFCEXTERNALLYDEFINEDSURFACESTYLE('materials_bk/stone-wall_915e47a5-1a34-42c9-ac57-55106fceff8a/stone-wall_2K_957017a8-f26c-4896-9481-e9d67c23becd.blend','materials/Stone Wall','Stone Wall');
After a short test it seems I can save my Render and Shade Styles now persistently.
For the first time ! Which is big news.
(But so far I avoided Reflection or other further detailed Settings)
BTW,
I see there would be a 20260425 daily Bonsai build.
But my 3 Blenders here do not offer Updates and stick with the 20260421.
Does that mean that the newer had issues and therefore do not appear in remote Updates ?
(Or just a hiccup that should be PR'ed)
As BonsaiPR did update on all Blenders.
(OK not all, does not install on 5.0.1 because of Python version, but shows the Update)
@zoomer I have gone over the code and there are a number of supported/not supported combinations.
I have issued a new PR Surface styles fixes and message warnings#8014 which is solving some bugs and also improve the user experience on what is supported (you get a warning if you select something that will be dropped):
Add warning when PHYSICAL/NOTDEFINED uses IfcColourRgb for Metallic, because this value is IFC-only and does not affect Blender appearance.
Add warnings for emissive and specular ratios in FLAT reflectance method (IFC only no Blender appearance)
Fix Lighting/refraction UI drawing crashes and add warning message that they are only IFC data not used by Blender for surface appearance
Add warning messaging for unsupported reflectance methods and texture modes
Avoid duplicate image datablocks when loading textures
Fix FLAT+EMISSIVE texture loading crash
avoid full shader rebuilds in intermediate property write
Allow UV mode selection in Loader and add UI warning for SOLID Mode (no Generated or Camera UV)
Load styles after removing surface style in RemoveSurfaceStyle operator so UI List is updated
After that I think we will be in a position to establish the precedence of styles and the strategy around simple vs elaborated styles (in combination with solid vs material_preview/rendered)
Cheers!
Comments
Blender 5.2 here, maybe 2-3 day old. Latest Daily Bonsai is still 250415 (No updates since release of Bonsai official)
Will update Blenders and maybe go to BonsaiPR.
Yes it looks different here.
The first one seems to fit well the https://github.com/IfcOpenShell/IfcOpenShell/pull/7882
So if I got it correct your bug fixing is pretty new and not included in Daily Bonsai is still 250415 ?
Otherwise I have to boot the PC and test there.
@zoomer you are right. The fix is not yet merged in the daily Bonsai.
Once merged that issue should hopefuly be resolved regardless of the plataform.
Cheers!
No ha vuelto a suceder, pero te avisaré si ocurre, o cuando ocurra.
I'm learning Spanish, so thought I'd practice. :)
It hasn't happened again, but I will let you know if or when it does.
I switched to latest PR.
At first Surface Styles seemed to work.
Then I also added Reflection Method (Glass for Glass and Plastic for Frame). Not 100% sure but I think I had some intermediate loss ?
But when I save and close the IFC and reopen it, my Frame lost their red in Viewport. Interestingly the Setting was still there but save "Render" did not bring it back. I needed to save "Shade" to get it back. But reopening the File and its gone again
So for me it works better - but still has quirks.
(If you adit and save multiple Tabs like Render and Shade, add Reflection Methods, edit Diffuse and Surface Colors
And my other big problem ....
In Daily Builds I had Metadata set to ".metadata.blend" and it had worked.
When I switched to BonsaiPR, metadata was off. After reactivating I looked at the name option and set it to "_metadata.blend". (save metadata option in IFC file was still activated)
When saving the IFC I thought I missed the metadata saving in status bar. And yes, in Finder there was the old ".metadata.blend" with old save date - I instead would have expected a second "_metadata.blend".
Thought it needs some file changes beside just view changes, to save. Tried a few times and I saw the status bar confirming - but no "_metadata.blend".
I thought this may be a problem - and deleted the old metadata - but still no "_metadata.blend".
So I went to PR Settings and set filename back to ".metadata.blend". (because it may insist on the same File Name as the IFC !?) - but still no "_metadata.blend".
If I save the IFC and switch to Finder immediately I see that the Temp File for the Metadata appears. But it soon goes away, without the writing the real ".metadata.blend".
Perfecto. ¡Muchas gracias! (usas subjuntivo... eso son palabras mayores ;) buen trabajo.)
Cool. Thanks! I think that in one of the versions the copying of the external shader nodes was not checking if there was already one (second switch). Hopefully it is now ok. I am asking the ok for https://github.com/IfcOpenShell/IfcOpenShell/pull/7882 from @Andrej730 and @Moult
I think that in order to make this as fast as possible both flat/pretty shaders should be loaded in memory but only have active one (I have read that blender will not move the non active chain to the GPU, it will only consume CPU memory). Then have the current bpy.ops.bim.update_current_style for fast switching between them and then add another button (operator) to reload from disk in case one has changed the external files.
Cheers!
BTW
From a Viz point of view I would wish for a Surface Style Interface more similar to Blender's standard Material Interface .... where you have access to all Options at a time (not devided to Shaded/Render/...) as it makes it very complicated and (user)error prone to me. Therefore I would also like to save all edit at a time - or better just automatically/instantly save all edits (as in Blender). Maybe with an Undo option for all edits combined.
Usually my View is in Rendered Mode (as long as it causes no lags) and I edit Surface Style mainly for "Render". But I also edit Shaded color because I need it for Speckle (which unfortunately so far does not display Materials (but keep some Mat data and share/export these) or even supports image textures)
OK, I "saved as" my test file with a new name and thank god I now got my ".metadata.blend". Back !
(Not sure what exactly the problems was ? setting the "_metadata.blend" ending, having had a "similar" metadata already, deleting the former metadata, ..... ?
But my Render Surfaces still go back to default in Viewport when I re-open the File.
The "Render" settings are still there (maybe it changed/mixed the Reflection option ?) but saving "Render" again has no Effect.
But when I then open and save "Shaded" - Now "Shaded" Color appears in my rendered(!) Viewport WTF
and when I then open and save "Render" - all Render Settings are reverted by defaults (!?)
and then I can finally reset them and get them back and see them in rendered Viewport - what's up ?
(at least for that Blender Session ?)
So I still have to think there is some sabotaging dark force somewhere in the Surface Style Editor Code ?
BTW,
When I activate a Reflectance Mode (e.g. Glass) - I realized that a text appears "Supported Reflectance Modes are ..."
Physical (!) (where can I find this it ? Sounds great. Can I control it by Setting an IOR like in "everything has Fresnell"-VRay ? SNCR
Flat and
Notdefined (Obviously by far the most boring of all offered Reflections options)
So it seems I allowed myself to eat from the forbidden fruits of the reflectance tree. My bad.
@zoomer I have not looked to the actual implementation of the modes in "Render" mode. I was more looking to make sure that the infoo is saved and can be later retrieved (it looks that not working in some of your use cases) and also have a precedence order in so if one mode is not available it will use the next one in the precedence order.
Cheers!
Awesome !
Still have not tested if it works on Windows - I am a bit distracted by also playing with Freecad and finally getting a bit used to it and even having some fun.
Uiuiuiui ...
Could it be that this happens because your whole IFC file doubled inside Blender ?
This what happened here.
I realised I have IfcProject/My_Project and IfcProject/My_Project.001 in my Outliner!?
I tried to move Walls and check their connections reliability. When moving the first Wall I got 2 Walls, the moved one and a ghost at the previous position. Similar strange behaviour when updating geometry. But when I selected I saw only half of my selection in Outliner, until I got that Outliner scrolls up and down. So I realized the Project doublet.
Strange, I do not see double Render Nodes as in your screenshot.
But I see that the IFC SurfacesStyle's resemblance, the Blender Materials are doubled.
Yeah, that hasn't happened to me yet. Will keep an eye out though.
I can't replicate (?)
The original yesterday Testfile, which I "saved as" because it would not create the metablend, did not have the doublets. And was again able to save the metadat - far a short time ....
When I tried to delete the Project doublets (this time it was 4 !?) from Outliner it left one doublet. Tried again and it asked for unlocking Spatial. I did, pressed delete and Blender crashed .....
Lots of strange things happen. I think I should go back from Blender Alpha to 5.1.1 official. Maybe for Bonsai too.
also probably worth saying, i don't use the ".metadata.blend" approach, I just use the old .blend/.ifc syncing way. Not sure that makes a difference here.
Will try.
Or maybe it has to do with my Start File or AddOns or ...
I tested all from scratch again in Blender 5.1 and daily build Bonsai. It is all so strange and I think worse than it was in PR.
I got the Materials of the Door in Blenders Shader Panel - but whatever I do, doing Surface Style edits, there is no transfer to Blender Shaders.
And of course while editing Styles I may see my Diffuse Color edits in View - but as soon as I save the Style it gets defaulted again here.
It happened again, but still don't know what caused it.
video: https://community.osarch.org/uploads/editor/wo/b0tbj6bwl04y.mp4
Upon further troubleshooting, this node duplication seems to happen on opening the .ifc file.
try opening this file...
https://hub.openingdesign.com/OpeningDesign/Clover_Lane_Residence/src/commit/4cf75a354bb91173b744893eeeca845acca8aa48/Open/Models/Bonsai/Clover_Lane_Residence.ifc
and then investigate this random object
GlobalId = "0zZoSiMf9AdQdrCJ2RyTUh"This file is pulling external styles from that https://hub.openingdesign.com/OpeningDesign/OD_Submodules repo.
Does this AI debugging summary help?....
The debug output makes the bug crystal clear. Let me trace through it:
Root cause:
_remove_external_branchonly walks connected links backward fromBIM_Output_External, leaving orphan nodes from the external material stranded. Every subsequentupdate_external_branchcall re-pastes all 22 nodes (including new copies of those 5 orphans), which get renamed to.006/.007,.008/.009, etc., growing indefinitely.From the first
_remove_external_branchcall:Image Texture.004,Image Texture.005,RGB to BW.001,Color Ramp.001,Brightness/Contrast.001Next paste adds them again as
Image Texture.006,Image Texture.007,RGB to BW.002, etc. Each subsequent toggle adds 5 more orphan duplicates.The fix is to rewrite
_remove_external_branchto keep only the flat-branch nodes (walk backward fromBIM_Output_Flat) and remove everything else:added a test file too, that i'm able to duplicate the bug with:
https://hub.openingdesign.com/OpeningDesign/Clover_Lane_Residence/src/commit/988b9d514886853e0a1c3132483e3d3fbcc0ae31/Open/Models/Bonsai/testy.ifc
took a stab: https://github.com/falken10vdl/IfcOpenShell/pull/6
wow. Thanks for fixing it!
Fix IfcSurfaceStyleRendering colour reset on save#7882 has already been merged :) Thanks @Moult for reviewing it!
Next step I will issue another PR to establish a precedence of Blender representation based on what styles are available so we try to avoid showing "white" colors if somthing is alrady available. Currently if you have a "Shade" style but no "Render" style, Blender will default to "white" if your Viewport Shading is set to Material_Preview or Rendered. The idea is that in this case it uses principled BSDF from "Shade" so in the end we have as proposed above but using the already used terminology in Bonsai:
"Shading (maybe this one could be renamed Shade/Render or Flat)" (Precedence chain: Render → Shade)
Solid: Flat colour (color_type=MATERIAL)
Material Preview/Rendered: IFC node graph (Render, or Shade colour)
"External (maybe this one could be renamed Texture/External or Pretty)" (Precedence chain: External → Render+Texture → Render → Shade):
Solid: UV texture (color_type=TEXTURE, UVs on demand)
Material Preview/Rendered: External .blend → IFC node graph fallback
Cheers!
In https://github.com/IfcOpenShell/IfcOpenShell/issues/8001 tagehedin has been asking how to fetch external styles (no need to open the external blend file in blender, but rather to select it in the "External" menu of Bonsai Styles. See below a video:
This will add an entry to IFC file so Bonsai know how to retrieve it (so relative path is important if you want to package this to open it in another computer)
#110=IFCSURFACESTYLE('StoneStyle',.BOTH.,(#111));
#111=IFCEXTERNALLYDEFINEDSURFACESTYLE('materials_bk/stone-wall_915e47a5-1a34-42c9-ac57-55106fceff8a/stone-wall_2K_957017a8-f26c-4896-9481-e9d67c23becd.blend','materials/Stone Wall','Stone Wall');
Cheers!
After a short test it seems I can save my Render and Shade Styles now persistently.
For the first time ! Which is big news.
(But so far I avoided Reflection or other further detailed Settings)
BTW,
I see there would be a 20260425 daily Bonsai build.
But my 3 Blenders here do not offer Updates and stick with the 20260421.
Does that mean that the newer had issues and therefore do not appear in remote Updates ?
(Or just a hiccup that should be PR'ed)
As BonsaiPR did update on all Blenders.
(OK not all, does not install on 5.0.1 because of Python version, but shows the Update)
@zoomer I have gone over the code and there are a number of supported/not supported combinations.
I have issued a new PR Surface styles fixes and message warnings#8014 which is solving some bugs and also improve the user experience on what is supported (you get a warning if you select something that will be dropped):
After that I think we will be in a position to establish the precedence of styles and the strategy around simple vs elaborated styles (in combination with solid vs material_preview/rendered)
Cheers!
That sounds great.