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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
3b1f9d05
Commit
3b1f9d05
authored
Feb 7, 2011
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
use rna values because id-properties cant be edited/added during draw.
parent
f81cbb5f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
system_property_chart.py
+56
-44
56 additions, 44 deletions
system_property_chart.py
with
56 additions
and
44 deletions
system_property_chart.py
+
56
−
44
View file @
3b1f9d05
#
# ##### BEGIN GPL LICENSE BLOCK #####
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
#
# This program is free software; you can redistribute it and/or
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# modify it under the terms of the GNU General Public License
...
@@ -16,7 +14,9 @@
...
@@ -16,7 +14,9 @@
# along with this program; if not, write to the Free Software Foundation,
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#
# ***** END GPL LICENCE BLOCK *****
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
bl_info
=
{
bl_info
=
{
"
name
"
:
"
Object Property Chart
"
,
"
name
"
:
"
Object Property Chart
"
,
...
@@ -37,6 +37,7 @@ bl_info = {
...
@@ -37,6 +37,7 @@ bl_info = {
import
bpy
import
bpy
def
_property_chart_data_get
(
self
,
context
):
def
_property_chart_data_get
(
self
,
context
):
# eg. context.active_object
# eg. context.active_object
obj
=
eval
(
"
context.%s
"
%
self
.
context_data_path_active
)
obj
=
eval
(
"
context.%s
"
%
self
.
context_data_path_active
)
...
@@ -73,10 +74,10 @@ def _property_chart_draw(self, context):
...
@@ -73,10 +74,10 @@ def _property_chart_draw(self, context):
id_storage
=
context
.
scene
id_storage
=
context
.
scene
strings
=
id_storage
.
get
(
self
.
_PROP_STORAGE_ID
)
strings
=
getattr
(
id_storage
,
self
.
_PROP_STORAGE_ID
)
if
strings
is
None
:
# Collected all props, now display them all
strings
=
id_storage
[
self
.
_PROP_STORAGE_ID
]
=
"
data data.name
"
layout
=
self
.
layout
if
strings
:
if
strings
:
...
@@ -107,10 +108,6 @@ def _property_chart_draw(self, context):
...
@@ -107,10 +108,6 @@ def _property_chart_draw(self, context):
if
prop_found
:
if
prop_found
:
prop_all
.
append
((
obj
,
prop_pairs
))
prop_all
.
append
((
obj
,
prop_pairs
))
# Collected all props, now display them all
layout
=
self
.
layout
row
=
layout
.
row
(
align
=
True
)
row
=
layout
.
row
(
align
=
True
)
col
=
row
.
column
()
col
=
row
.
column
()
...
@@ -139,7 +136,7 @@ def _property_chart_draw(self, context):
...
@@ -139,7 +136,7 @@ def _property_chart_draw(self, context):
# edit the display props
# edit the display props
col
=
layout
.
column
()
col
=
layout
.
column
()
col
.
label
(
text
=
"
Object Properties
"
)
col
.
label
(
text
=
"
Object Properties
"
)
col
.
prop
(
id_storage
,
'
[
"
%s
"
]
'
%
self
.
_PROP_STORAGE_ID
,
text
=
""
)
col
.
prop
(
id_storage
,
self
.
_PROP_STORAGE_ID
,
text
=
""
)
class
View3DEditProps
(
bpy
.
types
.
Panel
):
class
View3DEditProps
(
bpy
.
types
.
Panel
):
...
@@ -150,6 +147,7 @@ class View3DEditProps(bpy.types.Panel):
...
@@ -150,6 +147,7 @@ class View3DEditProps(bpy.types.Panel):
bl_context
=
"
objectmode
"
bl_context
=
"
objectmode
"
_PROP_STORAGE_ID
=
"
view3d_edit_props
"
_PROP_STORAGE_ID
=
"
view3d_edit_props
"
_PROP_STORAGE_DEFAULT
=
"
data data.name
"
# _property_chart_draw needs these
# _property_chart_draw needs these
context_data_path_active
=
"
active_object
"
context_data_path_active
=
"
active_object
"
...
@@ -165,6 +163,7 @@ class SequencerEditProps(bpy.types.Panel):
...
@@ -165,6 +163,7 @@ class SequencerEditProps(bpy.types.Panel):
bl_label
=
"
Property Chart
"
bl_label
=
"
Property Chart
"
_PROP_STORAGE_ID
=
"
sequencer_edit_props
"
_PROP_STORAGE_ID
=
"
sequencer_edit_props
"
_PROP_STORAGE_DEFAULT
=
"
blend_type blend_alpha
"
# _property_chart_draw needs these
# _property_chart_draw needs these
context_data_path_active
=
"
scene.sequence_editor.active_strip
"
context_data_path_active
=
"
scene.sequence_editor.active_strip
"
...
@@ -220,11 +219,24 @@ class CopyPropertyChart(bpy.types.Operator):
...
@@ -220,11 +219,24 @@ class CopyPropertyChart(bpy.types.Operator):
def
register
():
def
register
():
pass
Scene
=
bpy
.
types
.
Scene
for
cls
in
View3DEditProps
,
SequencerEditProps
:
setattr
(
Scene
,
cls
.
_PROP_STORAGE_ID
,
StringProperty
(
name
=
"
Scene Name
"
,
description
=
"
Name of POV-Ray scene to create. Empty name will use the name of the blend file.
"
,
default
=
cls
.
_PROP_STORAGE_DEFAULT
,
maxlen
=
1024
),
)
def
unregister
():
def
unregister
():
pass
for
cls
in
View3DEditProps
,
SequencerEditProps
:
delattr
(
Scene
,
cls
.
_PROP_STORAGE_ID
,
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
register
()
register
()
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
sign in
to comment