mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 19:30:25 +00:00
FixRevitTINs patch now also flips normals for surface TINs instead of solid TINs.
Minor fixes to use view_layer.object.active etc instead of context.active_object when running via Blender UI (it seems when you run the patch recipe from the Blender UI at least in later versions, context does not have an "active_object" property.
This commit is contained in:
@@ -275,7 +275,7 @@ class UpdateRepresentation(bpy.types.Operator, Operator):
|
||||
ifc_representation_class: bpy.props.StringProperty()
|
||||
|
||||
def _execute(self, context):
|
||||
if context.active_object and context.active_object.mode != "OBJECT":
|
||||
if context.view_layer.objects.active and context.view_layer.objects.active.mode != "OBJECT":
|
||||
# Ensure mode is object to prevent invalid mesh data causing CTD
|
||||
bpy.ops.object.mode_set(mode="OBJECT", toggle=False)
|
||||
|
||||
|
||||
@@ -87,6 +87,9 @@ class ExecuteIfcPatch(bpy.types.Operator):
|
||||
input_file = props.ifc_patch_input
|
||||
file = ifcopenshell.open(props.ifc_patch_input)
|
||||
|
||||
# Store this in case the patch recipe resets the Blender session, such as by loading a new project.
|
||||
ifc_patch_output = props.ifc_patch_output
|
||||
|
||||
output = ifcpatch.execute(
|
||||
{
|
||||
"input": input_file,
|
||||
@@ -96,7 +99,7 @@ class ExecuteIfcPatch(bpy.types.Operator):
|
||||
"log": os.path.join(context.scene.BIMProperties.data_dir, "process.log"),
|
||||
}
|
||||
)
|
||||
ifcpatch.write(output, props.ifc_patch_output)
|
||||
ifcpatch.write(output, ifc_patch_output)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user