[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31402] trunk/blender: - rna_info. py now outputs array length with types eg.

Campbell Barton ideasman42 at gmail.com
Tue Aug 17 04:42:33 CEST 2010


Revision: 31402
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31402
Author:   campbellbarton
Date:     2010-08-17 04:42:30 +0200 (Tue, 17 Aug 2010)

Log Message:
-----------
- rna_info.py now outputs array length with types eg. float[16].
- corrected rna property name Controller.states -> state (pointed out by Dalai).
- rna_cleaner_merge script now only merges comment and new name.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/rna_info.py
    trunk/blender/source/blender/makesrna/rna_cleanup/rna_cleaner.py
    trunk/blender/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py
    trunk/blender/source/blender/makesrna/rna_cleanup/rna_properties.txt

Modified: trunk/blender/release/scripts/modules/rna_info.py
===================================================================
--- trunk/blender/release/scripts/modules/rna_info.py	2010-08-17 01:50:47 UTC (rev 31401)
+++ trunk/blender/release/scripts/modules/rna_info.py	2010-08-17 02:42:30 UTC (rev 31402)
@@ -636,7 +636,11 @@
         for prop_id, prop in sorted(props):
             # if prop.type == 'boolean':
             #     continue
-            data.append("%s.%s -> %s:    %s%s    %s" % (struct_id_str, prop.identifier, prop.identifier, prop.type, ", (read-only)" if prop.is_readonly else "", prop.description))
+            prop_type = prop.type
+            if prop.array_length > 0:
+                prop_type += "[%d]" % prop.array_length
+
+            data.append("%s.%s -> %s:    %s%s    %s" % (struct_id_str, prop.identifier, prop.identifier, prop_type, ", (read-only)" if prop.is_readonly else "", prop.description))
         data.sort()
 
     if bpy.app.background:

Modified: trunk/blender/source/blender/makesrna/rna_cleanup/rna_cleaner.py
===================================================================
--- trunk/blender/source/blender/makesrna/rna_cleanup/rna_cleaner.py	2010-08-17 01:50:47 UTC (rev 31401)
+++ trunk/blender/source/blender/makesrna/rna_cleanup/rna_cleaner.py	2010-08-17 02:42:30 UTC (rev 31402)
@@ -253,6 +253,13 @@
     props_list = [['NOTE', 'CHANGED', 'CLASS', 'FROM', 'TO', 'KEYWORD-CHECK', 'TYPE', 'DESCRIPTION']] + props_list
     for props in props_list:
         #txt
+        
+        # FOR PY OUTPUT!
+        '''
+        if props[3] == props[4]: txt += "#"
+        else: txt += " "
+        '''
+    
         if props[0] != '': txt +=  '%s * ' % props[0]   # comment
         txt +=  '%s.%s -> %s:   %s  "%s"\n' % tuple(props[2:5] + props[6:])   # skipping keyword-check
         # rna_api

Modified: trunk/blender/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py
===================================================================
--- trunk/blender/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py	2010-08-17 01:50:47 UTC (rev 31401)
+++ trunk/blender/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py	2010-08-17 02:42:30 UTC (rev 31402)
@@ -27,17 +27,16 @@
 	
 	for key, val_orig in mod_to_dict.items():
 		try:
-			val = mod_from_dict.pop(key)
+			val_new = mod_from_dict.pop(key)
 		except:
 			# print("not found", key)
-			val = val_orig
+			val_new = val_orig
 			
 		# always take the class from the base
-		val = list(val)
-		val[2] = val_orig[2]
-		print(val_orig[2])
+		val = list(val_orig)
+		val[0] = val_new[0] # comment
+		val[4] = val_new[4] # -> to
 		val = tuple(val)
-
 		rna_api_new.append(val)
 	
 	def write_work_file(file_path, rna_api):

