Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_meshcache.c
| Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | static void deformVertsEM(ModifierData *md, | ||||
| int numVerts) | int numVerts) | ||||
| { | { | ||||
| MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md; | MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md; | ||||
| Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph); | Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph); | ||||
| meshcache_do(mcmd, scene, ctx->object, vertexCos, numVerts); | meshcache_do(mcmd, scene, ctx->object, vertexCos, numVerts); | ||||
| } | } | ||||
| static void panel_draw(const bContext *C, Panel *panel) | static void panel_draw(const bContext *UNUSED(C), Panel *panel) | ||||
| { | { | ||||
| uiLayout *layout = panel->layout; | uiLayout *layout = panel->layout; | ||||
| PointerRNA ptr; | PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); | ||||
| modifier_panel_get_property_pointers(C, panel, NULL, &ptr); | |||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiItemR(layout, &ptr, "cache_format", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "cache_format", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "filepath", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "filepath", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "factor", UI_ITEM_R_SLIDER, NULL, ICON_NONE); | uiItemR(layout, ptr, "factor", UI_ITEM_R_SLIDER, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "deform_mode", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "deform_mode", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "interpolation", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "interpolation", 0, NULL, ICON_NONE); | ||||
| modifier_panel_end(layout, &ptr); | modifier_panel_end(layout, ptr); | ||||
| } | } | ||||
| static void time_remapping_panel_draw(const bContext *C, Panel *panel) | static void time_remapping_panel_draw(const bContext *UNUSED(C), Panel *panel) | ||||
| { | { | ||||
| uiLayout *layout = panel->layout; | uiLayout *layout = panel->layout; | ||||
| PointerRNA ptr; | PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); | ||||
| modifier_panel_get_property_pointers(C, panel, NULL, &ptr); | |||||
| uiItemR(layout, &ptr, "time_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(layout, ptr, "time_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiItemR(layout, &ptr, "play_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(layout, ptr, "play_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| if (RNA_enum_get(&ptr, "play_mode") == MOD_MESHCACHE_PLAY_CFEA) { | if (RNA_enum_get(ptr, "play_mode") == MOD_MESHCACHE_PLAY_CFEA) { | ||||
| uiItemR(layout, &ptr, "frame_start", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "frame_start", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "frame_scale", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "frame_scale", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| else { /* play_mode == MOD_MESHCACHE_PLAY_EVAL */ | else { /* play_mode == MOD_MESHCACHE_PLAY_EVAL */ | ||||
| int time_mode = RNA_enum_get(&ptr, "time_mode"); | int time_mode = RNA_enum_get(ptr, "time_mode"); | ||||
| if (time_mode == MOD_MESHCACHE_TIME_FRAME) { | if (time_mode == MOD_MESHCACHE_TIME_FRAME) { | ||||
| uiItemR(layout, &ptr, "eval_frame", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "eval_frame", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| else if (time_mode == MOD_MESHCACHE_TIME_SECONDS) { | else if (time_mode == MOD_MESHCACHE_TIME_SECONDS) { | ||||
| uiItemR(layout, &ptr, "eval_time", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "eval_time", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| else { /* time_mode == MOD_MESHCACHE_TIME_FACTOR */ | else { /* time_mode == MOD_MESHCACHE_TIME_FACTOR */ | ||||
| uiItemR(layout, &ptr, "eval_factor", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "eval_factor", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void axis_mapping_panel_draw(const bContext *C, Panel *panel) | static void axis_mapping_panel_draw(const bContext *UNUSED(C), Panel *panel) | ||||
| { | { | ||||
| uiLayout *col; | uiLayout *col; | ||||
| uiLayout *layout = panel->layout; | uiLayout *layout = panel->layout; | ||||
| PointerRNA ptr; | PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL); | ||||
| modifier_panel_get_property_pointers(C, panel, NULL, &ptr); | |||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| col = uiLayoutColumn(layout, true); | col = uiLayoutColumn(layout, true); | ||||
| uiLayoutSetRedAlert(col, RNA_enum_get(&ptr, "forward_axis") == RNA_enum_get(&ptr, "up_axis")); | uiLayoutSetRedAlert(col, RNA_enum_get(ptr, "forward_axis") == RNA_enum_get(ptr, "up_axis")); | ||||
| uiItemR(col, &ptr, "forward_axis", 0, NULL, ICON_NONE); | uiItemR(col, ptr, "forward_axis", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, &ptr, "up_axis", 0, NULL, ICON_NONE); | uiItemR(col, ptr, "up_axis", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "flip_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(layout, ptr, "flip_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| } | } | ||||
| static void panelRegister(ARegionType *region_type) | static void panelRegister(ARegionType *region_type) | ||||
| { | { | ||||
| PanelType *panel_type = modifier_panel_register( | PanelType *panel_type = modifier_panel_register( | ||||
| region_type, eModifierType_MeshCache, panel_draw); | region_type, eModifierType_MeshCache, panel_draw); | ||||
| modifier_subpanel_register(region_type, | modifier_subpanel_register(region_type, | ||||
| "time_remapping", | "time_remapping", | ||||
| ▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines | |||||