62 if (!pmd || !pmd->
canvas) {
84 ot->
name =
"Add Surface Slot";
85 ot->
idname =
"DPAINT_OT_surface_slot_add";
106 if (!pmd || !pmd->
canvas) {
132 ot->
name =
"Remove Surface Slot";
133 ot->
idname =
"DPAINT_OT_surface_slot_remove";
184 ot->
name =
"Toggle Type Active";
185 ot->
idname =
"DPAINT_OT_type_toggle";
186 ot->
description =
"Toggle whether given type is active or not";
213 if (!pmd || !pmd->
canvas) {
261 {0,
"A", 0,
"Output A",
""},
262 {1,
"B", 0,
"Output B",
""},
267 ot->
name =
"Toggle Output Layer";
268 ot->
idname =
"DPAINT_OT_output_toggle";
269 ot->
description =
"Add or remove Dynamic Paint output data layer";
317 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 = (int)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;
378 surface->current_frame = frame;
391 input_scene->
r.
cfra = (int)frame;
427 input_scene->
r.
cfra = orig_frame;
446 G.is_rendering =
true;
479 if (canvas ==
NULL) {
486 canvas->
error[0] =
'\0';
491 job->
scene = scene_eval;
493 job->
ob = object_eval;
500 "Dynamic Paint Bake",
519 ot->
name =
"Dynamic Paint Bake";
520 ot->
description =
"Bake dynamic paint image sequence surface";
struct Scene * CTX_data_scene(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
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, short *do_update)
void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd)
struct DynamicPaintSurface * get_activeSurface(struct DynamicPaintCanvasSettings *canvas)
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)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_spacedata_draw_locks(bool set)
bool BLI_path_frame(char *path, int frame, int digits) ATTR_NONNULL()
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
struct Scene * DEG_get_input_scene(const Depsgraph *graph)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ 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(struct Mesh *me, const char *name, bool active_set, bool do_init, struct ReportList *reports)
bool ED_mesh_color_remove_named(struct Mesh *me, const char *name)
struct Object * ED_object_context(const struct bContext *C)
bool ED_operator_object_active_local_editable(struct bContext *C)
void ED_update_for_newframe(struct Main *bmain, struct Depsgraph *depsgraph)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
Platform independent time functions.
@ WM_JOB_TYPE_DPAINT_BAKE
const Depsgraph * depsgraph
static int type_toggle_exec(bContext *C, wmOperator *op)
static int surface_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
static int dynamicpaint_bake_exec(struct bContext *C, struct wmOperator *op)
static void dpaint_bake_startjob(void *customdata, short *stop, short *do_update, float *progress)
void DPAINT_OT_type_toggle(wmOperatorType *ot)
void DPAINT_OT_output_toggle(wmOperatorType *ot)
static void dpaint_bake_endjob(void *customdata)
struct DynamicPaintBakeJob DynamicPaintBakeJob
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)
void DPAINT_OT_surface_slot_remove(wmOperatorType *ot)
static int surface_slot_remove_exec(bContext *C, wmOperator *UNUSED(op))
void DPAINT_OT_bake(wmOperatorType *ot)
struct @211::@212 surface
ccl_global KernelShaderEvalInput ccl_global float * output
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_prop_dynamicpaint_type_items[]
DynamicPaintCanvasSettings * canvas
DynamicPaintSurface * surface
struct DynamicPaintCanvasSettings * canvas
struct DynamicPaintBrushSettings * brush
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
double PIL_check_seconds_timer(void)
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_start(wmWindowManager *wm, wmJob *wm_job)
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 *))
void WM_jobs_timer(wmJob *wm_job, double timestep, unsigned int note, unsigned int endnote)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, int flag, int job_type)