* Allows moving, rotating & scaling of particle simulations.
* Setting in particle render options.
* Changes viewed & rendered particles from global space to parent space.
* Doesn't effect simulations at all.
psys = context.particle_system
part = psys.settings
- layout.itemR(part, "material")
+ row = layout.row()
+ row.itemR(part, "material")
+ row.itemR(psys, "parent");
split = layout.split()
if(draw_as!=PART_DRAW_PATH){
state.time=cfra;
if(psys_get_particle_state(scene,ob,psys,a,&state,0)){
+ if(psys->parent)
+ Mat4MulVecfl(psys->parent->obmat, state.co);
+
/* create actiual particle data */
switch(draw_as){
case PART_DRAW_DOT:
struct Object *target_ob;
struct Object *keyed_ob;
struct Object *lattice;
+ struct Object *parent; /* particles from global space -> parent space */
struct ListBase effectors, reactevents; /* runtime */
RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache", "");
+
+ /* offset ob */
+ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "parent");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Parent", "Use this object's coordinate system instead of global coordinate system.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
+
}
void RNA_def_particle(BlenderRNA *brna)
if(psys_get_particle_state(re->scene,ob,psys,a,&state,0)==0)
continue;
+ if(psys->parent)
+ Mat4MulVecfl(psys->parent->obmat, state.co);
+
VECCOPY(loc,state.co);
if(part->ren_as!=PART_DRAW_BB)
MTC_Mat4MulVecfl(re->viewmat,loc);