[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42812] trunk/blender/source/blender: split some >120 lines, no functional changes

Campbell Barton ideasman42 at gmail.com
Wed Dec 21 23:56:14 CET 2011


Revision: 42812
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42812
Author:   campbellbarton
Date:     2011-12-21 22:56:06 +0000 (Wed, 21 Dec 2011)
Log Message:
-----------
split some >120 lines, no functional changes

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/unit.c
    trunk/blender/source/blender/editors/transform/transform_conversions.c
    trunk/blender/source/blender/makesrna/intern/rna_access.c
    trunk/blender/source/blender/python/intern/gpu.c

Modified: trunk/blender/source/blender/blenkernel/intern/unit.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/unit.c	2011-12-21 22:23:39 UTC (rev 42811)
+++ trunk/blender/source/blender/blenkernel/intern/unit.c	2011-12-21 22:56:06 UTC (rev 42812)
@@ -299,7 +299,8 @@
 		if(suppress && (unit->flag & B_UNIT_DEF_SUPPRESS))
 			continue;
 
-		if (value_abs >= unit->scalar*(1.0-EPS)) /* scale down scalar so 1cm doesnt convert to 10mm because of float error */
+		/* scale down scalar so 1cm doesnt convert to 10mm because of float error */
+		if (value_abs >= unit->scalar*(1.0-EPS))
 			return unit;
 	}
 
@@ -481,11 +482,14 @@
 	}
 }
 
-static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, const char *replace_str)
+static int unit_scale_str(char *str, int len_max, char *str_tmp,
+                          double scale_pref, bUnitDef *unit, const char *replace_str)
 {
 	char *str_found;
 
-	if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) { /* XXX - investigate, does not respect len_max properly  */
+	if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) {
+		/* XXX - investigate, does not respect len_max properly  */
+
 		int len, len_num, len_name, len_move, found_ofs;
 
 		found_ofs = (int)(str_found-str);

Modified: trunk/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_conversions.c	2011-12-21 22:23:39 UTC (rev 42811)
+++ trunk/blender/source/blender/editors/transform/transform_conversions.c	2011-12-21 22:56:06 UTC (rev 42812)
@@ -1548,8 +1548,10 @@
 
 			/* TODO - in the case of tilt and radius we can also avoid allocating the initTransDataCurveHandles
 			 * but for now just dont change handle types */
-			if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TILT) == 0)
-				testhandlesNurb(nu); /* sets the handles based on their selection, do this after the data is copied to the TransData */
+			if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TILT) == 0) {
+				/* sets the handles based on their selection, do this after the data is copied to the TransData */
+				testhandlesNurb(nu);
+			}
 		}
 		else {
 			TransData *head, *tail;
@@ -4443,7 +4445,8 @@
 		/* mark all children */
 		for (base= scene->base.first; base; base= base->next) {
 			/* all base not already selected or marked that is editable */
-			if ((base->object->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 && BASE_EDITABLE_BGMODE(v3d, scene, base))
+			if ( (base->object->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
+			     (BASE_EDITABLE_BGMODE(v3d, scene, base)))
 			{
 				mark_children(base->object);
 			}
@@ -4454,7 +4457,8 @@
 		Object *ob= base->object;
 
 		/* if base is not selected, not a parent of selection or not a child of selection and it is editable */
-		if ((ob->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 && BASE_EDITABLE_BGMODE(v3d, scene, base))
+		if ( (ob->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 &&
+		     (BASE_EDITABLE_BGMODE(v3d, scene, base)))
 		{
 
 			/* used for flush, depgraph will change recalcs if needed :) */
@@ -4530,7 +4534,9 @@
 			if (adt && adt->action) {
 				for (fcu= adt->action->curves.first; fcu; fcu= fcu->next) {
 					fcu->flag &= ~FCURVE_SELECTED;
-					insert_keyframe(reports, id, adt->action, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
+					insert_keyframe(reports, id, adt->action,
+					                (fcu->grp ? fcu->grp->name : NULL),
+					                fcu->rna_path, fcu->array_index, cfra, flag);
 				}
 			}
 		}
@@ -5048,8 +5054,12 @@
 			DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
 
 	}
-	else if(t->scene->basact && (ob = t->scene->basact->object) && (ob->mode & OB_MODE_PARTICLE_EDIT) && PE_get_current(t->scene, ob)) {
-		;
+	else if ( (t->scene->basact) &&
+	          (ob = t->scene->basact->object) &&
+	          (ob->mode & OB_MODE_PARTICLE_EDIT) &&
+	          PE_get_current(t->scene, ob))
+	{
+		/* do nothing */ ;
 	}
 	else { /* Objects */
 		int i, recalcObPaths=0;

Modified: trunk/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_access.c	2011-12-21 22:23:39 UTC (rev 42811)
+++ trunk/blender/source/blender/makesrna/intern/rna_access.c	2011-12-21 22:56:06 UTC (rev 42812)
@@ -837,12 +837,17 @@
 	PropertySubType subtype= rna_ensure_property(prop)->subtype;
 
 	/* get string to use for array index */
-	if ((index < 4) && ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE))
+	if ((index < 4) && ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE)) {
 		return quatitem[index];
-	else if((index < 4) && ELEM8(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION, PROP_COORDS))
+	}
+	else if((index < 4) && ELEM8(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH,
+	                                      PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION, PROP_COORDS))
+	{
 		return vectoritem[index];
-	else if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA))
+	}
+	else if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) {
 		return coloritem[index];
+	}
 
 	return '\0';
 }
@@ -865,7 +870,9 @@
 				return 3;
 		}
 	}
