Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
01ed2d2f
Commit
01ed2d2f
authored
11 years ago
by
Jason van Gumster
Browse files
Options
Downloads
Patches
Plain Diff
Added support for proxy objects, thanks to a patch from michax (with edits from me). Thanks!
parent
d57fa9e1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
object_edit_linked.py
+20
-9
20 additions, 9 deletions
object_edit_linked.py
with
20 additions
and
9 deletions
object_edit_linked.py
+
20
−
9
View file @
01ed2d2f
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
bl_info
=
{
bl_info
=
{
"
name
"
:
"
Edit Linked Library
"
,
"
name
"
:
"
Edit Linked Library
"
,
"
author
"
:
"
Jason van Gumster (Fweeb), Bassam Kurdali, Pablo Vazquez
"
,
"
author
"
:
"
Jason van Gumster (Fweeb), Bassam Kurdali, Pablo Vazquez
"
,
"
version
"
:
(
0
,
7
,
4
),
"
version
"
:
(
0
,
8
,
0
),
"
blender
"
:
(
2
,
65
,
0
),
"
blender
"
:
(
2
,
65
,
0
),
"
location
"
:
"
View3D > Toolshelf > Edit Linked Library
"
,
"
location
"
:
"
View3D > Toolshelf > Edit Linked Library
"
,
"
description
"
:
"
Allows editing of objects linked from a .blend library.
"
,
"
description
"
:
"
Allows editing of objects linked from a .blend library.
"
,
...
@@ -77,6 +77,8 @@ class EditLinked(bpy.types.Operator):
...
@@ -77,6 +77,8 @@ class EditLinked(bpy.types.Operator):
return
settings
[
"
original_file
"
]
==
""
and
context
.
active_object
is
not
None
and
(
return
settings
[
"
original_file
"
]
==
""
and
context
.
active_object
is
not
None
and
(
(
context
.
active_object
.
dupli_group
and
(
context
.
active_object
.
dupli_group
and
context
.
active_object
.
dupli_group
.
library
is
not
None
)
or
context
.
active_object
.
dupli_group
.
library
is
not
None
)
or
(
context
.
active_object
.
proxy
and
context
.
active_object
.
proxy
.
library
is
not
None
)
or
context
.
active_object
.
library
is
not
None
)
context
.
active_object
.
library
is
not
None
)
#return context.active_object is not None
#return context.active_object is not None
...
@@ -90,6 +92,10 @@ class EditLinked(bpy.types.Operator):
...
@@ -90,6 +92,10 @@ class EditLinked(bpy.types.Operator):
elif
target
.
library
:
elif
target
.
library
:
targetpath
=
target
.
library
.
filepath
targetpath
=
target
.
library
.
filepath
settings
[
"
linked_objects
"
].
append
(
target
.
name
)
settings
[
"
linked_objects
"
].
append
(
target
.
name
)
elif
target
.
proxy
:
target
=
target
.
proxy
targetpath
=
target
.
library
.
filepath
settings
[
"
linked_objects
"
].
append
(
target
.
name
)
if
targetpath
:
if
targetpath
:
print
(
target
.
name
+
"
is linked to
"
+
targetpath
)
print
(
target
.
name
+
"
is linked to
"
+
targetpath
)
...
@@ -98,8 +104,6 @@ class EditLinked(bpy.types.Operator):
...
@@ -98,8 +104,6 @@ class 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
# XXX: need to test for proxied rigs
settings
[
"
linked_file
"
]
=
bpy
.
path
.
abspath
(
targetpath
)
settings
[
"
linked_file
"
]
=
bpy
.
path
.
abspath
(
targetpath
)
if
self
.
use_instance
:
if
self
.
use_instance
:
...
@@ -164,14 +168,21 @@ class PanelLinkedEdit(bpy.types.Panel):
...
@@ -164,14 +168,21 @@ class PanelLinkedEdit(bpy.types.Panel):
scene
=
context
.
scene
scene
=
context
.
scene
icon
=
"
OUTLINER_DATA_
"
+
context
.
active_object
.
type
icon
=
"
OUTLINER_DATA_
"
+
context
.
active_object
.
type
target
=
None
if
context
.
active_object
.
proxy
:
target
=
context
.
active_object
.
proxy
else
:
target
=
context
.
active_object
.
dupli_group
if
settings
[
"
original_file
"
]
==
""
and
(
if
settings
[
"
original_file
"
]
==
""
and
(
(
context
.
active_object
.
dupli_group
and
(
target
and
context
.
active_object
.
dupli_group
.
library
is
not
None
)
or
target
.
library
is
not
None
)
or
context
.
active_object
.
library
is
not
None
):
context
.
active_object
.
library
is
not
None
):
if
(
context
.
active_object
.
dupli_group
is
not
None
):
if
(
target
is
not
None
):
props
=
layout
.
operator
(
"
object.edit_linked
"
,
icon
=
"
LINK_BLEND
"
,
props
=
layout
.
operator
(
"
object.edit_linked
"
,
icon
=
"
LINK_BLEND
"
,
text
=
"
Edit Library: %s
"
%
context
.
active_object
.
dupli_group
.
name
)
text
=
"
Edit Library: %s
"
%
target
.
name
)
else
:
else
:
props
=
layout
.
operator
(
"
object.edit_linked
"
,
icon
=
"
LINK_BLEND
"
,
props
=
layout
.
operator
(
"
object.edit_linked
"
,
icon
=
"
LINK_BLEND
"
,
text
=
"
Edit Library: %s
"
%
context
.
active_object
.
name
)
text
=
"
Edit Library: %s
"
%
context
.
active_object
.
name
)
...
@@ -181,9 +192,9 @@ class PanelLinkedEdit(bpy.types.Panel):
...
@@ -181,9 +192,9 @@ class PanelLinkedEdit(bpy.types.Panel):
layout
.
prop
(
scene
,
"
use_autosave
"
)
layout
.
prop
(
scene
,
"
use_autosave
"
)
layout
.
prop
(
scene
,
"
use_instance
"
)
layout
.
prop
(
scene
,
"
use_instance
"
)
if
(
context
.
active_object
.
dupli_group
is
not
None
):
if
(
target
is
not
None
):
layout
.
label
(
text
=
"
Path: %s
"
%
layout
.
label
(
text
=
"
Path: %s
"
%
context
.
active_object
.
dupli_group
.
library
.
filepath
)
target
.
library
.
filepath
)
else
:
else
:
layout
.
label
(
text
=
"
Path: %s
"
%
layout
.
label
(
text
=
"
Path: %s
"
%
context
.
active_object
.
library
.
filepath
)
context
.
active_object
.
library
.
filepath
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment