Convert relative path to absolute on selection (fix relative path with .blend file loaded)
This commit is contained in:
parent
3fc8da77d2
commit
2965688087
@ -24,6 +24,9 @@ def on_path_update(self, context):
|
|||||||
if not self.name and self.path:
|
if not self.name and self.path:
|
||||||
self.name = name_from_path(self.path)
|
self.name = name_from_path(self.path)
|
||||||
context.preferences.is_dirty = True
|
context.preferences.is_dirty = True
|
||||||
|
if self.path and self.path.startswith('//'):
|
||||||
|
self.path = bpy.path.abspath(self.path)
|
||||||
|
context.preferences.is_dirty = True
|
||||||
|
|
||||||
class TemplateItem(PropertyGroup):
|
class TemplateItem(PropertyGroup):
|
||||||
name: StringProperty(
|
name: StringProperty(
|
||||||
@ -47,7 +50,7 @@ class CustomTemplatesPreferences(AddonPreferences):
|
|||||||
text=f"Your custom templates ({len(self.projects)})")
|
text=f"Your custom templates ({len(self.projects)})")
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_list("UI_UL_list", "custom_templates",
|
row.template_list("UI_UL_list", "custom_templates",
|
||||||
self, "projects", self, "active_template_index")
|
self, "projects", self, "active_template_index", rows=6, maxrows=6)
|
||||||
|
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.menu("CT_MT_templates_menu", icon='DOWNARROW_HLT', text="")
|
col.menu("CT_MT_templates_menu", icon='DOWNARROW_HLT', text="")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user