Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/physics/particle_edit_undo.c
| Show All 38 Lines | |||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "DNA_windowmanager_types.h" | #include "DNA_windowmanager_types.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_global.h" | |||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_pointcache.h" | #include "BKE_pointcache.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_main.h" | |||||
| #include "BKE_undo_system.h" | #include "BKE_undo_system.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "ED_object.h" | #include "ED_object.h" | ||||
| #include "ED_particle.h" | #include "ED_particle.h" | ||||
| #include "ED_physics.h" | #include "ED_physics.h" | ||||
| #include "ED_undo.h" | |||||
| #include "particle_edit_utildefines.h" | #include "particle_edit_utildefines.h" | ||||
| #include "physics_intern.h" | #include "physics_intern.h" | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Undo Conversion | /** \name Undo Conversion | ||||
| * \{ */ | * \{ */ | ||||
| ▲ Show 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | |||||
| } ParticleUndoStep; | } ParticleUndoStep; | ||||
| static bool particle_undosys_poll(struct bContext *C) | static bool particle_undosys_poll(struct bContext *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(scene, ob); | ||||
| return (edit != NULL); | return (edit != NULL); | ||||
| } | } | ||||
| static bool particle_undosys_step_encode(struct bContext *C, UndoStep *us_p) | static bool particle_undosys_step_encode(struct bContext *C, UndoStep *us_p) | ||||
| { | { | ||||
| ParticleUndoStep *us = (ParticleUndoStep *)us_p; | ParticleUndoStep *us = (ParticleUndoStep *)us_p; | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| us->scene_ref.ptr = CTX_data_scene(C); | us->scene_ref.ptr = CTX_data_scene(C); | ||||
| ▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines | |||||