mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
disable rel paths for adding ref images and textures with unsaved .ifc
This commit is contained in:
@@ -2591,6 +2591,17 @@ class AddReferenceImage(bpy.types.Operator, Operator):
|
|||||||
options={"SKIP_SAVE"},
|
options={"SKIP_SAVE"},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
if Path(tool.Ifc.get_path()).is_file():
|
||||||
|
layout.prop(self, "use_relative_path")
|
||||||
|
else:
|
||||||
|
self.use_relative_path = False
|
||||||
|
layout.label(text="Save the .ifc file first ")
|
||||||
|
layout.label(text="to use relative paths.")
|
||||||
|
layout.prop(self, "override_existing_image")
|
||||||
|
layout.prop(self, "use_existing_object_by_name")
|
||||||
|
|
||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
context.window_manager.fileselect_add(self)
|
context.window_manager.fileselect_add(self)
|
||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|||||||
@@ -428,6 +428,15 @@ class ChooseTextureMapPath(bpy.types.Operator):
|
|||||||
filter_image: bpy.props.BoolProperty(default=True, options={"HIDDEN", "SKIP_SAVE"})
|
filter_image: bpy.props.BoolProperty(default=True, options={"HIDDEN", "SKIP_SAVE"})
|
||||||
filter_folder: bpy.props.BoolProperty(default=True, options={"HIDDEN", "SKIP_SAVE"})
|
filter_folder: bpy.props.BoolProperty(default=True, options={"HIDDEN", "SKIP_SAVE"})
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
if Path(tool.Ifc.get_path()).is_file():
|
||||||
|
layout.prop(self, "use_relative_path")
|
||||||
|
else:
|
||||||
|
self.use_relative_path = False
|
||||||
|
layout.label(text="Save the .ifc file first ")
|
||||||
|
layout.label(text="to use relative paths.")
|
||||||
|
|
||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
context.window_manager.fileselect_add(self)
|
context.window_manager.fileselect_add(self)
|
||||||
return {"RUNNING_MODAL"}
|
return {"RUNNING_MODAL"}
|
||||||
|
|||||||
Reference in New Issue
Block a user