64 if (!pmd || !pmd->
canvas) {
76 for (surface = surface->prev; surface; surface = surface->prev) {
86 ot->
name =
"Add Surface Slot";
87 ot->
idname =
"DPAINT_OT_surface_slot_add";
108 if (!pmd || !pmd->
canvas) {
116 for (; surface; surface = surface->next) {
134 ot->
name =
"Remove Surface Slot";
135 ot->
idname =
"DPAINT_OT_surface_slot_remove";
186 ot->
name =
"Toggle Type Active";
187 ot->
idname =
"DPAINT_OT_type_toggle";
188 ot->
description =
"Toggle whether given type is active or not";
216 if (!pmd || !pmd->
canvas) {
227 name = surface->output_name;
230 name = surface->output_name2;
265 {0,
"A", 0,
"Output A",
""},
266 {1,
"B", 0,
"Output B",
""},
267 {0,
nullptr, 0,
nullptr,
nullptr},
271 ot->
name =
"Toggle Output Layer";
272 ot->
idname =
"DPAINT_OT_output_toggle";
273 ot->
description =
"Add or remove Dynamic Paint output data layer";
317 canvas->
flags &= ~MOD_DPAINT_BAKING;
321 G.is_rendering =
false;
334 if (strlen(canvas->
error)) {
354 int frame = 1, orig_frame;
357 frames = surface->end_frame - surface->start_frame + 1;
367 frame = surface->start_frame;
368 orig_frame = input_scene->
r.
cfra;
379 for (frame = surface->start_frame; frame <= surface->end_frame; frame++) {
381 const float progress = 0.1f + 0.9f * (frame - surface->start_frame) /
float(frames);
382 surface->current_frame = frame;
412 filepath,
sizeof(filepath), surface->image_output_path, surface->output_name);
422 filepath,
sizeof(filepath), surface->image_output_path, surface->output_name2);
431 input_scene->
r.
cfra = orig_frame;
450 G.is_rendering =
true;
456 worker_status->
stop =
false;
476 if (pmd ==
nullptr) {
483 if (canvas ==
nullptr) {
490 canvas->
error[0] =
'\0';
496 job->
scene = scene_eval;
498 job->
ob = object_eval;
505 "Dynamic Paint Bake",
524 ot->
name =
"Dynamic Paint Bake";
525 ot->
description =
"Bake dynamic paint image sequence surface";
bool BKE_attribute_remove(AttributeOwner &owner, const char *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(bool set)
#define BLI_path_join(...)
bool BLI_path_frame(char *path, size_t path_maxncpy, int frame, int digits) ATTR_NONNULL(1)
#define STRNCPY(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)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
@ 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
static AttributeOwner from_id(ID *id)
const Depsgraph * depsgraph
static int dynamicpaint_bake_exec(bContext *C, wmOperator *op)
static int type_toggle_exec(bContext *C, wmOperator *op)
void DPAINT_OT_type_toggle(wmOperatorType *ot)
void DPAINT_OT_output_toggle(wmOperatorType *ot)
static void dpaint_bake_endjob(void *customdata)
static int output_toggle_exec(bContext *C, wmOperator *op)
static void dynamicPaint_bakeImageSequence(DynamicPaintBakeJob *job)
void DPAINT_OT_surface_slot_add(wmOperatorType *ot)
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 int surface_slot_remove_exec(bContext *C, wmOperator *)
void DPAINT_OT_bake(wmOperatorType *ot)
static int surface_slot_add_exec(bContext *C, wmOperator *)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
Object * context_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
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_report(eReportType type, const char *message)
void WM_reportf(eReportType type, const char *format,...)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_set_locked_interface(wmWindowManager *wm, bool lock)
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))