2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2008-01-01 18:29:19 +00:00
|
|
|
* ***** 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-01-01 18:29:19 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
2011-02-21 07:25:24 +00:00
|
|
|
|
|
|
|
/** \file ED_object.h
|
|
|
|
* \ingroup editors
|
|
|
|
*/
|
|
|
|
|
2008-01-01 18:29:19 +00:00
|
|
|
#ifndef ED_OBJECT_H
|
|
|
|
#define ED_OBJECT_H
|
|
|
|
|
2010-10-05 00:05:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-12-29 12:15:42 +00:00
|
|
|
struct Base;
|
2009-01-10 19:34:23 +00:00
|
|
|
struct bConstraint;
|
2010-08-01 12:47:49 +00:00
|
|
|
struct bContext;
|
2009-11-26 17:07:14 +00:00
|
|
|
struct bPoseChannel;
|
2010-08-01 12:47:49 +00:00
|
|
|
struct Curve;
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
struct KeyBlock;
|
|
|
|
struct Lattice;
|
2010-08-01 12:47:49 +00:00
|
|
|
struct Main;
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
struct Mesh;
|
2009-05-21 15:36:16 +00:00
|
|
|
struct ModifierData;
|
2010-08-01 12:47:49 +00:00
|
|
|
struct Object;
|
|
|
|
struct ReportList;
|
|
|
|
struct Scene;
|
|
|
|
struct View3D;
|
2009-11-02 16:07:49 +00:00
|
|
|
struct wmEvent;
|
2010-08-01 12:47:49 +00:00
|
|
|
struct wmKeyConfig;
|
|
|
|
struct wmKeyMap;
|
|
|
|
struct wmOperator;
|
|
|
|
struct wmOperatorType;
|
2008-12-23 19:47:33 +00:00
|
|
|
|
2009-01-30 15:01:14 +00:00
|
|
|
/* object_edit.c */
|
2012-01-02 17:15:24 +00:00
|
|
|
struct Object *ED_object_context(struct bContext *C); /* context.object */
|
|
|
|
struct Object *ED_object_active_context(struct bContext *C); /* context.object or context.active_object */
|
2010-03-31 00:55:01 +00:00
|
|
|
|
|
|
|
/* object_ops.c */
|
2008-12-23 19:47:33 +00:00
|
|
|
void ED_operatortypes_object(void);
|
2009-10-12 12:54:08 +00:00
|
|
|
void ED_operatormacros_object(void);
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void ED_keymap_object(struct wmKeyConfig *keyconf);
|
2008-12-23 19:47:33 +00:00
|
|
|
|
2010-07-31 19:26:21 +00:00
|
|
|
/* generic editmode keys like pet
|
|
|
|
* do_pet
|
|
|
|
* 0: No
|
|
|
|
* 1: Object
|
|
|
|
* 2: Edit
|
|
|
|
* 3: Edit with connected
|
|
|
|
* */
|
2009-10-13 15:30:19 +00:00
|
|
|
void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet);
|
|
|
|
|
2008-12-29 12:15:42 +00:00
|
|
|
/* send your own notifier for select! */
|
|
|
|
void ED_base_object_select(struct Base *base, short mode);
|
|
|
|
/* includes notifier */
|
2008-12-29 13:02:18 +00:00
|
|
|
void ED_base_object_activate(struct bContext *C, struct Base *base);
|
2008-12-29 12:15:42 +00:00
|
|
|
|
2010-08-01 12:47:49 +00:00
|
|
|
void ED_base_object_free_and_unlink(struct Main *bmain, struct Scene *scene, struct Base *base);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-07-26 11:01:56 +00:00
|
|
|
/* single object duplicate, if dupflag==0, fully linked, else it uses the flags given */
|
2010-08-01 12:47:49 +00:00
|
|
|
struct Base *ED_object_add_duplicate(struct Main *bmain, struct Scene *scene, struct Base *base, int dupflag);
|
2009-01-05 15:19:31 +00:00
|
|
|
|
2009-07-14 20:27:28 +00:00
|
|
|
void ED_object_parent(struct Object *ob, struct Object *parent, int type, const char *substr);
|
2009-01-05 15:19:31 +00:00
|
|
|
|
2009-08-15 18:58:01 +00:00
|
|
|
void ED_object_toggle_modes(struct bContext *C, int mode);
|
|
|
|
|
2009-01-01 18:05:12 +00:00
|
|
|
/* bitflags for enter/exit editmode */
|
|
|
|
#define EM_FREEDATA 1
|
|
|
|
#define EM_FREEUNDO 2
|
|
|
|
#define EM_WAITCURSOR 4
|
2009-06-26 15:48:09 +00:00
|
|
|
#define EM_DO_UNDO 8
|
2009-11-05 14:25:08 +00:00
|
|
|
#define EM_IGNORE_LAYER 16
|
2009-01-01 18:05:12 +00:00
|
|
|
void ED_object_exit_editmode(struct bContext *C, int flag);
|
|
|
|
void ED_object_enter_editmode(struct bContext *C, int flag);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-12-28 04:09:46 +00:00
|
|
|
void ED_object_location_from_view(struct bContext *C, float *loc);
|
|
|
|
void ED_object_rotation_from_view(struct bContext *C, float *rot);
|
|
|
|
void ED_object_base_init_transform(struct bContext *C, struct Base *base, float *loc, float *rot);
|
2010-06-09 19:20:05 +00:00
|
|
|
float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob, float *loc, float *rot, float primmat[][4]);
|
2009-12-28 04:09:46 +00:00
|
|
|
|
2009-11-02 16:07:49 +00:00
|
|
|
void ED_object_add_generic_props(struct wmOperatorType *ot, int do_editmode);
|
|
|
|
int ED_object_add_generic_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
|
2011-12-04 23:04:43 +00:00
|
|
|
int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op,
|
|
|
|
float *loc, float *rot, int *enter_editmode, unsigned int *layer);
|
|
|
|
|
|
|
|
struct Object *ED_object_add_type(struct bContext *C, int type, float *loc,
|
|
|
|
float *rot, int enter_editmode, unsigned int layer);
|
2009-01-05 15:19:31 +00:00
|
|
|
|
2010-08-01 12:47:49 +00:00
|
|
|
void ED_object_single_users(struct Main *bmain, struct Scene *scene, int full);
|
2011-08-08 08:22:01 +00:00
|
|
|
void ED_object_single_user(struct Scene *scene, struct Object *ob);
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2010-01-19 11:31:49 +00:00
|
|
|
/* object motion paths */
|
2010-10-16 14:32:17 +00:00
|
|
|
void ED_objects_clear_paths(struct bContext *C);
|
2010-01-19 11:31:49 +00:00
|
|
|
void ED_objects_recalculate_paths(struct bContext *C, struct Scene *scene);
|
|
|
|
|
2009-01-10 19:34:23 +00:00
|
|
|
/* constraints */
|
2009-05-27 00:03:49 +00:00
|
|
|
struct ListBase *get_active_constraints(struct Object *ob);
|
2009-11-26 09:48:53 +00:00
|
|
|
struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **pchan_r);
|
2009-05-27 00:03:49 +00:00
|
|
|
struct bConstraint *get_active_constraint(struct Object *ob);
|
|
|
|
|
|
|
|
void object_test_constraints(struct Object *ob);
|
|
|
|
|
|
|
|
void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con);
|
2009-09-24 21:22:24 +00:00
|
|
|
void ED_object_constraint_update(struct Object *ob);
|
2010-08-01 12:47:49 +00:00
|
|
|
void ED_object_constraint_dependency_update(struct Main *bmain, struct Scene *scene, struct Object *ob);
|
2009-01-10 19:34:23 +00:00
|
|
|
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +00:00
|
|
|
/* object_lattice.c */
|
2011-05-12 16:47:36 +00:00
|
|
|
int mouse_lattice(struct bContext *C, const int mval[2], int extend);
|
2010-11-17 09:45:45 +00:00
|
|
|
void undo_push_lattice(struct bContext *C, const char *name);
|
2009-01-13 15:18:41 +00:00
|
|
|
|
2009-11-29 22:16:29 +00:00
|
|
|
/* object_lattice.c */
|
|
|
|
|
|
|
|
void ED_setflagsLatt(struct Object *obedit, int flag);
|
|
|
|
|
2009-05-21 15:34:09 +00:00
|
|
|
/* object_modifier.c */
|
2009-11-22 13:44:09 +00:00
|
|
|
enum {
|
|
|
|
MODIFIER_APPLY_DATA=1,
|
2011-09-10 09:38:38 +00:00
|
|
|
MODIFIER_APPLY_SHAPE
|
|
|
|
};
|
2009-11-22 13:44:09 +00:00
|
|
|
|
2010-11-17 09:45:45 +00:00
|
|
|
struct ModifierData *ED_object_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, const char *name, int type);
|
2010-08-01 12:47:49 +00:00
|
|
|
int ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, struct ModifierData *md);
|
2011-11-23 16:44:33 +00:00
|
|
|
void ED_object_modifier_clear(struct Main *bmain, struct Scene *scene, struct Object *ob);
|
2009-05-21 15:34:09 +00:00
|
|
|
int ED_object_modifier_move_down(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
|
|
|
|
int ED_object_modifier_move_up(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
|
2010-08-01 12:47:49 +00:00
|
|
|
int ED_object_modifier_convert(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, struct ModifierData *md);
|
2009-11-22 13:44:09 +00:00
|
|
|
int ED_object_modifier_apply(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md, int mode);
|
2009-05-21 15:34:09 +00:00
|
|
|
int ED_object_modifier_copy(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
|
2009-01-10 19:34:23 +00:00
|
|
|
|
2010-10-05 00:05:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-01-01 18:29:19 +00:00
|
|
|
#endif /* ED_OBJECT_H */
|
|
|
|
|