mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 02:37:59 +00:00
Fix #1872. Bug where duplicating an object didn't duplicate its styles.
This commit is contained in:
@@ -20,6 +20,7 @@ import bpy
|
||||
import logging
|
||||
import ifcopenshell
|
||||
import blenderbim.core.tool
|
||||
import blenderbim.core.style
|
||||
import blenderbim.tool as tool
|
||||
import blenderbim.bim.import_ifc
|
||||
from mathutils import Vector
|
||||
@@ -145,6 +146,10 @@ class Geometry(blenderbim.core.tool.Geometry):
|
||||
def get_representation_name(cls, representation):
|
||||
return f"{representation.ContextOfItems.id()}/{representation.id()}"
|
||||
|
||||
@classmethod
|
||||
def get_styles(cls, obj):
|
||||
return [tool.Style.get_style(s.material) for s in obj.material_slots if s.material]
|
||||
|
||||
@classmethod
|
||||
def get_total_representation_items(cls, obj):
|
||||
return max(1, len(obj.material_slots))
|
||||
@@ -246,6 +251,10 @@ class Geometry(blenderbim.core.tool.Geometry):
|
||||
def run_geometry_update_representation(cls, obj=None):
|
||||
bpy.ops.bim.update_representation(obj=obj.name, ifc_representation_class="")
|
||||
|
||||
@classmethod
|
||||
def run_style_add_style(cls, obj=None):
|
||||
return blenderbim.core.style.add_style(tool.Ifc, tool.Style, obj=obj)
|
||||
|
||||
@classmethod
|
||||
def should_force_faceted_brep(cls):
|
||||
return bpy.context.scene.BIMGeometryProperties.should_force_faceted_brep
|
||||
|
||||
Reference in New Issue
Block a user