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) 2001-2002 by NaN Holding BV. 00019 * All rights reserved. 00020 * 00021 * The Original Code is: all of this file. 00022 * 00023 * Contributor(s): none yet. 00024 * 00025 * ***** END GPL LICENSE BLOCK ***** 00026 */ 00027 00028 #ifndef BKE_OBJECT_H 00029 #define BKE_OBJECT_H 00030 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif 00038 00039 struct Base; 00040 struct Scene; 00041 struct Object; 00042 struct Camera; 00043 struct BoundBox; 00044 struct View3D; 00045 struct SoftBody; 00046 struct BulletSoftBody; 00047 struct Group; 00048 struct bAction; 00049 struct RenderData; 00050 struct rctf; 00051 struct MovieClip; 00052 00053 void clear_workob(struct Object *workob); 00054 void what_does_parent(struct Scene *scene, struct Object *ob, struct Object *workob); 00055 00056 void copy_baseflags(struct Scene *scene); 00057 void copy_objectflags(struct Scene *scene); 00058 struct SoftBody *copy_softbody(struct SoftBody *sb); 00059 struct BulletSoftBody *copy_bulletsoftbody(struct BulletSoftBody *sb); 00060 void copy_object_particlesystems(struct Object *obn, struct Object *ob); 00061 void copy_object_softbody(struct Object *obn, struct Object *ob); 00062 void object_free_particlesystems(struct Object *ob); 00063 void object_free_softbody(struct Object *ob); 00064 void object_free_bulletsoftbody(struct Object *ob); 00065 void update_base_layer(struct Scene *scene, struct Object *ob); 00066 00067 void free_object(struct Object *ob); 00068 void object_free_display(struct Object *ob); 00069 00070 void object_link_modifiers(struct Object *ob, struct Object *from); 00071 void object_free_modifiers(struct Object *ob); 00072 00073 void object_make_proxy(struct Object *ob, struct Object *target, struct Object *gob); 00074 void object_copy_proxy_drivers(struct Object *ob, struct Object *target); 00075 00076 void unlink_object(struct Object *ob); 00077 int exist_object(struct Object *obtest); 00078 00079 struct Object *add_only_object(int type, const char *name); 00080 struct Object *add_object(struct Scene *scene, int type); 00081 00082 struct Object *copy_object(struct Object *ob); 00083 void make_local_object(struct Object *ob); 00084 int object_is_libdata(struct Object *ob); 00085 int object_data_is_libdata(struct Object *ob); 00086 void set_mblur_offs(float blur); 00087 void set_field_offs(float field); 00088 void disable_speed_curve(int val); 00089 00090 void object_scale_to_mat3(struct Object *ob, float mat[][3]); 00091 void object_rot_to_mat3(struct Object *ob, float mat[][3]); 00092 void object_mat3_to_rot(struct Object *ob, float mat[][3], short use_compat); 00093 void object_to_mat3(struct Object *ob, float mat[][3]); 00094 void object_to_mat4(struct Object *ob, float mat[][4]); 00095 void object_apply_mat4(struct Object *ob, float mat[][4], const short use_compat, const short use_parent); 00096 00097 struct Object *object_pose_armature_get(struct Object *ob); 00098 00099 void where_is_object_time(struct Scene *scene, struct Object *ob, float ctime); 00100 void where_is_object(struct Scene *scene, struct Object *ob); 00101 void where_is_object_simul(struct Scene *scene, struct Object *ob); 00102 void where_is_object_mat(struct Scene *scene, struct Object *ob, float obmat[4][4]); 00103 00104 struct BoundBox *unit_boundbox(void); 00105 void boundbox_set_from_min_max(struct BoundBox *bb, float min[3], float max[3]); 00106 struct BoundBox *object_get_boundbox(struct Object *ob); 00107 void object_get_dimensions(struct Object *ob, float *value); 00108 void object_set_dimensions(struct Object *ob, const float *value); 00109 void object_boundbox_flag(struct Object *ob, int flag, int set); 00110 void minmax_object(struct Object *ob, float min[3], float max[3]); 00111 int minmax_object_duplis(struct Scene *scene, struct Object *ob, float *min, float *max); 00112 00113 /* sometimes min-max isnt enough, we need to loop over each point */ 00114 void BKE_object_foreach_display_point( 00115 struct Object *ob, float obmat[4][4], 00116 void (*func_cb)(const float[3], void *), void *user_data); 00117 void BKE_scene_foreach_display_point( 00118 struct Scene *scene, 00119 struct View3D *v3d, 00120 const short flag, 00121 void (*func_cb)(const float[3], void *), void *user_data); 00122 00123 int BKE_object_parent_loop_check(const struct Object *parent, const struct Object *ob); 00124 00125 void solve_tracking (struct Object *ob, float targetmat[][4]); 00126 int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3]); 00127 00128 void *object_tfm_backup(struct Object *ob); 00129 void object_tfm_restore(struct Object *ob, void *obtfm_pt); 00130 00131 typedef struct ObjectTfmProtectedChannels { 00132 float loc[3], dloc[3]; 00133 float size[3], dscale[3]; 00134 float rot[3], drot[3]; 00135 float quat[4], dquat[4]; 00136 float rotAxis[3], drotAxis[3]; 00137 float rotAngle, drotAngle; 00138 } ObjectTfmProtectedChannels; 00139 00140 void object_tfm_protected_backup(const struct Object *ob, 00141 ObjectTfmProtectedChannels *obtfm); 00142 00143 void object_tfm_protected_restore(struct Object *ob, 00144 const ObjectTfmProtectedChannels *obtfm, 00145 const short protectflag); 00146 00147 void object_handle_update(struct Scene *scene, struct Object *ob); 00148 void object_sculpt_modifiers_changed(struct Object *ob); 00149 00150 int give_obdata_texspace(struct Object *ob, short **texflag, float **loc, float **size, float **rot); 00151 00152 int object_insert_ptcache(struct Object *ob); 00153 // void object_delete_ptcache(struct Object *ob, int index); 00154 struct KeyBlock *object_insert_shape_key(struct Scene *scene, struct Object *ob, const char *name, int from_mix); 00155 00156 int object_is_modified(struct Scene *scene, struct Object *ob); 00157 00158 void object_relink(struct Object *ob); 00159 00160 struct MovieClip *object_get_movieclip(struct Scene *scene, struct Object *ob, int use_default); 00161 00162 #ifdef __cplusplus 00163 } 00164 #endif 00165 00166 #endif