[Bf-blender-cvs] [c991cd7] particles_refactor: Add position attribute to particles by default.
Lukas Tönne
noreply at git.blender.org
Tue Apr 22 12:06:06 CEST 2014
Commit: c991cd78e762e468c88f1245e1a93e8ced9b8427
Author: Lukas Tönne
Date: Tue Dec 17 16:55:59 2013 +0100
https://developer.blender.org/rBc991cd78e762e468c88f1245e1a93e8ced9b8427
Add position attribute to particles by default.
===================================================================
M source/blender/blenkernel/intern/nparticle.c
===================================================================
diff --git a/source/blender/blenkernel/intern/nparticle.c b/source/blender/blenkernel/intern/nparticle.c
index 990bbda..312c091 100644
--- a/source/blender/blenkernel/intern/nparticle.c
+++ b/source/blender/blenkernel/intern/nparticle.c
@@ -168,14 +168,21 @@ static void nparticle_system_sync_state_attributes(NParticleSystem *psys, NParti
}
+static void nparticle_system_default_attributes(NParticleSystem *psys)
+{
+ /* required attributes */
+ BKE_nparticle_attribute_new(psys, "id", PAR_ATTR_DATATYPE_INT, PAR_ATTR_REQUIRED | PAR_ATTR_READONLY);
+
+ /* common attributes */
+ BKE_nparticle_attribute_new(psys, "position", PAR_ATTR_DATATYPE_POINT, PAR_ATTR_PROTECTED);
+}
+
NParticleSystem *BKE_nparticle_system_new(void)
{
NParticleSystem *psys = MEM_callocN(sizeof(NParticleSystem), "nparticle system");
psys->state = nparticle_state_new(psys);
-
- /* required attributes */
- BKE_nparticle_attribute_new(psys, "id", PAR_ATTR_DATATYPE_INT, PAR_ATTR_REQUIRED | PAR_ATTR_READONLY);
+ nparticle_system_default_attributes(psys);
return psys;
}
More information about the Bf-blender-cvs
mailing list