Blender V2.61 - r43446
|
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_group_types.h"
#include "DNA_key_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_scene_types.h"
#include "DNA_vfont_types.h"
#include "BKE_animsys.h"
#include "BKE_curve.h"
#include "BKE_DerivedMesh.h"
#include "BKE_depsgraph.h"
#include "BKE_font.h"
#include "BKE_group.h"
#include "BKE_global.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_object.h"
#include "BKE_particle.h"
#include "BKE_scene.h"
#include "BKE_utildefines.h"
#include "BKE_anim.h"
#include "BKE_report.h"
Go to the source code of this file.
Classes | |
struct | MPathTarget |
struct | vertexDupliData |
Typedefs | |
typedef struct MPathTarget | MPathTarget |
typedef struct vertexDupliData | vertexDupliData |
Functions | |
static void | object_duplilist_recursive (ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int level, int animated) |
void | animviz_settings_init (bAnimVizSettings *avs) |
void | animviz_free_motionpath_cache (bMotionPath *mpath) |
void | animviz_free_motionpath (bMotionPath *mpath) |
bMotionPath * | animviz_verify_motionpaths (ReportList *reports, Scene *scene, Object *ob, bPoseChannel *pchan) |
void | animviz_get_object_motionpaths (Object *ob, ListBase *targets) |
static void | motionpaths_calc_optimise_depsgraph (Scene *scene, ListBase *targets) |
static void | motionpaths_calc_update_scene (Scene *scene) |
static void | motionpaths_calc_bake_targets (Scene *scene, ListBase *targets) |
void | animviz_calc_motionpaths (Scene *scene, ListBase *targets) |
void | free_path (Path *path) |
void | calc_curvepath (Object *ob) |
int | interval_test (int min, int max, int p1, int cycl) |
int | where_on_path (Object *ob, float ctime, float *vec, float *dir, float *quat, float *radius, float *weight) |
static DupliObject * | new_dupli_object (ListBase *lb, Object *ob, float mat[][4], int lay, int index, int type, int animated) |
static void | group_duplilist (ListBase *lb, Scene *scene, Object *ob, int level, int animated) |
static void | frames_duplilist (ListBase *lb, Scene *scene, Object *ob, int level, int animated) |
static void | vertex_dupli__mapFunc (void *userData, int index, float *co, float *no_f, short *no_s) |
static void | vertex_duplilist (ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int level, int animated) |
static void | face_duplilist (ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int level, int animated) |
static void | new_particle_duplilist (ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], ParticleSystem *psys, int level, int animated) |
static Object * | find_family_object (Object **obar, char *family, char ch) |
static void | font_duplilist (ListBase *lb, Scene *scene, Object *par, int level, int animated) |
ListBase * | object_duplilist (Scene *sce, Object *ob) |
void | free_object_duplilist (ListBase *lb) |
int | count_duplilist (Object *ob) |
Definition in file anim.c.
typedef struct MPathTarget MPathTarget |
typedef struct vertexDupliData vertexDupliData |
Definition at line 394 of file anim.c.
References ANIMVIZ_RECALC_PATHS, bPose::avs, Object::avs, CFRA, ELEM, bMotionPath::end_frame, ListBase::first, MAX2, MIN2, motionpaths_calc_bake_targets(), motionpaths_calc_optimise_depsgraph(), motionpaths_calc_update_scene(), MPathTarget::mpath, MPathTarget::next, NULL, MPathTarget::ob, MPathTarget::pchan, Object::pose, bAnimVizSettings::recalc, and bMotionPath::start_frame.
Referenced by ED_objects_recalculate_paths(), and ED_pose_recalculate_paths().
void animviz_free_motionpath | ( | bMotionPath * | mpath | ) |
Definition at line 131 of file anim.c.
References animviz_free_motionpath_cache(), MEM_freeN(), and NULL.
Referenced by ED_objects_clear_paths(), ED_pose_clear_paths(), free_object(), and free_pose_channel().
void animviz_free_motionpath_cache | ( | bMotionPath * | mpath | ) |
Definition at line 113 of file anim.c.
References bMotionPath::length, MEM_freeN(), NULL, and bMotionPath::points.
Referenced by animviz_free_motionpath().
Definition at line 237 of file anim.c.
References ANIMVIZ_RECALC_PATHS, Object::avs, bPose::avs, BLI_addtail(), bPoseChannel::bone, bPose::chanbase, Object::data, ListBase::first, Bone::layer, bArmature::layer, MEM_callocN(), Object::mpath, bPoseChannel::mpath, MPathTarget::mpath, bPoseChannel::next, MPathTarget::ob, MPathTarget::pchan, Object::pose, and bAnimVizSettings::recalc.
Referenced by ED_objects_recalculate_paths(), and ED_pose_recalculate_paths().
void animviz_settings_init | ( | bAnimVizSettings * | avs | ) |
Definition at line 84 of file anim.c.
References bAnimVizSettings::ghost_ac, bAnimVizSettings::ghost_bc, bAnimVizSettings::ghost_ef, bAnimVizSettings::ghost_sf, bAnimVizSettings::ghost_step, MOTIONPATH_VIEW_KFNOS, MOTIONPATH_VIEW_KFRAS, NULL, bAnimVizSettings::path_ac, bAnimVizSettings::path_bc, bAnimVizSettings::path_ef, bAnimVizSettings::path_sf, bAnimVizSettings::path_step, and bAnimVizSettings::path_viewflag.
Referenced by add_only_object(), armature_rebuild_pose(), and do_versions().
bMotionPath* animviz_verify_motionpaths | ( | ReportList * | reports, |
Scene * | scene, | ||
Object * | ob, | ||
bPoseChannel * | pchan | ||
) | [read] |
Definition at line 151 of file anim.c.
References bPose::avs, Object::avs, BKE_reportf(), ELEM, bMotionPath::end_frame, bMotionPath::flag, Object::id, bMotionPath::length, MEM_callocN(), MOTIONPATH_BAKE_HAS_PATHS, MOTIONPATH_BAKE_HEADS, MOTIONPATH_FLAG_BHEAD, Object::mpath, bPoseChannel::mpath, bPoseChannel::name, ID::name, NULL, bAnimVizSettings::path_bakeflag, bAnimVizSettings::path_ef, bAnimVizSettings::path_sf, bMotionPath::points, Object::pose, RPT_ERROR, and bMotionPath::start_frame.
Referenced by object_calculate_paths_exec(), and pose_calculate_paths_exec().
void calc_curvepath | ( | Object * | ob | ) |
Definition at line 466 of file anim.c.
References BevPoint::alfa, Curve::bev, BKE_curve_nurbs(), simple_enum_gen::d, Object::data, Path::data, ListBase::first, free_path(), interp_qt_qtqt(), interp_v3_v3v3(), Path::len, len_v3(), MEM_callocN(), MEM_freeN(), MEM_mallocN(), normalize_qt(), BevList::nr, NULL, OB_CURVE, Curve::path, BevList::poly, pp, PathPoint::quat, BevPoint::quat, BevPoint::radius, PathPoint::radius, Nurb::resolu, SEGMENTSU, sub_v3_v3v3(), Path::totdist, Object::type, PathPoint::vec, BevPoint::vec, PathPoint::weight, and BevPoint::weight.
Referenced by do_makeDispListCurveTypes().
int count_duplilist | ( | Object * | ob | ) |
Definition at line 1626 of file anim.c.
References Object::data, Object::dupend, Object::dupoff, Object::dupon, Object::dupsta, ListBase::first, ParticleSystem::next, OB_DUPLI, OB_DUPLIFRAMES, OB_DUPLIVERTS, OB_MESH, Object::particlesystem, ParticleSystem::totpart, Mesh::totvert, Object::transflag, and Object::type.
Referenced by stats_dupli_object().
static void face_duplilist | ( | ListBase * | lb, |
ID * | id, | ||
Scene * | scene, | ||
Object * | par, | ||
float | par_space_mat[][4], | ||
int | level, | ||
int | animated | ||
) | [static] |
Definition at line 1008 of file anim.c.
References add_v3_v3(), area_quad_v3(), area_tri_v3(), Scene::base, BKE_mesh_end_editmesh(), BKE_mesh_get_editmesh(), CD_MASK_BAREMESH, cent_quad_v3(), cent_tri_v3(), MVert::co, co, copy_m3_m3(), copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), Object::data, Object::dupfacesca, editmesh_get_derived_cage(), ListBase::first, Object::flag, G, get_mesh_orco_verts(), DerivedMesh::getFaceArray, DerivedMesh::getNumFaces, DerivedMesh::getVertArray, Group::gobject, GS, ID_SCE, Object::lay, Base::lay, Scene::lay, Group::layer, madd_v2_v2v2fl(), madd_v3_v3v3fl(), MAX_DUPLI_RECUR, MEM_freeN(), mesh_get_derived_deform(), Mesh::mtface, mul_m3_fl(), mul_m3_m3m3(), mul_m4_m4m3(), mul_m4_v3(), mult_m4_m4m4(), ID::name, new_dupli_object(), GroupObject::next, Base::next, NULL, GroupObject::ob, OB_DONE, OB_DUPLI, OB_DUPLIFACES, OB_DUPLIFACES_SCALE, OB_MBALL, Scene::obedit, Base::object, object_duplilist_recursive(), Object::obmat, DupliObject::orco, Object::parent, Object::parentinv, quat_to_mat3(), DerivedMesh::release, size(), sqrtf, sub_v3_v3v3(), Mesh::totvert, Object::transflag, transform_mesh_orco_verts(), tri_to_quat(), Object::type, DupliObject::uv, MTFace::uv, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and simple_enum_gen::w.
Referenced by object_duplilist_recursive().
Definition at line 1477 of file anim.c.
References G, Object::id, ID::name, ID::next, and strlen().
Referenced by font_duplilist().
static void font_duplilist | ( | ListBase * | lb, |
Scene * | scene, | ||
Object * | par, | ||
int | level, | ||
int | animated | ||
) | [static] |
Definition at line 1500 of file anim.c.
References BKE_text_to_curve(), copy_m4_m4(), copy_v3_v3(), Object::data, Curve::family, find_family_object(), FO_DUPLI, Curve::fsize, G, Object::lay, MAX_DUPLI_RECUR, MEM_freeN(), mul_m4_v3(), new_dupli_object(), NULL, OB_DUPLIVERTS, Object::obmat, Curve::str, strlen(), chartrans::xof, Curve::xof, chartrans::yof, and Curve::yof.
Referenced by object_duplilist_recursive().
static void frames_duplilist | ( | ListBase * | lb, |
Scene * | scene, | ||
Object * | ob, | ||
int | level, | ||
int | animated | ||
) | [static] |
Definition at line 757 of file anim.c.
References Object::adt, ADT_RECALC_ANIM, BKE_animsys_evaluate_animdata(), RenderData::cfra, Object::constraints, copy_m4_m4(), Object::dupend, Object::dupoff, Object::dupon, Object::dupsta, enable_cu_speed, ListBase::first, Object::id, Object::lay, MAX_DUPLI_RECUR, new_dupli_object(), NULL, MPathTarget::ob, OB_DUPLIFRAMES, OB_DUPLINOSPEED, Object::obmat, DupliObject::omat, Object::parent, Scene::r, Object::transflag, and where_is_object_time().
Referenced by object_duplilist_recursive().
void free_object_duplilist | ( | ListBase * | lb | ) |
Definition at line 1610 of file anim.c.
References BLI_freelistN(), copy_m4_m4(), ListBase::last, Object::lay, MEM_freeN(), DupliObject::ob, Object::obmat, DupliObject::omat, DupliObject::origlay, and DupliObject::prev.
Referenced by BKE_ptcache_ids_from_object(), BKE_scene_foreach_display_point(), database_init_objects(), draw_dupli_objects_color(), gpu_update_lamps_shadows(), make_object_duplilist_real(), material_lights(), minmax_object_duplis(), next_object(), peelObjects(), snapObjects(), and view3d_opengl_select().
void free_path | ( | Path * | path | ) |
Definition at line 457 of file anim.c.
References Path::data, and MEM_freeN().
Referenced by ANIM_channel_draw_widgets(), animsys_execute_fcurve(), calc_curvepath(), do_makeDispListCurveTypes(), and free_curve().
static void group_duplilist | ( | ListBase * | lb, |
Scene * | scene, | ||
Object * | ob, | ||
int | level, | ||
int | animated | ||
) | [static] |
Definition at line 703 of file anim.c.
References copy_m4_m4(), Object::dup_group, Group::dupli_ofs, ListBase::first, G, Group::gobject, group_handle_recalc_and_update(), group_is_animated(), Group::id, is_zero_v3(), Object::lay, Group::layer, DupliObject::mat, MAX_DUPLI_RECUR, mult_m4_m4m4(), new_dupli_object(), GroupObject::next, DupliObject::no_draw, NULL, DupliObject::ob, GroupObject::ob, OB_DUPLI, OB_DUPLIGROUP, OB_RESTRICT_RENDER, OB_RESTRICT_VIEW, object_duplilist_recursive(), Object::obmat, DupliObject::omat, DupliObject::origlay, Object::restrictflag, sub_v3_v3v3(), and Object::transflag.
Referenced by object_duplilist_recursive().
int interval_test | ( | int | min, |
int | max, | ||
int | p1, | ||
int | cycl | ||
) |
Definition at line 350 of file anim.c.
References CFRA, bMotionPathVert::co, copy_v3_v3(), bMotionPath::end_frame, ListBase::first, bMotionPath::flag, MOTIONPATH_FLAG_BHEAD, MPathTarget::mpath, mul_m4_v3(), MPathTarget::next, MPathTarget::ob, Object::obmat, MPathTarget::pchan, bMotionPath::points, bPoseChannel::pose_head, bPoseChannel::pose_tail, and bMotionPath::start_frame.
Referenced by animviz_calc_motionpaths().
Definition at line 280 of file anim.c.
References BA_TEMP_TAG, Scene::base, BLI_addhead(), BLI_remlink(), DAG_scene_sort(), ListBase::first, Object::flag, G, MPathTarget::next, Base::next, MPathTarget::ob, and Base::object.
Referenced by animviz_calc_motionpaths().
static void motionpaths_calc_update_scene | ( | Scene * | scene | ) | [static] |
Definition at line 309 of file anim.c.
References BA_TEMP_TAG, Scene::base, DAG_scene_update_flags(), ListBase::first, Object::flag, G, Scene::lay, Base::next, NULL, Base::object, object_handle_update(), scene_update_for_newframe(), and TRUE.
Referenced by animviz_calc_motionpaths().
static DupliObject* new_dupli_object | ( | ListBase * | lb, |
Object * | ob, | ||
float | mat[][4], | ||
int | lay, | ||
int | index, | ||
int | type, | ||
int | animated | ||
) | [static] |
Definition at line 686 of file anim.c.
References DupliObject::animated, BLI_addtail(), copy_m4_m4(), DupliObject::index, Object::lay, DupliObject::mat, MEM_callocN(), DupliObject::ob, MPathTarget::ob, OB_DUPLIGROUP, Object::obmat, DupliObject::omat, DupliObject::origlay, and DupliObject::type.
Referenced by face_duplilist(), font_duplilist(), frames_duplilist(), group_duplilist(), new_particle_duplilist(), and vertex_dupli__mapFunc().
static void new_particle_duplilist | ( | ListBase * | lb, |
ID * | id, | ||
Scene * | scene, | ||
Object * | par, | ||
float | par_space_mat[][4], | ||
ParticleSystem * | psys, | ||
int | level, | ||
int | animated | ||
) | [static] |
Definition at line 1185 of file anim.c.
References add_v3_v3v3(), BKE_curframe(), BLI_rand(), BLI_srandom(), ParticleSystem::child, ParticleSystem::childcache, ParticleKey::co, ParticleCacheKey::co, copy_m4_m4(), copy_v3_v3(), ParticleDupliWeight::count, ParticleSettings::draw, ParticleSettings::draw_as, ParticleSettings::dup_group, ParticleSettings::dup_ob, Group::dupli_ofs, ParticleSettings::dupliweights, ELEM, end_latt_deform(), ListBase::first, ParticleData::flag, ParticleSystem::flag, G, Group::gobject, group_handle_recalc_and_update(), GS, ID_GR, ParticleSystem::imat, Object::imat, invert_m4_m4(), is_zero_v3(), ParticleSystem::lattice, Object::lay, MAX_DUPLI_RECUR, MEM_callocN(), MEM_freeN(), mul_mat3_m4_fl(), mult_m4_m4m4(), ID::name, new_dupli_object(), GroupObject::next, ParticleDupliWeight::next, normalize_qt_qt(), NULL, ParticleSimulationData::ob, GroupObject::ob, ParticleDupliWeight::ob, OB_DUPLIGROUP, OB_DUPLIPARTS, Object::obmat, DupliObject::omat, DupliObject::orco, ChildParticle::parent, PARS_NO_DISP, PARS_UNEXIST, ParticleSystem::part, PART_DRAW_COUNT_GR, PART_DRAW_GLOBAL_OB, PART_DRAW_GR, PART_DRAW_OB, PART_DRAW_PARENT, PART_DRAW_RAND_GR, PART_DRAW_REND, PART_DRAW_ROTATE_OB, PART_DRAW_WHOLE_GR, PART_HAIR, ParticleSystem::particles, ParticleSystem::pathcache, ParticleSimulationData::psmd, ParticleSimulationData::psys, psys_check_enabled(), psys_check_group_weights(), psys_get_child_size(), psys_get_dupli_path_transform(), psys_get_dupli_texture(), psys_get_lattice(), psys_get_modifier(), psys_get_particle_state(), PSYS_HAIR_DONE, quat_to_mat4(), ParticleSettings::ren_as, ParticleSystem::renderdata, ParticleKey::rot, ParticleSimulationData::scene, ParticleSystem::seed, ParticleData::size, size(), state, ParticleCacheKey::steps, sub_v3_v3v3(), ParticleKey::time, ParticleData::time, ParticleSystem::totcached, ParticleSystem::totchild, ParticleSystem::totchildcache, ParticleSystem::totpart, Object::trackflag, ParticleSettings::type, Object::upflag, DupliObject::uv, vec_to_quat(), and where_is_object_time().
Referenced by object_duplilist_recursive().
Definition at line 1602 of file anim.c.
References ListBase::first, ListBase::last, MEM_mallocN(), NULL, and object_duplilist_recursive().
Referenced by BKE_ptcache_ids_from_object(), BKE_scene_foreach_display_point(), database_init_objects(), draw_dupli_objects_color(), gpu_update_lamps_shadows(), make_object_duplilist_real(), material_lights(), minmax_object_duplis(), next_object(), peelObjects(), snapObjects(), and view3d_opengl_select().
static void object_duplilist_recursive | ( | ID * | id, |
Scene * | scene, | ||
Object * | ob, | ||
ListBase * | duplilist, | ||
float | par_space_mat[][4], | ||
int | level, | ||
int | animated | ||
) | [static] |
Definition at line 1548 of file anim.c.
References copy_m4_m4(), face_duplilist(), ListBase::first, font_duplilist(), frames_duplilist(), G, group_duplilist(), GS, ID_SCE, DupliObject::mat, ID::name, new_particle_duplilist(), ParticleSystem::next, DupliObject::next, DupliObject::ob, OB_DUPLI, OB_DUPLIFACES, OB_DUPLIFRAMES, OB_DUPLIGROUP, OB_DUPLIPARTS, OB_DUPLIVERTS, OB_FONT, OB_MESH, OB_RESTRICT_RENDER, OB_RESTRICT_VIEW, Object::obmat, Object::particlesystem, Object::restrictflag, Object::transflag, DupliObject::type, Object::type, and vertex_duplilist().
Referenced by face_duplilist(), group_duplilist(), object_duplilist(), and vertex_dupli__mapFunc().
static void vertex_dupli__mapFunc | ( | void * | userData, |
int | index, | ||
float * | co, | ||
float * | no_f, | ||
short * | no_s | ||
) | [static] |
Definition at line 840 of file anim.c.
References add_v3_v3(), vertexDupliData::animated, copy_m4_m4(), copy_v3_v3(), vertexDupliData::id, Object::lay, vertexDupliData::lb, vertexDupliData::level, mul_m4_m4m3(), mul_v3_m4v3(), new_dupli_object(), vertexDupliData::ob, OB_DUPLI, OB_DUPLIROT, OB_DUPLIVERTS, object_duplilist_recursive(), Object::obmat, vertexDupliData::obmat, vertexDupliData::orco, DupliObject::orco, vertexDupliData::par, vertexDupliData::pmat, quat_to_mat3(), vertexDupliData::scene, sub_v3_v3(), Object::trackflag, Object::transflag, Object::upflag, and vec_to_quat().
Referenced by vertex_duplilist().
static void vertex_duplilist | ( | ListBase * | lb, |
ID * | id, | ||
Scene * | scene, | ||
Object * | par, | ||
float | par_space_mat[][4], | ||
int | level, | ||
int | animated | ||
) | [static] |
Definition at line 888 of file anim.c.
References vertexDupliData::animated, Scene::base, BKE_mesh_end_editmesh(), BKE_mesh_get_editmesh(), CD_MASK_BAREMESH, copy_m4_m4(), Object::data, Mesh::edit_mesh, editmesh_get_derived_cage(), ListBase::first, Object::flag, DerivedMesh::foreachMappedVert, G, get_mesh_orco_verts(), DerivedMesh::getNumVerts, DerivedMesh::getVertCo, DerivedMesh::getVertNo, Group::gobject, GS, vertexDupliData::id, ID_SCE, Object::lay, Base::lay, Scene::lay, Group::layer, vertexDupliData::lb, vertexDupliData::level, MAX_DUPLI_RECUR, MEM_freeN(), mesh_get_derived_deform(), mult_m4_m4m4(), ID::name, GroupObject::next, Base::next, NULL, GroupObject::ob, vertexDupliData::ob, OB_DONE, OB_MBALL, Scene::obedit, Base::object, Object::obmat, vertexDupliData::obmat, vertexDupliData::orco, vertexDupliData::par, Object::parent, vertexDupliData::pmat, DerivedMesh::release, vertexDupliData::scene, Mesh::totvert, transform_mesh_orco_verts(), Object::type, and vertex_dupli__mapFunc().
Referenced by object_duplilist_recursive().
int where_on_path | ( | Object * | ob, |
float | ctime, | ||
float * | vec, | ||
float * | dir, | ||
float * | quat, | ||
float * | radius, | ||
float * | weight | ||
) |
Definition at line 592 of file anim.c.
References Curve::bev, copy_qt_qt(), CU_BEZIER, CU_POLY, Path::data, Object::data, data, ListBase::first, interp_qt_qtqt(), interp_v3_v3v3v3v3(), interval_test(), KEY_BSPLINE, KEY_CARDINAL, key_curve_position_weights(), key_curve_tangent_weights(), KEY_LINEAR, Path::len, negate_v3(), BevList::nr, NULL, Curve::nurb, OB_CURVE, Curve::path, BevList::poly, pp, PathPoint::quat, PathPoint::radius, Nurb::type, Object::type, PathPoint::vec, and PathPoint::weight.
Referenced by BKE_text_to_curve(), clampto_evaluate(), do_guides(), draw_forcefield(), followpath_get_tarmat(), ob_parcurve(), precalculate_effector(), splineik_evaluate_bone(), and where_on_path_deform().