61 if (!pmd || !pmd->
canvas) {
73 for (surface = surface->
prev; surface; surface = surface->
prev) {
83 ot->name =
"Add Surface Slot";
84 ot->idname =
"DPAINT_OT_surface_slot_add";
85 ot->description =
"Add a new Dynamic Paint surface slot";
105 if (!pmd || !pmd->
canvas) {
113 for (; surface; surface = surface->
next) {
131 ot->name =
"Remove Surface Slot";
132 ot->idname =
"DPAINT_OT_surface_slot_remove";
133 ot->description =
"Remove the selected surface slot";
183 ot->name =
"Toggle Type Active";
184 ot->idname =
"DPAINT_OT_type_toggle";
185 ot->description =
"Toggle whether given type is active or not";
213 if (!pmd || !pmd->
canvas) {
262 {0,
"A", 0,
"Output A",
""},
263 {1,
"B", 0,
"Output B",
""},
264 {0,
nullptr, 0,
nullptr,
nullptr},
268 ot->name =
"Toggle Output Layer";
269 ot->idname =
"DPAINT_OT_output_toggle";
270 ot->description =
"Add or remove Dynamic Paint output data layer";
280 ot->prop =
RNA_def_enum(
ot->srna,
"output", prop_output_toggle_types, 0,
"Output Toggle",
"");
318 G.is_rendering =
false;
330 if (strlen(canvas->
error)) {
350 int frame = 1, orig_frame;
364 orig_frame = input_scene->
r.
cfra;
365 input_scene->
r.
cfra = frame;
375 for (frame = surface->
start_frame; frame <= surface->end_frame; frame++) {
377 const float progress = 0.1f + 0.9f * (frame - surface->
start_frame) /
float(frames);
391 input_scene->
r.
cfra = frame;
427 input_scene->
r.
cfra = orig_frame;
446 G.is_rendering =
true;
452 worker_status->
stop =
false;
472 if (pmd ==
nullptr) {
479 if (canvas ==
nullptr) {
486 canvas->
error[0] =
'\0';
491 job->
scene = scene_eval;
493 job->
ob = object_eval;
500 "Baking Dynamic Paint...",
519 ot->name =
"Dynamic Paint Bake";
520 ot->description =
"Bake dynamic paint image sequence surface";
521 ot->idname =
"DPAINT_OT_bake";
bool BKE_attribute_remove(AttributeOwner &owner, blender::StringRef name, struct ReportList *reports)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
struct DynamicPaintSurface * get_activeSurface(struct DynamicPaintCanvasSettings *canvas)
bool dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output)
void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, const char *filepath, short output_layer)
void dynamicPaint_freeCanvas(struct DynamicPaintModifierData *pmd)
bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene)
int dynamicPaint_createUVSurface(struct Scene *scene, struct DynamicPaintSurface *surface, float *progress, bool *do_update)
void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd)
struct DynamicPaintSurface * dynamicPaint_createNewSurface(struct DynamicPaintCanvasSettings *canvas, struct Scene *scene)
int dynamicPaint_calculateFrame(struct DynamicPaintSurface *surface, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *cObject, int frame)
void dynamicPaint_freeSurfaceData(struct DynamicPaintSurface *surface)
void dynamicPaint_freeSurface(const struct DynamicPaintModifierData *pmd, struct DynamicPaintSurface *surface)
ModifierData * BKE_modifiers_findby_type(const Object *ob, ModifierType type)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_spacedata_draw_locks(ARegionDrawLockFlags lock_flags)
@ REGION_DRAW_LOCK_BAKING
#define BLI_path_join(...)
bool BLI_path_frame(char *path, size_t path_maxncpy, int frame, int digits) ATTR_NONNULL(1)
#define STRNCPY_UTF8(dst, src)
Platform independent time functions.
double BLI_time_now_seconds(void)
#define BLT_I18NCONTEXT_ID_SIMULATION
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
Scene * DEG_get_input_scene(const Depsgraph *graph)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ MOD_DPAINT_SURFACE_T_WEIGHT
@ MOD_DPAINT_SURFACE_T_PAINT
@ MOD_DPAINT_SURFACE_F_VERTEX
@ MOD_DYNAMICPAINT_TYPE_BRUSH
@ MOD_DYNAMICPAINT_TYPE_CANVAS
@ eModifierType_DynamicPaint
Object is a sort of wrapper for general info.
int ED_mesh_color_add(Mesh *mesh, const char *name, bool active_set, bool do_init, ReportList *reports)
bool ED_operator_object_active_local_editable(bContext *C)
void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph)
Read Guarded memory(de)allocation.
@ WM_JOB_TYPE_DPAINT_BAKE
BPy_StructRNA * depsgraph
static AttributeOwner from_id(ID *id)
void DPAINT_OT_type_toggle(wmOperatorType *ot)
void DPAINT_OT_output_toggle(wmOperatorType *ot)
static void dpaint_bake_endjob(void *customdata)
static void dynamicPaint_bakeImageSequence(DynamicPaintBakeJob *job)
static wmOperatorStatus type_toggle_exec(bContext *C, wmOperator *op)
void DPAINT_OT_surface_slot_add(wmOperatorType *ot)
static wmOperatorStatus output_toggle_exec(bContext *C, wmOperator *op)
static void dpaint_bake_free(void *customdata)
static void dpaint_bake_startjob(void *customdata, wmJobWorkerStatus *worker_status)
void DPAINT_OT_surface_slot_remove(wmOperatorType *ot)
static wmOperatorStatus surface_slot_add_exec(bContext *C, wmOperator *)
static wmOperatorStatus surface_slot_remove_exec(bContext *C, wmOperator *)
static wmOperatorStatus dynamicpaint_bake_exec(bContext *C, wmOperator *op)
void DPAINT_OT_bake(wmOperatorType *ot)
void * MEM_mallocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
Object * context_active_object(const bContext *C)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
const EnumPropertyItem rna_enum_prop_dynamicpaint_type_items[]
DynamicPaintCanvasSettings * canvas
DynamicPaintSurface * surface
struct DynamicPaintCanvasSettings * canvas
struct DynamicPaintBrushSettings * brush
struct DynamicPaintSurface * prev
struct DynamicPaintCanvasSettings * canvas
struct DynamicPaintSurface * next
char image_output_path[1024]
struct ReportList * reports
void WM_locked_interface_set(wmWindowManager *wm, bool lock)
void WM_locked_interface_set_with_flags(wmWindowManager *wm, short lock_flags)
void WM_global_report(eReportType type, const char *message)
void WM_global_reportf(eReportType type, const char *format,...)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_jobs_timer(wmJob *wm_job, double time_step, uint note, uint endnote)
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, const eWM_JobFlag flag, const eWM_JobType job_type)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *customdata))