Skip to content
Snippets Groups Projects
Commit b2948ae5 authored by Jason van Gumster's avatar Jason van Gumster
Browse files

Attempt to address T67111.

If you have a relative path (e.g. //../objects/object.blend) and you use
bpy.path.abspath, it leaves the relative part (the double dots) as part
of the path (e.g. ~/some_project/scenes/../objects/object.blend). While
Windows is perfectly happy to open files with this kind of path, it
seems to get confused about paths that are relative to that. The fix is
to wrap the bpy.path.abspath function with os.path.abspath and
everything appears to remain sane.

Also introduced a small fix for the new linked node groups feature; in
2.93, the Item tab in the sidebar has been renamed to Node.
parent 7ce14793
No related branches found
No related tags found
No related merge requests found
...@@ -22,8 +22,8 @@ bl_info = { ...@@ -22,8 +22,8 @@ bl_info = {
"author": "Jason van Gumster (Fweeb), Bassam Kurdali, Pablo Vazquez, Rainer Trummer", "author": "Jason van Gumster (Fweeb), Bassam Kurdali, Pablo Vazquez, Rainer Trummer",
"version": (0, 9, 2), "version": (0, 9, 2),
"blender": (2, 80, 0), "blender": (2, 80, 0),
"location": "File > External Data / View3D > Sidebar > Item Tab", "location": "File > External Data / View3D > Sidebar > Item Tab / Node Editor > Sidebar > Node Tab",
"description": "Allows editing of assets linked from a .blend library.", "description": "Allows editing of objects, collections, and node groups linked from a .blend library.",
"doc_url": "{BLENDER_MANUAL_URL}/addons/object/edit_linked_library.html", "doc_url": "{BLENDER_MANUAL_URL}/addons/object/edit_linked_library.html",
"category": "Object", "category": "Object",
} }
...@@ -110,7 +110,8 @@ class OBJECT_OT_EditLinked(bpy.types.Operator): ...@@ -110,7 +110,8 @@ class OBJECT_OT_EditLinked(bpy.types.Operator):
bpy.ops.wm.save_mainfile() bpy.ops.wm.save_mainfile()
settings["original_file"] = bpy.data.filepath settings["original_file"] = bpy.data.filepath
settings["linked_file"] = bpy.path.abspath(targetpath) # Using both bpy and os abspath functions because Windows doesn't like relative routes as part of an absolute path
settings["linked_file"] = os.path.abspath(bpy.path.abspath(targetpath))
if self.use_instance: if self.use_instance:
import subprocess import subprocess
...@@ -169,7 +170,8 @@ class NODE_OT_EditLinked(bpy.types.Operator): ...@@ -169,7 +170,8 @@ class NODE_OT_EditLinked(bpy.types.Operator):
bpy.ops.wm.save_mainfile() bpy.ops.wm.save_mainfile()
settings["original_file"] = bpy.data.filepath settings["original_file"] = bpy.data.filepath
settings["linked_file"] = bpy.path.abspath(targetpath) # Using both bpy and os abspath functions because Windows doesn't like relative routes as part of an absolute path
settings["linked_file"] = os.path.abspath(bpy.path.abspath(targetpath))
if self.use_instance: if self.use_instance:
import subprocess import subprocess
...@@ -311,7 +313,10 @@ class NODE_PT_PanelLinkedEdit(bpy.types.Panel): ...@@ -311,7 +313,10 @@ class NODE_PT_PanelLinkedEdit(bpy.types.Panel):
bl_label = "Edit Linked Library" bl_label = "Edit Linked Library"
bl_space_type = 'NODE_EDITOR' bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI' bl_region_type = 'UI'
bl_category = "Node" if bpy.app.version >= (2, 93, 0):
bl_category = "Node"
else:
bl_category = "Item"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
@classmethod @classmethod
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment