Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/physics/particle_edit.c
| Show First 20 Lines • Show All 3,511 Lines • ▼ Show 20 Lines | for (i=0; i<totface; i++, mface++) { | ||||
| } | } | ||||
| } | } | ||||
| return intersect; | return intersect; | ||||
| } | } | ||||
| static int brush_add(const bContext *C, PEData *data, short number) | static int brush_add(const bContext *C, PEData *data, short number) | ||||
| { | { | ||||
| EvaluationContext eval_ctx; | EvaluationContext eval_ctx; | ||||
| const Depsgraph *depsgraph = CTX_data_depsgraph(C); | |||||
| Scene *scene= data->scene; | Scene *scene= data->scene; | ||||
| Object *ob= data->ob; | Object *ob= data->ob; | ||||
| DerivedMesh *dm; | DerivedMesh *dm; | ||||
| PTCacheEdit *edit = data->edit; | PTCacheEdit *edit = data->edit; | ||||
| ParticleSystem *psys= edit->psys; | ParticleSystem *psys= edit->psys; | ||||
| ParticleData *add_pars; | ParticleData *add_pars; | ||||
| ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys); | ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys); | ||||
| ParticleSimulationData sim= {0}; | ParticleSimulationData sim= {0}; | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | for (i=0; i<number; i++) { | ||||
| } | } | ||||
| else { | else { | ||||
| dmx = 0.0f; | dmx = 0.0f; | ||||
| dmy = 0.0f; | dmy = 0.0f; | ||||
| } | } | ||||
| mco[0] = data->mval[0] + dmx; | mco[0] = data->mval[0] + dmx; | ||||
| mco[1] = data->mval[1] + dmy; | mco[1] = data->mval[1] + dmy; | ||||
| ED_view3d_win_to_segment(data->vc.ar, data->vc.v3d, mco, co1, co2, true); | ED_view3d_win_to_segment(depsgraph, data->vc.ar, data->vc.v3d, mco, co1, co2, true); | ||||
| mul_m4_v3(imat, co1); | mul_m4_v3(imat, co1); | ||||
| mul_m4_v3(imat, co2); | mul_m4_v3(imat, co2); | ||||
| min_d=2.0; | min_d=2.0; | ||||
| /* warning, returns the derived mesh face */ | /* warning, returns the derived mesh face */ | ||||
| if (particle_intersect_dm(C, scene, ob, dm, 0, co1, co2, &min_d, &add_pars[n].num_dmcache, add_pars[n].fuv, 0, 0, 0, 0)) { | if (particle_intersect_dm(C, scene, ob, dm, 0, co1, co2, &min_d, &add_pars[n].num_dmcache, add_pars[n].fuv, 0, 0, 0, 0)) { | ||||
| if (psys->part->use_modifier_stack && !psmd->dm_final->deformedOnly) { | if (psys->part->use_modifier_stack && !psmd->dm_final->deformedOnly) { | ||||
| ▲ Show 20 Lines • Show All 1,416 Lines • Show Last 20 Lines | |||||