Modified: trunk/blender/source/blender/makesrna/rna_cleanup/rna_properties.txt
===================================================================
--- trunk/blender/source/blender/makesrna/rna_cleanup/rna_properties.txt	2010-08-17 01:50:47 UTC (rev 31401)
+++ trunk/blender/source/blender/makesrna/rna_cleanup/rna_properties.txt	2010-08-17 02:42:30 UTC (rev 31402)
@@ -45,7 +45,7 @@
 + * Actuator|ConstraintActuator.mode -> mode:   enum  "The type of the constraint"
 + * Actuator|ConstraintActuator.property -> property:   string  "Ray detect only Objects with this property"
 + * Actuator|ConstraintActuator.range -> range:   float  "Set the maximum length of ray"
-+ * Actuator|ConstraintActuator.max_rotation -> rotation_max:   float  "Reference Direction"
++ * Actuator|ConstraintActuator.max_rotation -> rotation_max:   float[3]  "Reference Direction"
 + * Actuator|ConstraintActuator.spring -> spring:   float  "Spring force within the Fh area"
 + * Actuator|ConstraintActuator.time -> time:   int  "Maximum activation time in frame, 0 for unlimited"
 + * Actuator|ConstraintActuator.fh_normal -> use_fh_normal:   boolean  "Add a horizontal spring force on slopes"
@@ -55,9 +55,9 @@
 + * Actuator|ConstraintActuator.detect_material -> use_material_detect:   boolean  "Detect material instead of property"
 + * Actuator|ConstraintActuator.normal -> use_normal:   boolean  "Set object axis along (local axis) or parallel (global axis) to the normal at hit position"
 + * Actuator|ConstraintActuator.persistent -> use_persistent:   boolean  "Persistent actuator: stays active even if ray does not reach target"
-+ * Actuator|EditObjectActuator.angular_velocity -> angular_velocity:   float  "Angular velocity upon creation"
++ * Actuator|EditObjectActuator.angular_velocity -> angular_velocity:   float[3]  "Angular velocity upon creation"
 + * Actuator|EditObjectActuator.dynamic_operation -> dynamic_operation:   enum  "NO DESCRIPTION"
-+ * Actuator|EditObjectActuator.linear_velocity -> linear_velocity:   float  "Velocity upon creation"
++ * Actuator|EditObjectActuator.linear_velocity -> linear_velocity:   float[3]  "Velocity upon creation"
 + * Actuator|EditObjectActuator.mass -> mass:   float  "The mass of the object"
 + * Actuator|EditObjectActuator.mesh -> mesh:   pointer  "Replace the existing, when left blank Phys will remake the existing physics mesh"
 + * Actuator|EditObjectActuator.mode -> mode:   enum  "The mode of the actuator"
@@ -90,10 +90,10 @@
 + * Actuator|MessageActuator.body_type -> body_type:   enum  "Toggle message type: either Text or a PropertyName"
 + * Actuator|MessageActuator.subject -> subject:   string  "Optional message subject. This is what can be filtered on"
 + * Actuator|MessageActuator.to_property -> to_property:   string  "Optional send message to objects with this name only, or empty to broadcast"
-+ * Actuator|ObjectActuator.angular_velocity -> angular_velocity:   float  "Sets the angular velocity"
++ * Actuator|ObjectActuator.angular_velocity -> angular_velocity:   float[3]  "Sets the angular velocity"
 + * Actuator|ObjectActuator.damping -> damping:   int  "Number of frames to reach the target velocity"
 + * Actuator|ObjectActuator.derivate_coefficient -> derivate_coefficient:   float  "Not required, high values can cause instability"
-+ * Actuator|ObjectActuator.force -> force:   float  "Sets the force"
++ * Actuator|ObjectActuator.force -> force:   float[3]  "Sets the force"
 + * Actuator|ObjectActuator.force_max_x -> force_max_x:   float  "Set the upper limit for force"
 + * Actuator|ObjectActuator.force_max_y -> force_max_y:   float  "Set the upper limit for force"
 + * Actuator|ObjectActuator.force_max_z -> force_max_z:   float  "Set the upper limit for force"
