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:
authorJoseph Eagar <joeedh@gmail.com>2011-02-27 09:19:40 +0300
committerJoseph Eagar <joeedh@gmail.com>2011-02-27 09:19:40 +0300
commitf01261d040be27337db9f9996d648a279c89b7c4 (patch)
treec448230939b3c90d53ce8852dd00925d6052e3a4 /source/blender/editors/metaball
parentdcaeda5c4e3a0687251b8511de4f2e8b85ef75c0 (diff)
parent2198cfdb2deec8b2e85e242c74a032f43d0b26ca (diff)
merge with/from trunk at r35190
Diffstat (limited to 'source/blender/editors/metaball')
-rw-r--r--source/blender/editors/metaball/CMakeLists.txt14
-rw-r--r--source/blender/editors/metaball/Makefile56
-rw-r--r--source/blender/editors/metaball/SConscript2
-rw-r--r--source/blender/editors/metaball/mball_edit.c56
-rw-r--r--source/blender/editors/metaball/mball_intern.h2
-rw-r--r--source/blender/editors/metaball/mball_ops.c4
6 files changed, 38 insertions, 96 deletions
diff --git a/source/blender/editors/metaball/CMakeLists.txt b/source/blender/editors/metaball/CMakeLists.txt
index 5e821a5c1e8..af3d25699ed 100644
--- a/source/blender/editors/metaball/CMakeLists.txt
+++ b/source/blender/editors/metaball/CMakeLists.txt
@@ -19,11 +19,10 @@
#
# ***** END GPL LICENSE BLOCK *****
-FILE(GLOB SRC *.c)
-
-SET(INC
+set(INC
../include
../../blenkernel
+ ../../blenloader
../../blenlib
../../makesdna
../../makesrna
@@ -32,4 +31,11 @@ SET(INC
../../../../intern/guardedalloc
)
-BLENDERLIB(bf_editor_metaball "${SRC}" "${INC}")
+set(SRC
+ mball_edit.c
+ mball_ops.c
+
+ mball_intern.h
+)
+
+blender_add_lib(bf_editor_metaball "${SRC}" "${INC}")
diff --git a/source/blender/editors/metaball/Makefile b/source/blender/editors/metaball/Makefile
deleted file mode 100644
index c28ef59e9db..00000000000
--- a/source/blender/editors/metaball/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# $Id$
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# The Original Code is Copyright (C) 2007 Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): none yet.
-#
-# ***** END GPL LICENSE BLOCK *****
-#
-# Makes module object directory and bounces make to subdirectories.
-
-LIBNAME = ed_metaball
-DIR = $(OCGDIR)/blender/$(LIBNAME)
-
-include nan_compile.mk
-
-CFLAGS += $(LEVEL_1_C_WARNINGS)
-
-CPPFLAGS += -I$(NAN_GLEW)/include
-CPPFLAGS += -I$(OPENGL_HEADERS)
-
-CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
-CPPFLAGS += -I$(NAN_ELBEEM)/include
-
-CPPFLAGS += -I../../windowmanager
-CPPFLAGS += -I../../blenkernel
-CPPFLAGS += -I../../blenloader
-CPPFLAGS += -I../../blenlib
-CPPFLAGS += -I../../makesdna
-CPPFLAGS += -I../../makesrna
-CPPFLAGS += -I../../imbuf
-CPPFLAGS += -I../../gpu
-CPPFLAGS += -I../../render/extern/include
-
-# own include
-
-CPPFLAGS += -I../include
diff --git a/source/blender/editors/metaball/SConscript b/source/blender/editors/metaball/SConscript
index e526a1560cf..b1a1ce935db 100644
--- a/source/blender/editors/metaball/SConscript
+++ b/source/blender/editors/metaball/SConscript
@@ -5,7 +5,7 @@ sources = env.Glob('*.c')
incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
-incs += ' ../../gpu'
+incs += ' ../../gpu ../../blenloader'
incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern'
env.BlenderLib ( 'bf_editors_metaball', sources, Split(incs), [], libtype=['core'], priority=[45] )
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index 62ebe84e078..48750e9c6b8 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -1,4 +1,4 @@
-/**
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -35,6 +35,7 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_rand.h"
+#include "BLI_utildefines.h"
#include "DNA_meta_types.h"
#include "DNA_object_types.h"
@@ -47,6 +48,7 @@
#include "BKE_context.h"
#include "BKE_mball.h"
+#include "ED_mball.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "ED_transform.h"
@@ -55,6 +57,8 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "mball_intern.h"
+
/* This function is used to free all MetaElems from MetaBall */
void free_editMball(Object *obedit)
{
@@ -84,26 +88,24 @@ void make_editMball(Object *obedit)
/* This function is called, when MetaBall Object switched from
* edit mode to object mode. List od MetaElements is copied
* from object->data->edit_elems to object->data->elems. */
-void load_editMball(Object *obedit)
+void load_editMball(Object *UNUSED(obedit))
{
}
/* Add metaelem primitive to metaball object (which is in edit mode) */
-MetaElem *add_metaball_primitive(bContext *C, float mat[4][4], int type, int newname)
+MetaElem *add_metaball_primitive(bContext *C, float mat[4][4], int type, int UNUSED(newname))
{
Object *obedit= CTX_data_edit_object(C);
MetaBall *mball = (MetaBall*)obedit->data;
MetaElem *ml;
- if(!obedit) return NULL;
-
/* Deselect all existing metaelems */
ml= mball->editelems->first;
while(ml) {
ml->flag &= ~SELECT;
ml= ml->next;
}
-
+
ml= add_metaball_element(mball, type);
copy_v3_v3(&ml->x, mat[3]);
@@ -177,7 +179,7 @@ void MBALL_OT_select_all(wmOperatorType *ot)
/***************************** Select inverse operator *****************************/
/* Invert metaball selection */
-static int select_inverse_metaelems_exec(bContext *C, wmOperator *op)
+static int select_inverse_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
MetaBall *mb = (MetaBall*)obedit->data;
@@ -266,7 +268,7 @@ void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot)
/***************************** Duplicate operator *****************************/
/* Duplicate selected MetaElements */
-static int duplicate_metaelems_exec(bContext *C, wmOperator *op)
+static int duplicate_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
MetaBall *mb = (MetaBall*)obedit->data;
@@ -284,13 +286,13 @@ static int duplicate_metaelems_exec(bContext *C, wmOperator *op)
ml= ml->prev;
}
WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
- DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+ DAG_id_tag_update(obedit->data, 0);
}
return OPERATOR_FINISHED;
}
-static int duplicate_metaelems_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int duplicate_metaelems_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
int retv= duplicate_metaelems_exec(C, op);
@@ -325,7 +327,7 @@ void MBALL_OT_duplicate_metaelems(wmOperatorType *ot)
/***************************** Delete operator *****************************/
/* Delete all selected MetaElems (not MetaBall) */
-static int delete_metaelems_exec(bContext *C, wmOperator *op)
+static int delete_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
MetaBall *mb= (MetaBall*)obedit->data;
@@ -343,7 +345,7 @@ static int delete_metaelems_exec(bContext *C, wmOperator *op)
ml= next;
}
WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
- DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+ DAG_id_tag_update(obedit->data, 0);
}
return OPERATOR_FINISHED;
@@ -372,28 +374,18 @@ static int hide_metaelems_exec(bContext *C, wmOperator *op)
Object *obedit= CTX_data_edit_object(C);
MetaBall *mb= (MetaBall*)obedit->data;
MetaElem *ml;
- int hide_unselected= RNA_boolean_get(op->ptr, "unselected");
+ const int invert= RNA_boolean_get(op->ptr, "unselected") ? SELECT : 0;
ml= mb->editelems->first;
if(ml) {
- /* Hide unselected metaelems */
- if(hide_unselected) {
- while(ml){
- if(!(ml->flag & SELECT))
- ml->flag |= MB_HIDE;
- ml= ml->next;
- }
- /* Hide selected metaelems */
- } else {
- while(ml){
- if(ml->flag & SELECT)
- ml->flag |= MB_HIDE;
- ml= ml->next;
- }
+ while(ml){
+ if((ml->flag & SELECT) != invert)
+ ml->flag |= MB_HIDE;
+ ml= ml->next;
}
WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
- DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+ DAG_id_tag_update(obedit->data, 0);
}
return OPERATOR_FINISHED;
@@ -420,7 +412,7 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot)
/***************************** Unhide operator *****************************/
/* Unhide all edited MetaElems */
-static int reveal_metaelems_exec(bContext *C, wmOperator *op)
+static int reveal_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *obedit= CTX_data_edit_object(C);
MetaBall *mb= (MetaBall*)obedit->data;
@@ -434,7 +426,7 @@ static int reveal_metaelems_exec(bContext *C, wmOperator *op)
ml= ml->next;
}
WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
- DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+ DAG_id_tag_update(obedit->data, 0);
}
return OPERATOR_FINISHED;
@@ -606,7 +598,7 @@ static void free_undoMball(void *lbv)
MEM_freeN(lb);
}
-ListBase *metaball_get_editelems(Object *ob)
+static ListBase *metaball_get_editelems(Object *ob)
{
if(ob && ob->type==OB_MBALL) {
struct MetaBall *mb= (struct MetaBall*)ob->data;
@@ -623,7 +615,7 @@ static void *get_data(bContext *C)
}
/* this is undo system for MetaBalls */
-void undo_push_mball(bContext *C, char *name)
+void undo_push_mball(bContext *C, const char *name)
{
undo_editmode_push(C, name, get_data, free_undoMball, undoMball_to_editMball, editMball_to_undoMball, NULL);
}
diff --git a/source/blender/editors/metaball/mball_intern.h b/source/blender/editors/metaball/mball_intern.h
index 454b30eceef..36c263bde47 100644
--- a/source/blender/editors/metaball/mball_intern.h
+++ b/source/blender/editors/metaball/mball_intern.h
@@ -1,4 +1,4 @@
-/**
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c
index 14402d7dae6..99d313e2a30 100644
--- a/source/blender/editors/metaball/mball_ops.c
+++ b/source/blender/editors/metaball/mball_ops.c
@@ -1,4 +1,4 @@
-/**
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -31,7 +31,7 @@
#include "RNA_access.h"
-
+#include "ED_mball.h"
#include "ED_screen.h"
#include "mball_intern.h"