mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 14:38:05 +00:00
Fix invalid cprops after camera data is recreated
Mentioned in #5676, discoverd after 476604202a.
`bim.update_representation` removes previous `camera.data` and adds a new one making cprops invalid possibly leading to either invalid prop values or crashes (https://projects.blender.org/blender/blender/issues/137889).
This commit is contained in:
@@ -279,6 +279,8 @@ class CreateDrawing(bpy.types.Operator):
|
|||||||
self.get_scale(context)
|
self.get_scale(context)
|
||||||
if self.cprops.update_representation(self.camera):
|
if self.cprops.update_representation(self.camera):
|
||||||
bpy.ops.bim.update_representation(obj=self.camera.name, ifc_representation_class="")
|
bpy.ops.bim.update_representation(obj=self.camera.name, ifc_representation_class="")
|
||||||
|
# Reassign props as data is recreated during the update.
|
||||||
|
self.cprops = tool.Drawing.get_camera_props(self.camera)
|
||||||
|
|
||||||
self.svg_writer = svgwriter.SvgWriter()
|
self.svg_writer = svgwriter.SvgWriter()
|
||||||
self.svg_writer.human_scale = self.human_scale
|
self.svg_writer.human_scale = self.human_scale
|
||||||
|
|||||||
Reference in New Issue
Block a user