@@ -101,13 +101,13 @@
 + * Actuator|ObjectActuator.force_min_y -> force_min_y:   float  "Set the lower limit for force"
 + * Actuator|ObjectActuator.force_min_z -> force_min_z:   float  "Set the lower limit for force"
 + * Actuator|ObjectActuator.integral_coefficient -> integral_coefficient:   float  "Low value (0.01) for slow response, high value (0.5) for fast response"
-+ * Actuator|ObjectActuator.linear_velocity -> linear_velocity:   float  "Sets the linear velocity (in Servo mode it sets the target relative linear velocity, it will be achieved by automatic application of force. Null velocity is a valid target)"
++ * Actuator|ObjectActuator.linear_velocity -> linear_velocity:   float[3]  "Sets the linear velocity (in Servo mode it sets the target relative linear velocity, it will be achieved by automatic application of force. Null velocity is a valid target)"
 + * Actuator|ObjectActuator.mode -> mode:   enum  "Specify the motion system"
-+ * Actuator|ObjectActuator.loc -> offset_location:   float  "Sets the location"
-+ * Actuator|ObjectActuator.rot -> offset_rotation:   float  "Sets the rotation"
++ * Actuator|ObjectActuator.loc -> offset_location:   float[3]  "Sets the location"
++ * Actuator|ObjectActuator.rot -> offset_rotation:   float[3]  "Sets the rotation"
 + * Actuator|ObjectActuator.proportional_coefficient -> proportional_coefficient:   float  "Typical value is 60x integral coefficient"
 + * Actuator|ObjectActuator.reference_object -> reference_object:   pointer  "Reference object for velocity calculation, leave empty for world reference"
-+ * Actuator|ObjectActuator.torque -> torque:   float  "Sets the torque"
++ * Actuator|ObjectActuator.torque -> torque:   float[3]  "Sets the torque"
 + * Actuator|ObjectActuator.add_linear_velocity -> use_add_linear_velocity:   boolean  "Toggles between ADD and SET linV"
 + * Actuator|ObjectActuator.local_angular_velocity -> use_local_angular_velocity:   boolean  "Angular velocity is defined in local coordinates"
 + * Actuator|ObjectActuator.local_force -> use_local_force:   boolean  "Force is defined in local coordinates"
@@ -168,7 +168,7 @@
 + * Actuator|SoundActuator.enable_sound_3d -> use_sound_3d:   boolean  "Enable/Disable 3D Sound"
 + * Actuator|SoundActuator.volume -> volume:   float  "Sets the initial volume of the sound"
 + * Actuator|StateActuator.operation -> operation:   enum  "Select the bit operation on object state mask"
-+ * Actuator|StateActuator.state -> states:   boolean  "NO DESCRIPTION"
++ * Actuator|StateActuator.state -> states:   boolean[30]  "NO DESCRIPTION"
 + * Actuator|VisibilityActuator.children -> apply_to_children:   boolean  "Set all the children of this object to the same visibility/occlusion recursively"
 + * Actuator|VisibilityActuator.occlusion -> use_occlusion:   boolean  "Set the object to occlude objects behind it. Initialized from the object type in physics button"
 + * Actuator|VisibilityActuator.visible -> use_visible:   boolean  "Set the objects visible. Initialized from the objects render restriction toggle (access in the outliner)"
@@ -215,10 +215,10 @@
 + * BackgroundImage.size -> size:   float  "Scaling factor for the background image"
 + * BackgroundImage.transparency -> transparency:   float  "Amount to blend the image against the background color"
 + * BackgroundImage.view_axis -> view_axis:   enum  "The axis to display the image on"
-+ * BezierSplinePoint.co -> co:   float  "Coordinates of the control point"
-+ * BezierSplinePoint.handle1 -> handle_left:   float  "Coordinates of the first handle"
++ * BezierSplinePoint.co -> co:   float[3]  "Coordinates of the control point"
++ * BezierSplinePoint.handle1 -> handle_left:   float[3]  "Coordinates of the first handle"
 + * BezierSplinePoint.handle1_type -> handle_left_type:   enum  "Handle types"

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list