Blender  V2.59
ED_object.h
Go to the documentation of this file.
00001 /*
00002  * $Id: ED_object.h 39175 2011-08-08 08:22:01Z campbellbarton $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version. 
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2008 Blender Foundation.
00021  * All rights reserved.
00022  *
00023  * 
00024  * Contributor(s): Blender Foundation
00025  *
00026  * ***** END GPL LICENSE BLOCK *****
00027  */
00028 
00033 #ifndef ED_OBJECT_H
00034 #define ED_OBJECT_H
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 struct Base;
00041 struct bConstraint;
00042 struct bContext;
00043 struct bPoseChannel;
00044 struct Curve;
00045 struct KeyBlock;
00046 struct Lattice;
00047 struct Main;
00048 struct Mesh;
00049 struct ModifierData;
00050 struct Object;
00051 struct ReportList;
00052 struct Scene;
00053 struct View3D;
00054 struct wmEvent;
00055 struct wmKeyConfig;
00056 struct wmKeyMap;
00057 struct wmOperator;
00058 struct wmOperatorType;
00059 
00060 /* object_edit.c */
00061 struct Object *ED_object_active_context(struct bContext *C);
00062 
00063 /* object_ops.c */
00064 void ED_operatortypes_object(void);
00065 void ED_operatormacros_object(void);
00066 void ED_keymap_object(struct wmKeyConfig *keyconf);
00067 
00068 /* generic editmode keys like pet
00069  * do_pet
00070  *      0: No
00071  *      1: Object
00072  *      2: Edit
00073  *      3: Edit with connected
00074  * */
00075 void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet);
00076 
00077         /* send your own notifier for select! */
00078 void ED_base_object_select(struct Base *base, short mode);
00079         /* includes notifier */
00080 void ED_base_object_activate(struct bContext *C, struct Base *base);
00081 
00082 void ED_base_object_free_and_unlink(struct Main *bmain, struct Scene *scene, struct Base *base);
00083 
00084         /* single object duplicate, if dupflag==0, fully linked, else it uses the flags given */
00085 struct Base *ED_object_add_duplicate(struct Main *bmain, struct Scene *scene, struct Base *base, int dupflag);
00086 
00087 void ED_object_parent(struct Object *ob, struct Object *parent, int type, const char *substr);
00088 
00089 void ED_object_toggle_modes(struct bContext *C, int mode);
00090 
00091 /* bitflags for enter/exit editmode */
00092 #define EM_FREEDATA             1
00093 #define EM_FREEUNDO             2
00094 #define EM_WAITCURSOR   4
00095 #define EM_DO_UNDO              8
00096 #define EM_IGNORE_LAYER 16
00097 void ED_object_exit_editmode(struct bContext *C, int flag);
00098 void ED_object_enter_editmode(struct bContext *C, int flag);
00099 
00100 void ED_object_location_from_view(struct bContext *C, float *loc);
00101 void ED_object_rotation_from_view(struct bContext *C, float *rot);
00102 void ED_object_base_init_transform(struct bContext *C, struct Base *base, float *loc, float *rot);
00103 float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob, float *loc, float *rot, float primmat[][4]);
00104 
00105 void ED_object_add_generic_props(struct wmOperatorType *ot, int do_editmode);
00106 int ED_object_add_generic_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
00107 int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, float *loc, float *rot, int *enter_editmode, unsigned int *layer);
00108 struct Object *ED_object_add_type(struct bContext *C, int type, float *loc, float *rot, int enter_editmode, unsigned int layer);
00109 
00110 void ED_object_single_users(struct Main *bmain, struct Scene *scene, int full);
00111 void ED_object_single_user(struct Scene *scene, struct Object *ob);
00112 
00113 /* object motion paths */
00114 void ED_objects_clear_paths(struct bContext *C);
00115 void ED_objects_recalculate_paths(struct bContext *C, struct Scene *scene);
00116 
00117 /* constraints */
00118 struct ListBase *get_active_constraints(struct Object *ob);
00119 struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **pchan_r);
00120 struct bConstraint *get_active_constraint(struct Object *ob);
00121 
00122 void object_test_constraints(struct Object *ob);
00123 
00124 void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con);
00125 void ED_object_constraint_update(struct Object *ob);
00126 void ED_object_constraint_dependency_update(struct Main *bmain, struct Scene *scene, struct Object *ob);
00127 
00128 /* object_lattice.c */
00129 int  mouse_lattice(struct bContext *C, const int mval[2], int extend);
00130 void undo_push_lattice(struct bContext *C, const char *name);
00131 
00132 /* object_lattice.c */
00133 
00134 void ED_setflagsLatt(struct Object *obedit, int flag);
00135 
00136 /* object_modifier.c */
00137 enum {
00138         MODIFIER_APPLY_DATA=1,
00139         MODIFIER_APPLY_SHAPE,
00140 } eModifier_Apply_Mode;
00141 
00142 struct ModifierData *ED_object_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, const char *name, int type);
00143 int ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, struct ModifierData *md);
00144 int ED_object_modifier_move_down(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
00145 int ED_object_modifier_move_up(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
00146 int ED_object_modifier_convert(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, struct ModifierData *md);
00147 int ED_object_modifier_apply(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md, int mode);
00148 int ED_object_modifier_copy(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
00149 
00150 #ifdef __cplusplus
00151 }
00152 #endif
00153 
00154 #endif /* ED_OBJECT_H */
00155