-	else if(ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION)) {
+	else if(ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ,
+	                       PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
+	{
 		switch (name) {
 			case 'x':
 				return 0;
@@ -1519,7 +1526,8 @@
 	/* find cache element for which key matches... */
 	for (uce = rna_updates_cache.first; uce; uce = uce->next) {
 		/* just match by id only for now, since most update calls that we'll encounter only really care about this */
-		// TODO: later, the cache might need to have some nesting on L1 to cope better with these problems + some tagging to indicate we need this
+		/* TODO: later, the cache might need to have some nesting on L1 to cope better
+		 * with these problems + some tagging to indicate we need this */
 		if (uce->ptr.id.data == ptr->id.data)
 			break;
 	}
@@ -4969,7 +4977,9 @@
 	return 0;
 }
 
-static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, PropertyType type, char ftype, int len, void *dest, void *src, StructRNA *srna, const char *tid, const char *fid, const char *pid)
+static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, PropertyType type,
+                                        char ftype, int len, void *dest, void *src, StructRNA *srna,
+                                        const char *tid, const char *fid, const char *pid)
 {
 	/* ptr is always a function pointer, prop always a parameter */
 
@@ -5055,7 +5065,9 @@
 			 }
 			
 			if (ptype!=srna && !RNA_struct_is_a(srna, ptype)) {
-				fprintf(stderr, "%s.%s: wrong type for parameter %s, an object of type %s was expected, passed an object of type %s\n", tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(srna));
+				fprintf(stderr, "%s.%s: wrong type for parameter %s, "
+				        "an object of type %s was expected, passed an object of type %s\n",
+				        tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(srna));
 				return -1;
 			}
  
@@ -5080,7 +5092,10 @@
 			ptype= RNA_property_pointer_type(ptr, prop);
 			
 			if (ptype!=srna && !RNA_struct_is_a(srna, ptype)) {
-				fprintf(stderr, "%s.%s: wrong type for parameter %s, a collection of objects of type %s was expected, passed a collection of objects of type %s\n", tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(srna));
+				fprintf(stderr, "%s.%s: wrong type for parameter %s, "
+				        "a collection of objects of type %s was expected, "
+				        "passed a collection of objects of type %s\n",
+				        tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(srna));
 				return -1;
 			}
 
@@ -5159,7 +5174,10 @@
 
 		if (len!=alen) {
 			err= -1;
-			fprintf(stderr, "%s.%s: for parameter %s, was expecting an array of %i elements, passed %i elements instead\n", tid, fid, pid, len, alen);
+			fprintf(stderr, "%s.%s: for parameter %s, "
+			        "was expecting an array of %i elements, "
+			        "passed %i elements instead\n",
+			        tid, fid, pid, len, alen);
 			break;
 		}
 
@@ -5224,7 +5242,9 @@
 
 		if (len!=alen) {
 			err= -1;
-			fprintf(stderr, "%s.%s: for return parameter %s, was expecting an array of %i elements, passed %i elements instead\n", tid, fid, pid, len, alen);
+			fprintf(stderr, "%s.%s: for return parameter %s, "
+			        "was expecting an array of %i elements, passed %i elements instead\n",
+			        tid, fid, pid, len, alen);
 		}
 		else {
 			switch (type) {
@@ -5278,7 +5298,8 @@
 	return err;
 }
 
-int RNA_function_call_direct_va_lookup(bContext *C, ReportList *reports, PointerRNA *ptr, const char *identifier, const char *format, va_list args)
+int RNA_function_call_direct_va_lookup(bContext *C, ReportList *reports, PointerRNA *ptr,
+                                       const char *identifier, const char *format, va_list args)
 {
 	FunctionRNA *func;
 

Modified: trunk/blender/source/blender/python/intern/gpu.c
===================================================================
--- trunk/blender/source/blender/python/intern/gpu.c	2011-12-21 22:23:39 UTC (rev 42811)
+++ trunk/blender/source/blender/python/intern/gpu.c	2011-12-21 22:56:06 UTC (rev 42812)
@@ -145,6 +145,14 @@
 	PyObject_SetAttrString(d, #f, val);	\
 	Py_DECREF(val)
 
+PyDoc_STRVAR(GPU_export_shader_doc,
+"export_shader(scene, material)\n"
+"\n"
+"   Returns the GLSL shader that produces the visual effect of material in scene.\n"
+"\n"
+"   :return: Dictionary defining the shader, uniforms and attributes.\n"
+"   :rtype: Dict"
+);
 static PyObject* GPU_export_shader(PyObject* UNUSED(self), PyObject *args, PyObject *kwds)
 {
 	PyObject* pyscene;
@@ -279,11 +287,9 @@
 	return result;
 }
 
-static PyMethodDef meth_export_shader[] = {{ "export_shader", (PyCFunction)GPU_export_shader, METH_VARARGS | METH_KEYWORDS,

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list