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