[Bf-blender-cvs] [e775f53] particles_refactor: Basic properties for particle attribute descriptors. Uses a generic function to inject these properties using the nested 'desc' field.

Lukas Tönne noreply at git.blender.org
Tue Apr 22 12:05:28 CEST 2014


Commit: e775f53b1684cbedec94f68851731473bbf4a3b0
Author: Lukas Tönne
Date:   Mon Aug 12 11:44:03 2013 +0200
https://developer.blender.org/rBe775f53b1684cbedec94f68851731473bbf4a3b0

Basic properties for particle attribute descriptors. Uses a generic function to inject these properties using the nested 'desc' field.

===================================================================

M	source/blender/makesrna/intern/rna_nparticle.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_nparticle.c b/source/blender/makesrna/intern/rna_nparticle.c
index f7c4ffa..42ccb6d 100644
--- a/source/blender/makesrna/intern/rna_nparticle.c
+++ b/source/blender/makesrna/intern/rna_nparticle.c
@@ -86,14 +86,32 @@ EnumPropertyItem nparticle_attribute_datatype_user[] = {
     {0, NULL, 0, NULL, NULL}
 };
 
+static void def_nparticle_attribute(StructRNA *srna)
+{
+	PropertyRNA *prop;
+
+	prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+	RNA_def_property_string_sdna(prop, NULL, "name");
+	RNA_def_property_ui_text(prop, "Name", "Unique name");
+	RNA_def_struct_name_property(srna, prop);
+
+	prop = RNA_def_property(srna, "datatype", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "datatype");
+	RNA_def_property_enum_items(prop, nparticle_attribute_datatype_all);
+	RNA_def_property_ui_text(prop, "Data Type", "Basic data type");
+}
+
 static void rna_def_nparticle_buffer_attribute(BlenderRNA *brna)
 {
 	StructRNA *srna;
-	PropertyRNA *prop;
 
 	srna = RNA_def_struct(brna, "NParticleBufferAttribute", NULL);
 	RNA_def_struct_sdna(srna, "NParticleBufferAttribute");
 	RNA_def_struct_ui_text(srna, "Particle Buffer Attribute", "Attribute data associated to particles");
+
+	RNA_def_struct_sdna_from(srna, "NParticleAttribute", "desc");
+	def_nparticle_attribute(srna);
+	RNA_def_struct_sdna_from(srna, "NParticleBufferAttribute", NULL); /* reset */
 }
 
 static void rna_def_nparticle_buffer_attributes_api(BlenderRNA *brna, PropertyRNA *cprop)




More information about the Bf-blender-cvs mailing list