Skip to content

Commit

Permalink
Styles UI - moved UI from shader graph N-panel to Styles UI #3912
Browse files Browse the repository at this point in the history
Moved all shading style and textures parameters from shader-graph N-panel to general Styles UI. Shader graph now also update in real time on any prop changes in Styles UI.

Now there is practically no need to switch to shader graph to edit styles shaders - all parameters are available from the Styles UI. That also allows you to edit styles and see the results in viewport even if the edited style is not the one that's currently active.

small demo - https://imgur.com/a/i2suoZw
  • Loading branch information
Andrej730 committed Dec 7, 2023
1 parent b21159c commit 89f9cd0
Show file tree
Hide file tree
Showing 9 changed files with 424 additions and 452 deletions.
5 changes: 3 additions & 2 deletions src/blenderbim/blenderbim/bim/module/style/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
operator.ActivateExternalStyle,
operator.AddPresentationStyle,
operator.AddStyle,
operator.AddSurfaceTexture,
operator.BrowseExternalStyle,
operator.ClearTextureMapPath,
operator.RemoveTextureMap,
operator.ChooseTextureMapPath,
operator.DisableAddingPresentationStyle,
operator.DisableEditingExternalStyle,
Expand All @@ -46,14 +47,14 @@
operator.UpdateStyleColours,
operator.UpdateStyleTextures,
prop.Style,
prop.Texture,
prop.BIMStylesProperties,
prop.BIMStyleProperties,
ui.BIM_PT_styles,
ui.BIM_PT_style,
ui.BIM_PT_style_attributes,
ui.BIM_PT_external_style_attributes,
ui.BIM_UL_styles,
ui.BIM_PT_STYLE_GRAPH,
)


Expand Down
11 changes: 11 additions & 0 deletions src/blenderbim/blenderbim/bim/module/style/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,23 @@ class StylesData:
@classmethod
def load(cls):
cls.data = {
"styles_to_blender_material_names": cls.styles_to_blender_material_names(),
"style_types": cls.style_types(),
"total_styles": cls.total_styles(),
"reflectance_methods": cls.reflectance_methods(),
}
cls.is_loaded = True

@classmethod
def styles_to_blender_material_names(cls):
ifc_file = tool.Ifc.get()
props = bpy.context.scene.BIMStylesProperties
materials = []
for style in props.styles:
material = tool.Ifc.get_object(ifc_file.by_id(style.ifc_definition_id))
materials.append(material.name if material is not None else None)
return materials

@classmethod
def reflectance_methods(cls):
declaration = tool.Ifc.schema().declaration_by_name("IfcReflectanceMethodEnum")
Expand Down

0 comments on commit 89f9cd0

Please sign in to comment.