[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1893] trunk/py/scripts/addons/ object_add_chain.py: fix for active layers & align to view errors.

Brendon Murphy meta.androcto1 at gmail.com
Wed May 4 11:36:02 CEST 2011


Revision: 1893
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1893
Author:   meta-androcto
Date:     2011-05-04 09:36:01 +0000 (Wed, 04 May 2011)
Log Message:
-----------
fix for active layers & align to view errors.
thanks to jawra for the updates.

Modified Paths:
--------------
    trunk/py/scripts/addons/object_add_chain.py

Modified: trunk/py/scripts/addons/object_add_chain.py
===================================================================
--- trunk/py/scripts/addons/object_add_chain.py	2011-05-03 14:16:37 UTC (rev 1892)
+++ trunk/py/scripts/addons/object_add_chain.py	2011-05-04 09:36:01 UTC (rev 1893)
@@ -37,12 +37,8 @@
   
 
     ##Adds Empty to scene
-    bpy.ops.object.add(
-        type='EMPTY', view_align=False, enter_editmode=False, location=(0, 0, 0), 
-        rotation=(0, 0, 0),
-        layers=(True, False, False, False, False, False, False, False, False,
-                False, False, False, False, False, False, False, False, False, 
-                False, False))
+    bpy.ops.object.add(type='EMPTY', view_align=False, enter_editmode=False, location=(0, 0, 0), 
+rotation=(0, 0, 0),)
 
     ##Changes name of Empty to rot_link adds variable emp
     emp = bpy.context.object
@@ -52,12 +48,7 @@
     emp.rotation_euler = [1.570796, 0, 0]
 
     ##Adds Curve Path to scene
-    bpy.ops.curve.primitive_nurbs_path_add(
-        view_align=False, enter_editmode=False, location=(0, 0, 0), 
-        rotation=(0, 0, 0), 
-        layers=(True, False, False, False, False, False, False, False, False, 
-        False, False, False, False, False, False, False, False, False, False, 
-        False))
+    bpy.ops.curve.primitive_nurbs_path_add( view_align=False, enter_editmode=False, location=(0, 0, 0), rotation=(0, 0, 0),)
 
     ##Change Curve name to deform adds variable curv
     curv = bpy.context.object
@@ -70,6 +61,10 @@
 
     ##Positions Torus primitive to center of scene
     bpy.context.active_object.location = [0, 0, 0]
+    
+    ##Reseting Torus rotation in case of 'Align to view' option enabled
+    bpy.context.active_object.rotation_euler = [0, 0, 0]
+    
 
     ##Changes Torus name to chain adds variable tor
     tor = bpy.context.object



More information about the Bf-extensions-cvs mailing list