Styles UI - moved UI from shader graph N-panel to Styles UI #3912

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
This commit is contained in:
Andrej730
2023-12-07 15:25:20 +05:00
parent d0c68d3f5b
commit fa31e10a77
9 changed files with 425 additions and 453 deletions
@@ -73,7 +73,7 @@ Scenario: Disable editing styles
And I add a material
And I press "bim.add_style"
And I press "bim.load_styles(style_type='IfcSurfaceStyle')"
When I press "bim.disable_editing_style"
When I press "bim.disable_editing_styles"
Then nothing happens
Scenario: Select by style
+7 -6
View File
@@ -48,11 +48,11 @@ class TestCreatingStyles(NewFile):
style_data = {
"ReflectanceMethod": "NOTDEFINED",
"DiffuseColour": ("IfcColourRgb", (0.5, 0.5, 0.5, 1.0)),
"SurfaceColour": (0.3, 0.3, 0.3, 1.0),
"DiffuseColour": ("IfcColourRgb", (0.5, 0.5, 0.5)),
"SurfaceColour": (0.3, 0.3, 0.3),
"Transparency": 0.3,
"SpecularHighlight": 0.4,
"SpecularColour": 0.03,
"SpecularColour": ("IfcNormalisedRatioMeasure", 0.03),
}
texture_data = [
{
@@ -71,12 +71,13 @@ class TestCreatingStyles(NewFile):
bsdf = tool.Blender.get_material_node(material, "BSDF_PRINCIPLED")
alpha = 1 - style_data["Transparency"]
diffuse_color = style_data["SurfaceColour"][:3] + (alpha,)
diffuse_color = style_data["SurfaceColour"] + (alpha,)
assert np.allclose(material.diffuse_color[:], diffuse_color)
assert np.allclose(bsdf.inputs["Base Color"].default_value[:], style_data["DiffuseColour"][1])
base_color = style_data["DiffuseColour"][1] + (1.0,)
assert np.allclose(bsdf.inputs["Base Color"].default_value[:], base_color)
assert np.isclose(bsdf.inputs["Alpha"].default_value, alpha)
assert np.isclose(bsdf.inputs["Roughness"].default_value, style_data["SpecularHighlight"])
assert np.isclose(bsdf.inputs["Metallic"].default_value, style_data["SpecularColour"])
assert np.isclose(bsdf.inputs["Metallic"].default_value, style_data["SpecularColour"][1])
image_node = tool.Blender.get_material_node(material, "TEX_IMAGE")
assert image_node.outputs["Color"].links[0].to_socket.name == "Base Color"