Blender V2.61 - r43446
|
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_editVert.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_action.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_deform.h"
#include "RNA_define.h"
#include "RNA_access.h"
#include "RNA_enum_types.h"
#include "ED_curve.h"
#include "ED_mesh.h"
#include "ED_screen.h"
#include "WM_types.h"
#include "WM_api.h"
#include "UI_resources.h"
#include "object_intern.h"
Go to the source code of this file.
Definition in file object_hook.c.
static void add_hook_object | ( | Main * | bmain, |
Scene * | scene, | ||
Object * | obedit, | ||
Object * | ob, | ||
int | mode | ||
) | [static] |
Definition at line 425 of file object_hook.c.
References add_hook_object_new(), BLI_insertlinkbefore(), BLI_snprintf(), BLI_strncpy(), copy_v3_v3(), DAG_scene_sort(), eModifierType_Hook, eModifierTypeType_OnlyDeform, ListBase::first, Object::id, Object::imat, invert_m4_m4(), Object::loc, MAX_NAME, HookModifierData::modifier, modifier_new(), modifier_unique_name(), Object::modifiers, modifierType_getInfo(), mul_serie_m4(), mul_v3_m4v3(), ID::name, ModifierData::name, Object::name, ModifierData::next, NULL, OBJECT_ADDHOOK_NEWOB, object_hook_index_array(), Object::obmat, ModifierTypeInfo::type, ModifierData::type, and where_is_object().
Referenced by object_add_hook_newob_exec(), and object_add_hook_selob_exec().
Definition at line 407 of file object_hook.c.
References add_object(), Scene::basact, Object::lay, Base::lay, OB_EMPTY, and object_in_scene().
Referenced by add_hook_object().
static EnumPropertyItem* hook_mod_itemf | ( | bContext * | C, |
PointerRNA * | UNUSEDptr, | ||
PropertyRNA * | UNUSEDprop, | ||
int * | free | ||
) | [static] |
Definition at line 569 of file object_hook.c.
References CTX_data_edit_object(), DummyRNA_NULL_items, eModifierType_Hook, ListBase::first, EnumPropertyItem::icon, EnumPropertyItem::identifier, Object::modifiers, EnumPropertyItem::name, ModifierData::name, ModifierData::next, NULL, RNA_enum_item_add(), RNA_enum_item_end(), ModifierData::type, and EnumPropertyItem::value.
Referenced by OBJECT_OT_hook_assign(), OBJECT_OT_hook_recenter(), OBJECT_OT_hook_remove(), OBJECT_OT_hook_reset(), and OBJECT_OT_hook_select().
static int hook_op_edit_poll | ( | bContext * | C | ) | [static] |
Definition at line 393 of file object_hook.c.
References CTX_data_edit_object(), ED_operator_editlattice(), ED_operator_editmesh(), and ED_operator_editsurfcurve().
Referenced by OBJECT_OT_hook_add_newobj(), OBJECT_OT_hook_add_selobj(), OBJECT_OT_hook_assign(), OBJECT_OT_hook_recenter(), OBJECT_OT_hook_remove(), OBJECT_OT_hook_reset(), and OBJECT_OT_hook_select().
static int object_add_hook_newob_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 516 of file object_hook.c.
References add_hook_object(), CTX_data_edit_object(), CTX_data_main(), CTX_data_scene(), NC_OBJECT, NC_SCENE, ND_MODIFIER, ND_OB_SELECT, NULL, OBJECT_ADDHOOK_NEWOB, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by OBJECT_OT_hook_add_newobj().
static int object_add_hook_selob_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 474 of file object_hook.c.
References add_hook_object(), BKE_report(), CTX_DATA_BEGIN, CTX_data_edit_object(), CTX_DATA_END, CTX_data_main(), CTX_data_scene(), NC_OBJECT, ND_MODIFIER, NULL, OBJECT_ADDHOOK_SELOB, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, and WM_event_add_notifier().
Referenced by OBJECT_OT_hook_add_selobj().
static int object_hook_assign_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 743 of file object_hook.c.
References BKE_report(), BLI_findlink(), HookModifierData::cent, copy_v3_v3(), CTX_data_edit_object(), CTX_data_pointer_get_type(), CTX_data_scene(), DAG_id_tag_update(), PointerRNA::data, Object::id, PointerRNA::id, HookModifierData::indexar, MAX_NAME, MEM_freeN(), Object::modifiers, Object::name, NC_OBJECT, ND_MODIFIER, NULL, OB_RECALC_DATA, object_hook_index_array(), OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RNA_HookModifier, RPT_ERROR, RPT_WARNING, HookModifierData::totindex, and WM_event_add_notifier().
Referenced by OBJECT_OT_hook_assign().
static int object_hook_index_array | ( | Scene * | scene, |
Object * | obedit, | ||
int * | tot, | ||
int ** | indexar, | ||
char * | name, | ||
float * | cent_r | ||
) | [static] |
Definition at line 293 of file object_hook.c.
References BKE_mesh_end_editmesh(), BKE_mesh_get_editmesh(), Object::data, Lattice::editlatt, EditLatt::latt, load_editMesh(), make_editMesh(), NULL, OB_CURVE, OB_LATTICE, OB_MESH, OB_SURF, return_editcurve_indexar(), return_editlattice_indexar(), return_editmesh_indexar(), return_editmesh_vgroup(), and Object::type.
Referenced by add_hook_object(), and object_hook_assign_exec().
static int object_hook_recenter_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 687 of file object_hook.c.
References BKE_report(), BLI_findlink(), HookModifierData::cent, copy_m3_m4(), CTX_data_edit_object(), CTX_data_pointer_get_type(), CTX_data_scene(), Scene::cursor, DAG_id_tag_update(), PointerRNA::data, Object::id, PointerRNA::id, Object::imat, invert_m3_m3(), Object::modifiers, mul_m3_v3(), NC_OBJECT, ND_MODIFIER, NULL, OB_RECALC_DATA, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RNA_HookModifier, RPT_ERROR, sub_v3_v3v3(), and WM_event_add_notifier().
Referenced by OBJECT_OT_hook_recenter().
static int object_hook_remove_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 544 of file object_hook.c.
References BKE_report(), BLI_findlink(), BLI_remlink(), CTX_data_edit_object(), DAG_id_tag_update(), Object::id, modifier_free(), Object::modifiers, NC_OBJECT, ND_MODIFIER, NULL, OB_RECALC_DATA, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RPT_ERROR, and WM_event_add_notifier().
Referenced by OBJECT_OT_hook_remove().
static int object_hook_reset_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 621 of file object_hook.c.
References BKE_report(), BLI_findlink(), CTX_data_edit_object(), CTX_data_pointer_get_type(), DAG_id_tag_update(), PointerRNA::data, get_pose_channel(), Object::id, PointerRNA::id, Object::imat, invert_m4_m4(), Object::mat, Object::modifiers, mul_serie_m4(), mult_m4_m4m4(), NC_OBJECT, ND_MODIFIER, NULL, OB_RECALC_DATA, HookModifierData::object, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, HookModifierData::parentinv, Object::pose, bPoseChannel::pose_mat, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RNA_HookModifier, RPT_ERROR, HookModifierData::subtarget, and WM_event_add_notifier().
Referenced by OBJECT_OT_hook_reset().
static void object_hook_select | ( | Object * | ob, |
HookModifierData * | hmd | ||
) | [static] |
Definition at line 380 of file object_hook.c.
References HookModifierData::indexar, NULL, OB_CURVE, OB_LATTICE, OB_MESH, OB_SURF, select_editcurve_hook(), select_editlattice_hook(), select_editmesh_hook(), and Object::type.
Referenced by object_hook_select_exec().
static int object_hook_select_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 808 of file object_hook.c.
References BKE_report(), BLI_findlink(), CTX_data_edit_object(), CTX_data_pointer_get_type(), Object::data, PointerRNA::data, PointerRNA::id, Object::modifiers, NC_GEOM, ND_SELECT, NULL, object_hook_select(), OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RNA_HookModifier, RPT_ERROR, and WM_event_add_notifier().
Referenced by OBJECT_OT_hook_select().
void OBJECT_OT_hook_add_newobj | ( | wmOperatorType * | ot | ) |
Definition at line 529 of file object_hook.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, hook_op_edit_poll(), wmOperatorType::idname, wmOperatorType::name, object_add_hook_newob_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, and wmOperatorType::poll.
Referenced by ED_operatortypes_object().
void OBJECT_OT_hook_add_selobj | ( | wmOperatorType * | ot | ) |
Definition at line 501 of file object_hook.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, hook_op_edit_poll(), wmOperatorType::idname, wmOperatorType::name, object_add_hook_selob_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, and wmOperatorType::poll.
Referenced by ED_operatortypes_object().
void OBJECT_OT_hook_assign | ( | wmOperatorType * | ot | ) |
Definition at line 785 of file object_hook.c.
References wmOperatorType::description, DummyRNA_NULL_items, wmOperatorType::exec, wmOperatorType::flag, hook_mod_itemf(), hook_op_edit_poll(), wmOperatorType::idname, wmOperatorType::name, object_hook_assign_exec(), OPTYPE_UNDO, wmOperatorType::poll, Object::prop, RNA_def_enum(), RNA_def_enum_funcs(), and wmOperatorType::srna.
Referenced by ED_operatortypes_object().
void OBJECT_OT_hook_recenter | ( | wmOperatorType * | ot | ) |
Definition at line 722 of file object_hook.c.
References wmOperatorType::description, DummyRNA_NULL_items, wmOperatorType::exec, wmOperatorType::flag, hook_mod_itemf(), hook_op_edit_poll(), wmOperatorType::idname, wmOperatorType::name, object_hook_recenter_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, Object::prop, RNA_def_enum(), RNA_def_enum_funcs(), and wmOperatorType::srna.
Referenced by ED_operatortypes_object().
void OBJECT_OT_hook_remove | ( | wmOperatorType * | ot | ) |
Definition at line 596 of file object_hook.c.
References wmOperatorType::description, DummyRNA_NULL_items, wmOperatorType::exec, wmOperatorType::flag, hook_mod_itemf(), hook_op_edit_poll(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, object_hook_remove_exec(), OPTYPE_UNDO, wmOperatorType::poll, wmOperatorType::prop, Object::prop, RNA_def_enum(), RNA_def_enum_funcs(), wmOperatorType::srna, and WM_menu_invoke().
Referenced by ED_operatortypes_object().
void OBJECT_OT_hook_reset | ( | wmOperatorType * | ot | ) |
Definition at line 666 of file object_hook.c.
References wmOperatorType::description, DummyRNA_NULL_items, wmOperatorType::exec, wmOperatorType::flag, hook_mod_itemf(), hook_op_edit_poll(), wmOperatorType::idname, wmOperatorType::name, object_hook_reset_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, Object::prop, RNA_def_enum(), RNA_def_enum_funcs(), and wmOperatorType::srna.
Referenced by ED_operatortypes_object().
void OBJECT_OT_hook_select | ( | wmOperatorType * | ot | ) |
Definition at line 836 of file object_hook.c.
References wmOperatorType::description, DummyRNA_NULL_items, wmOperatorType::exec, wmOperatorType::flag, hook_mod_itemf(), hook_op_edit_poll(), wmOperatorType::idname, wmOperatorType::name, object_hook_select_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, Object::prop, RNA_def_enum(), RNA_def_enum_funcs(), and wmOperatorType::srna.
Referenced by ED_operatortypes_object().
static int return_editcurve_indexar | ( | Object * | obedit, |
int * | tot, | ||
int ** | indexar, | ||
float * | cent | ||
) | [static] |
Definition at line 216 of file object_hook.c.
References add_v3_v3(), Nurb::bezt, Nurb::bp, CU_BEZIER, BezTriple::f1, BPoint::f1, BezTriple::f2, BezTriple::f3, ListBase::first, Object::index, MEM_mallocN(), mul_v3_fl(), Nurb::next, object_editcurve_get(), Nurb::pntsu, Nurb::pntsv, SELECT, Nurb::type, BezTriple::vec, and BPoint::vec.
Referenced by object_hook_index_array().
static int return_editlattice_indexar | ( | Lattice * | editlatt, |
int * | tot, | ||
int ** | indexar, | ||
float * | cent | ||
) | [static] |
Definition at line 156 of file object_hook.c.
References add_v3_v3(), Lattice::def, BPoint::f1, BPoint::hide, Object::index, MEM_mallocN(), mul_v3_fl(), Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, SELECT, and BPoint::vec.
Referenced by object_hook_index_array().
static int return_editmesh_indexar | ( | EditMesh * | em, |
int * | tot, | ||
int ** | indexar, | ||
float * | cent | ||
) | [static] |
Definition at line 74 of file object_hook.c.
References add_v3_v3(), EditVert::co, EditVert::f, ListBase::first, Object::index, MEM_mallocN(), mul_v3_fl(), EditVert::next, SELECT, EditMesh::verts, and zero_v3().
Referenced by object_hook_index_array().
static int return_editmesh_vgroup | ( | Object * | obedit, |
EditMesh * | em, | ||
char * | name, | ||
float * | cent | ||
) | [static] |
Definition at line 102 of file object_hook.c.
References Object::actdef, add_v3_v3(), BLI_findlink(), BLI_strncpy(), CD_MDEFORMVERT, EditVert::co, CustomData_em_get(), EditVert::data, Object::defbase, defvert_find_weight(), ListBase::first, mul_v3_fl(), bDeformGroup::name, EditVert::next, EditMesh::vdata, EditMesh::verts, and zero_v3().
Referenced by object_hook_index_array().
static void select_editcurve_hook | ( | Object * | obedit, |
HookModifierData * | hmd | ||
) | [static] |
Definition at line 333 of file object_hook.c.
References Nurb::bezt, Nurb::bp, CU_BEZIER, BezTriple::f1, BPoint::f1, BezTriple::f2, BezTriple::f3, ListBase::first, Object::index, HookModifierData::indexar, Nurb::next, object_editcurve_get(), Nurb::pntsu, Nurb::pntsv, SELECT, totindex, and Nurb::type.
Referenced by object_hook_select().
static void select_editlattice_hook | ( | Object * | obedit, |
HookModifierData * | hmd | ||
) | [static] |
Definition at line 196 of file object_hook.c.
References Object::data, Lattice::editlatt, BPoint::f1, Object::index, HookModifierData::indexar, EditLatt::latt, Lattice::pntsu, SELECT, and totindex.
Referenced by object_hook_select().
static void select_editmesh_hook | ( | Object * | ob, |
HookModifierData * | hmd | ||
) | [static] |
Definition at line 135 of file object_hook.c.
References BKE_mesh_end_editmesh(), BKE_mesh_get_editmesh(), Object::data, EM_select_flush(), EditVert::f, ListBase::first, Object::index, HookModifierData::indexar, EditVert::next, NULL, SELECT, totindex, and EditMesh::verts.
Referenced by object_hook_select().