[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30404] branches/soc-2010-moguri/source/ blender: Give newly created uniforms a default type of float rather than nothing.

Mitchell Stokes mogurijin at gmail.com
Fri Jul 16 10:37:29 CEST 2010


Revision: 30404
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30404
Author:   moguri
Date:     2010-07-16 10:37:28 +0200 (Fri, 16 Jul 2010)

Log Message:
-----------
Give newly created uniforms a default type of float rather than nothing. I've also created a function to start handling CustomUniform initiation instead of doing it all in the add operator.

Modified Paths:
--------------
    branches/soc-2010-moguri/source/blender/blenkernel/BKE_material.h
    branches/soc-2010-moguri/source/blender/blenkernel/intern/material.c
    branches/soc-2010-moguri/source/blender/editors/render/render_shading.c

Modified: branches/soc-2010-moguri/source/blender/blenkernel/BKE_material.h
===================================================================
--- branches/soc-2010-moguri/source/blender/blenkernel/BKE_material.h	2010-07-16 06:49:31 UTC (rev 30403)
+++ branches/soc-2010-moguri/source/blender/blenkernel/BKE_material.h	2010-07-16 08:37:28 UTC (rev 30404)
@@ -45,6 +45,7 @@
 void free_material(struct Material *sc); 
 void test_object_materials(struct ID *id);
 void init_material(struct Material *ma);
+void init_custom_uniform(struct CustomUniform *cu);
 struct Material *add_material(char *name);
 struct Material *copy_material(struct Material *ma);
 struct Material *give_node_material(struct Material *ma); /* returns node material or self */

Modified: branches/soc-2010-moguri/source/blender/blenkernel/intern/material.c
===================================================================
--- branches/soc-2010-moguri/source/blender/blenkernel/intern/material.c	2010-07-16 06:49:31 UTC (rev 30403)
+++ branches/soc-2010-moguri/source/blender/blenkernel/intern/material.c	2010-07-16 08:37:28 UTC (rev 30404)
@@ -197,6 +197,12 @@
 	ma->csi.geom_out= MA_CS_GEOM_OUT_TRIANGLE_STRIP;
 }
 
+void init_custom_uniform(CustomUniform *cu)
+{
+	strcpy(&cu->name[0], "Uniform");
+	cu->type = MA_UNF_FLOAT;
+}
+
 Material *add_material(char *name)
 {
 	Material *ma;

Modified: branches/soc-2010-moguri/source/blender/editors/render/render_shading.c
===================================================================
--- branches/soc-2010-moguri/source/blender/editors/render/render_shading.c	2010-07-16 06:49:31 UTC (rev 30403)
+++ branches/soc-2010-moguri/source/blender/editors/render/render_shading.c	2010-07-16 08:37:28 UTC (rev 30404)
@@ -1049,7 +1049,7 @@
 	Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
 	CustomUniform *cu= MEM_callocN(sizeof(CustomUniform), "New Uniform");
 
-	strcpy(&cu->name[0], "Uniform");
+	init_custom_uniform(cu);
 
 	BLI_addtail(&ma->csi.uniforms, cu);
 	





More information about the Bf-blender-cvs mailing list