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:
Andrej730
2025-04-23 15:06:29 +05:00
parent 6913060f0c
commit 68f71c715e
@@ -279,6 +279,8 @@ class CreateDrawing(bpy.types.Operator):
self.get_scale(context)
if self.cprops.update_representation(self.camera):
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.human_scale = self.human_scale