Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-01-02 21:15:24 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-02 21:15:24 +0400
commit1e18da32fb3df5d491201770d10992f0b975650b (patch)
tree3c2efd537a5fcda4a5b9de57bc04c5905c984c02 /source/blender/editors/physics/dynamicpaint_ops.c
parentaa43cab8206a07a37dacb4e606ef6112c1054587 (diff)
replace:
CTX_data_pointer_get_type(C, "object", &RNA_Object).data with api call: ED_object_context(C) ... since getting the context object is such a common operation.
Diffstat (limited to 'source/blender/editors/physics/dynamicpaint_ops.c')
-rw-r--r--source/blender/editors/physics/dynamicpaint_ops.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c
index 6e25307b786..cdcaae91070 100644
--- a/source/blender/editors/physics/dynamicpaint_ops.c
+++ b/source/blender/editors/physics/dynamicpaint_ops.c
@@ -42,6 +42,7 @@
#include "ED_mesh.h"
#include "ED_screen.h"
+#include "ED_object.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -58,7 +59,7 @@
static int surface_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
{
DynamicPaintModifierData *pmd = NULL;
- Object *cObject = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *cObject = ED_object_context(C);
DynamicPaintCanvasSettings *canvas;
DynamicPaintSurface *surface;
@@ -100,7 +101,7 @@ void DPAINT_OT_surface_slot_add(wmOperatorType *ot)
static int surface_slot_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
DynamicPaintModifierData *pmd = NULL;
- Object *cObject = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *cObject = ED_object_context(C);
DynamicPaintCanvasSettings *canvas;
DynamicPaintSurface *surface;
int id=0;
@@ -148,7 +149,7 @@ void DPAINT_OT_surface_slot_remove(wmOperatorType *ot)
static int type_toggle_exec(bContext *C, wmOperator *op)
{
- Object *cObject = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *cObject = ED_object_context(C);
Scene *scene = CTX_data_scene(C);
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)modifiers_findByType(cObject, eModifierType_DynamicPaint);
int type= RNA_enum_get(op->ptr, "type");
@@ -199,7 +200,7 @@ void DPAINT_OT_type_toggle(wmOperatorType *ot)
static int output_toggle_exec(bContext *C, wmOperator *op)
{
- Object *ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob = ED_object_context(C);
Scene *scene = CTX_data_scene(C);
DynamicPaintSurface *surface;
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)modifiers_findByType(ob, eModifierType_DynamicPaint);
@@ -344,7 +345,7 @@ static int dynamicPaint_initBake(struct bContext *C, struct wmOperator *op)
{
DynamicPaintModifierData *pmd = NULL;
DynamicPaintCanvasSettings *canvas;
- Object *ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob = ED_object_context(C);
int status = 0;
double timer = PIL_check_seconds_timer();
char result_str[80];