Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'system_property_chart.py')
-rw-r--r--system_property_chart.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/system_property_chart.py b/system_property_chart.py
index b1fa54c2..bb6d4682 100644
--- a/system_property_chart.py
+++ b/system_property_chart.py
@@ -219,16 +219,26 @@ def _property_chart_copy(self, context):
data_path = self.data_path
- # quick & nasty method!
+ data_path_with_dot = data_path
+ if not data_path_with_dot.startswith("["):
+ data_path_with_dot = "." + data_path_with_dot
+
+ code = compile(
+ "obj_iter%s = obj%s" % (data_path_with_dot, data_path_with_dot),
+ "<property_chart>",
+ 'exec',
+ )
+
for obj_iter in selected_objects:
if obj != obj_iter:
try:
- exec("obj_iter.%s = obj.%s" % (data_path, data_path))
+ exec(code, {}, {"obj": obj, "obj_iter": obj_iter})
except:
# just in case we need to know what went wrong!
import traceback
traceback.print_exc()
+
from bpy.props import StringProperty
@@ -252,6 +262,7 @@ class CopyPropertyChart(Operator):
# List The Classes #
+
classes = (
AddPresetProperties,
SCENE_MT_properties_presets,
@@ -260,6 +271,7 @@ classes = (
CopyPropertyChart
)
+
def register():
for cls in classes:
bpy.utils.register_class(cls)