Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/physics/particle_object.c
| Show First 20 Lines • Show All 646 Lines • ▼ Show 20 Lines | if (ELEM(pset->brushtype, PE_BRUSH_ADD, PE_BRUSH_PUFF)) { | ||||
| pset->brushtype = PE_BRUSH_COMB; | pset->brushtype = PE_BRUSH_COMB; | ||||
| } | } | ||||
| PE_update_object(depsgraph, scene, ob, 0); | PE_update_object(depsgraph, scene, ob, 0); | ||||
| } | } | ||||
| static int disconnect_hair_exec(bContext *C, wmOperator *op) | static int disconnect_hair_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Object *ob = ED_object_context(C); | Object *ob = ED_object_context(C); | ||||
| ParticleSystem *psys = NULL; | ParticleSystem *psys = NULL; | ||||
| const bool all = RNA_boolean_get(op->ptr, "all"); | const bool all = RNA_boolean_get(op->ptr, "all"); | ||||
| if (!ob) { | if (!ob) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 265 Lines • ▼ Show 20 Lines | ok = remap_hair_emitter(depsgraph, | ||||
| false); | false); | ||||
| psys->flag &= ~PSYS_GLOBAL_HAIR; | psys->flag &= ~PSYS_GLOBAL_HAIR; | ||||
| return ok; | return ok; | ||||
| } | } | ||||
| static int connect_hair_exec(bContext *C, wmOperator *op) | static int connect_hair_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Object *ob = ED_object_context(C); | Object *ob = ED_object_context(C); | ||||
| ParticleSystem *psys = NULL; | ParticleSystem *psys = NULL; | ||||
| const bool all = RNA_boolean_get(op->ptr, "all"); | const bool all = RNA_boolean_get(op->ptr, "all"); | ||||
| bool any_connected = false; | bool any_connected = false; | ||||
| if (!ob) { | if (!ob) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| ▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | static bool copy_particle_systems_to_object(const bContext *C, | ||||
| Scene *scene, | Scene *scene, | ||||
| Object *ob_from, | Object *ob_from, | ||||
| ParticleSystem *single_psys_from, | ParticleSystem *single_psys_from, | ||||
| Object *ob_to, | Object *ob_to, | ||||
| int space, | int space, | ||||
| bool duplicate_settings) | bool duplicate_settings) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| ModifierData *md; | ModifierData *md; | ||||
| ParticleSystem *psys_start = NULL, *psys, *psys_from; | ParticleSystem *psys_start = NULL, *psys, *psys_from; | ||||
| ParticleSystem **tmp_psys; | ParticleSystem **tmp_psys; | ||||
| Mesh *final_mesh; | Mesh *final_mesh; | ||||
| CustomData_MeshMasks cdmask = {0}; | CustomData_MeshMasks cdmask = {0}; | ||||
| int i, totpsys; | int i, totpsys; | ||||
| if (ob_to->type != OB_MESH) { | if (ob_to->type != OB_MESH) { | ||||
| ▲ Show 20 Lines • Show All 262 Lines • Show Last 20 Lines | |||||