Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_sculpt_paint.c
| Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | |||||
| static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr) | static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr) | ||||
| { | { | ||||
| return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL); | return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL); | ||||
| } | } | ||||
| static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr)) | static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); | |||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Object *ob = OBACT(view_layer); | Object *ob = OBACT(view_layer); | ||||
| PTCacheEdit *edit = PE_get_current(scene, ob); | PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob); | ||||
| if (!edit) { | if (!edit) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (ob) { | if (ob) { | ||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | ||||
| } | } | ||||
| Show All 35 Lines | |||||
| static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, | static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, | ||||
| PointerRNA *UNUSED(ptr), | PointerRNA *UNUSED(ptr), | ||||
| PropertyRNA *UNUSED(prop), | PropertyRNA *UNUSED(prop), | ||||
| bool *UNUSED(r_free)) | bool *UNUSED(r_free)) | ||||
| { | { | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Object *ob = OBACT(view_layer); | Object *ob = OBACT(view_layer); | ||||
| # if 0 | # if 0 | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); | |||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| PTCacheEdit *edit = PE_get_current(scene, ob); | PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob); | ||||
| ParticleSystem *psys = edit ? edit->psys : NULL; | ParticleSystem *psys = edit ? edit->psys : NULL; | ||||
| # else | # else | ||||
| /* use this rather than PE_get_current() - because the editing cache is | /* use this rather than PE_get_current() - because the editing cache is | ||||
| * dependent on the cache being updated which can happen after this UI | * dependent on the cache being updated which can happen after this UI | ||||
| * draws causing a glitch [#28883] */ | * draws causing a glitch [#28883] */ | ||||
| ParticleSystem *psys = psys_get_current(ob); | ParticleSystem *psys = psys_get_current(ob); | ||||
| # endif | # endif | ||||
| if (psys) { | if (psys) { | ||||
| if (psys->flag & PSYS_GLOBAL_HAIR) { | if (psys->flag & PSYS_GLOBAL_HAIR) { | ||||
| return rna_enum_particle_edit_disconnected_hair_brush_items; | return rna_enum_particle_edit_disconnected_hair_brush_items; | ||||
| } | } | ||||
| else { | else { | ||||
| return rna_enum_particle_edit_hair_brush_items; | return rna_enum_particle_edit_hair_brush_items; | ||||
| } | } | ||||
| } | } | ||||
| return particle_edit_cache_brush_items; | return particle_edit_cache_brush_items; | ||||
| } | } | ||||
| static bool rna_ParticleEdit_editable_get(PointerRNA *ptr) | static bool rna_ParticleEdit_editable_get(PointerRNA *ptr) | ||||
| { | { | ||||
| ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data; | ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data; | ||||
| return (pset->object && pset->scene && PE_get_current(pset->scene, pset->object)); | return (pset->object && pset->scene && PE_get_current(NULL, pset->scene, pset->object)); | ||||
| } | } | ||||
| static bool rna_ParticleEdit_hair_get(PointerRNA *ptr) | static bool rna_ParticleEdit_hair_get(PointerRNA *ptr) | ||||
| { | { | ||||
| ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data; | ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data; | ||||
| if (pset->scene) { | if (pset->scene) { | ||||
| PTCacheEdit *edit = PE_get_current(pset->scene, pset->object); | PTCacheEdit *edit = PE_get_current(NULL, pset->scene, pset->object); | ||||
| return (edit && edit->psys); | return (edit && edit->psys); | ||||
| } | } | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| static char *rna_ParticleEdit_path(PointerRNA *UNUSED(ptr)) | static char *rna_ParticleEdit_path(PointerRNA *UNUSED(ptr)) | ||||
| ▲ Show 20 Lines • Show All 1,294 Lines • Show Last 20 Lines | |||||