diff options
author | Roman Pogribnyi <pogribnyi@gmail.com> | 2014-05-30 16:03:33 +0400 |
---|---|---|
committer | Roman Pogribnyi <pogribnyi@gmail.com> | 2014-05-30 16:03:33 +0400 |
commit | ac78fde8488ca080b4a5f4a6d75dfd6682ed9678 (patch) | |
tree | 5d80bf016620419fc171e205ca85d8413ced33f5 /source/blender | |
parent | a009fb637bc37e7f63957fac06509419e2a3eb34 (diff) |
operator to generate setup file added
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/physics/physics_fluid.c | 45 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_ops.c | 9 |
3 files changed, 55 insertions, 0 deletions
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 3972ed1c49e..23814612868 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -65,6 +65,10 @@ #include "physics_intern.h" // own include /* enable/disable overall compilation */ +/*mantaflow include*/ +#include "../../../../intern/smoke/extern/smoke_API.h" +#include "DNA_smoke_types.h" + #ifdef WITH_MOD_FLUID #include "WM_api.h" @@ -1129,3 +1133,44 @@ void FLUID_OT_bake(wmOperatorType *ot) ot->poll = ED_operator_object_active_editable; } + + +static int manta_make_file_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) +{ + Scene *scene= CTX_data_scene(C); + SmokeModifierData *smd; + Object * smokeDomain = CTX_data_active_object(C); + smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, eModifierType_Smoke); + smoke_mantaflow_write_scene_file(scene, smd); + /* return OPERATOR_CANCELLED;*/ + + return OPERATOR_FINISHED; +} + +static int manta_make_file_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + SmokeModifierData *smd; + Object * smokeDomain = CTX_data_active_object(C); + smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, eModifierType_Smoke); + smoke_mantaflow_write_scene_file(scene, smd); + + /* return OPERATOR_CANCELLED;*/ + + return OPERATOR_FINISHED; +} + + +void MANTA_OT_make_file(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Create Mantaflow File"; + ot->description = "Create Python Script for Simulation"; + ot->idname = "MANTA_OT_make_file"; + + /* api callbacks */ + ot->invoke = manta_make_file_invoke; + ot->exec = manta_make_file_exec; + ot->poll = ED_operator_object_active_editable; +} + diff --git a/source/blender/editors/physics/physics_intern.h b/source/blender/editors/physics/physics_intern.h index 77ce5a334e6..065a6f1fd9b 100644 --- a/source/blender/editors/physics/physics_intern.h +++ b/source/blender/editors/physics/physics_intern.h @@ -88,6 +88,7 @@ void BOID_OT_state_move_down(struct wmOperatorType *ot); /* physics_fluid.c */ void FLUID_OT_bake(struct wmOperatorType *ot); +void MANTA_OT_make_file(struct wmOperatorType *ot); /* dynamicpaint.c */ void DPAINT_OT_bake(struct wmOperatorType *ot); diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index 48cc51ffb55..eeb6e8898d7 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -178,6 +178,14 @@ static void operatortypes_fluid(void) WM_operatortype_append(FLUID_OT_bake); } +/********************************* manta ***********************************/ + +static void operatortypes_manta(void) +{ + WM_operatortype_append(MANTA_OT_make_file); +} + + /**************************** point cache **********************************/ static void operatortypes_pointcache(void) @@ -219,6 +227,7 @@ void ED_operatortypes_physics(void) operatortypes_particle(); operatortypes_boids(); operatortypes_fluid(); + operatortypes_manta(); operatortypes_pointcache(); operatortypes_dynamicpaint(); } |