|
Blender V5.0
|
Go to the source code of this file.
Namespaces | |
| namespace | blender |
| namespace | blender::animrig |
Drivers | |
| enum | eCreateDriverFlags { CREATEDRIVER_WITH_DEFAULT_DVAR = (1 << 0) } |
| enum | eCreateDriver_MappingTypes { CREATEDRIVER_MAPPING_1_N = 0 , CREATEDRIVER_MAPPING_1_1 = 1 , CREATEDRIVER_MAPPING_N_N = 2 , CREATEDRIVER_MAPPING_NONE = 3 , CREATEDRIVER_MAPPING_NONE_ALL = 4 } |
| enum | eDriverFCurveCreationMode { DRIVER_FCURVE_LOOKUP_ONLY = 0 , DRIVER_FCURVE_KEYFRAMES = 1 , DRIVER_FCURVE_EMPTY = 3 } |
| const EnumPropertyItem | prop_driver_create_mapping_types [] |
| FCurve * | verify_driver_fcurve (ID *id, const char rna_path[], int array_index, eDriverFCurveCreationMode creation_mode) |
| FCurve * | alloc_driver_fcurve (const char rna_path[], int array_index, eDriverFCurveCreationMode creation_mode) |
| int | ANIM_add_driver_with_target (ReportList *reports, ID *dst_id, const char dst_path[], int dst_index, ID *src_id, const char src_path[], int src_index, short flag, int driver_type, short mapping_type) |
| Main Driver Management API calls. | |
| int | ANIM_add_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short flag, int type) |
| Main Driver Management API calls. | |
| bool | ANIM_remove_driver (ID *id, const char rna_path[], int array_index) |
| Main Driver Management API calls. | |
| void | ANIM_drivers_copybuf_free () |
| void | ANIM_driver_vars_copybuf_free () |
| bool | ANIM_driver_can_paste () |
| bool | ANIM_copy_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short flag) |
| Main Driver Management API calls. | |
| bool | ANIM_paste_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short flag) |
| Main Driver Management API calls. | |
| bool | ANIM_driver_vars_can_paste () |
| bool | ANIM_driver_vars_copy (ReportList *reports, FCurve *fcu) |
| bool | ANIM_driver_vars_paste (ReportList *reports, FCurve *fcu, bool replace) |
| void | ANIM_copy_as_driver (ID *target_id, const char *target_path, const char *var_name) |
Heuristic to use for connecting target properties to driven ones
Definition at line 123 of file ED_keyframing.hh.
| enum eCreateDriverFlags |
Flags for use by driver creation calls
| Enumerator | |
|---|---|
| CREATEDRIVER_WITH_DEFAULT_DVAR | create drivers with a default variable for nicer UI |
Definition at line 117 of file ED_keyframing.hh.
| Enumerator | |
|---|---|
| DRIVER_FCURVE_LOOKUP_ONLY | Don't add anything if not found. |
| DRIVER_FCURVE_KEYFRAMES | Add with keyframes, for visual tweaking. |
| DRIVER_FCURVE_EMPTY | Add without data, for pasting. |
Definition at line 147 of file ED_keyframing.hh.
| FCurve * alloc_driver_fcurve | ( | const char | rna_path[], |
| int | array_index, | ||
| eDriverFCurveCreationMode | creation_mode ) |
Definition at line 92 of file drivers.cc.
References FCurve::array_index, FCurve::auto_smoothing, BKE_fcurve_create(), BKE_fcurve_handles_recalc(), BLI_strdup(), FCurve::driver, DRIVER_FCURVE_EMPTY, DRIVER_FCURVE_LOOKUP_ONLY, ELEM, FCurve::extend, FCURVE_EXTRAPOLATE_LINEAR, FCURVE_SELECTED, FCURVE_VISIBLE, FCurve::flag, blender::animrig::get_keyframe_settings(), blender::animrig::insert_vert_fcurve(), INSERTKEY_FAST, MEM_callocN(), FCurve::rna_path, and U.
Referenced by ANIM_copy_as_driver(), and verify_driver_fcurve().
| int ANIM_add_driver | ( | ReportList * | reports, |
| ID * | id, | ||
| const char | rna_path[], | ||
| int | array_index, | ||
| short | flag, | ||
| int | type ) |
Main Driver Management API calls.
Add a new driver for the specified property on the given ID block
| flag | is of type eCreateDriverFlags. Passing the flag as 0 is also an option which will create a driver without a variable. |
Definition at line 383 of file drivers.cc.
References BKE_reportf(), BLI_snprintf_utf8(), BLI_str_rstrip_float_zero(), BLI_strncpy_utf8(), CREATEDRIVER_WITH_DEFAULT_DVAR, FCurve::driver, driver_add_new_variable(), driver_change_variable_type(), DRIVER_FCURVE_KEYFRAMES, DRIVER_TYPE_PYTHON, DVAR_TYPE_TRANSFORM_CHAN, ChannelDriver::expression, flag, ID::name, PROP_BOOLEAN, PROP_FLOAT, PROP_INT, ptr, RNA_id_pointer_create(), RNA_path_resolve_property(), RNA_property_array_length(), RNA_property_boolean_get(), RNA_property_boolean_get_index(), RNA_property_float_get(), RNA_property_float_get_index(), RNA_property_int_get(), RNA_property_int_get_index(), RNA_property_type(), RPT_ERROR, ChannelDriver::type, and verify_driver_fcurve().
Referenced by add_driver_button_invoke(), add_driver_button_none(), ANIM_add_driver_with_target(), blender::ed::outliner::do_outliner_drivers_editop(), pyrna_struct_driver_add(), and blender::interface::tests::CopyDriversToSelected::SetUp().
| int ANIM_add_driver_with_target | ( | ReportList * | reports, |
| ID * | dst_id, | ||
| const char | dst_path[], | ||
| int | dst_index, | ||
| ID * | src_id, | ||
| const char | src_path[], | ||
| int | src_index, | ||
| short | flag, | ||
| int | driver_type, | ||
| short | mapping_type ) |
Main Driver Management API calls.
Add a new driver for the specified property on the given ID block, and make it be driven by the specified target.
This is intended to be used in conjunction with a modal "eyedropper" for picking the variable that is going to be used to drive this one.
| flag | eCreateDriverFlags |
| driver_type | eDriver_Types |
| mapping_type | eCreateDriver_MappingTypes |
Definition at line 272 of file drivers.cc.
References add_driver_with_target(), ANIM_add_driver(), BKE_reportf(), CREATEDRIVER_MAPPING_1_1, CREATEDRIVER_MAPPING_1_N, CREATEDRIVER_MAPPING_N_N, CREATEDRIVER_MAPPING_NONE, CREATEDRIVER_WITH_DEFAULT_DVAR, flag, i, len, ID::name, ptr, RNA_id_pointer_create(), RNA_path_resolve_property(), RNA_property_array_check(), RNA_property_array_length(), and RPT_ERROR.
Referenced by driverdropper_sample().
| void ANIM_copy_as_driver | ( | ID * | target_id, |
| const char * | target_path, | ||
| const char * | var_name ) |
Create a driver & variable that reads the specified property, and store it in the buffers for Paste Driver and Paste Variables.
Definition at line 767 of file drivers.cc.
References alloc_driver_fcurve(), ANIM_driver_vars_copybuf_free(), ANIM_drivers_copybuf_free(), BLI_strdup(), channeldriver_copypaste_buf, FCurve::driver, driver_add_new_variable(), DRIVER_FCURVE_KEYFRAMES, driver_variables_copy(), driver_vars_copybuf, ChannelDriver::expression, GS, i, DriverTarget::id, DriverTarget::idtype, DriverVar::name, ID::name, DriverTarget::rna_path, STRNCPY_UTF8, DriverVar::targets, and ChannelDriver::variables.
Referenced by copy_as_driver_button_exec().
| bool ANIM_copy_driver | ( | ReportList * | reports, |
| ID * | id, | ||
| const char | rna_path[], | ||
| int | array_index, | ||
| short | flag ) |
Main Driver Management API calls.
Make a copy of the driver for the specified property on the given ID block.
Definition at line 562 of file drivers.cc.
References ANIM_drivers_copybuf_free(), BKE_fcurve_copy(), BKE_reportf(), channeldriver_copypaste_buf, FCurve::driver, DRIVER_FCURVE_LOOKUP_ONLY, ID::name, ptr, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve_property(), RPT_ERROR, and verify_driver_fcurve().
Referenced by copy_driver_button_exec().
| bool ANIM_driver_can_paste | ( | ) |
Returns whether there is a driver in the copy/paste buffer to paste.
Definition at line 555 of file drivers.cc.
References channeldriver_copypaste_buf.
Referenced by ui_popup_context_menu_for_button().
| bool ANIM_driver_vars_can_paste | ( | ) |
Checks if there are driver variables in the copy/paste buffer.
Definition at line 683 of file drivers.cc.
References BLI_listbase_is_empty(), and driver_vars_copybuf.
| bool ANIM_driver_vars_copy | ( | ReportList * | reports, |
| FCurve * | fcu ) |
Copy the given driver's variables to the buffer.
Definition at line 690 of file drivers.cc.
References ANIM_driver_vars_copybuf_free(), BKE_report(), BLI_listbase_is_empty(), FCurve::driver, driver_variables_copy(), driver_vars_copybuf, ELEM, RPT_ERROR, and ChannelDriver::variables.
Referenced by graph_driver_vars_copy_exec().
| void ANIM_driver_vars_copybuf_free | ( | ) |
Clear copy-paste buffer for driver variable sets.
Definition at line 667 of file drivers.cc.
References BLI_listbase_clear(), driver_free_variable(), driver_vars_copybuf, and DriverVar::next.
Referenced by ANIM_copy_as_driver(), ANIM_driver_vars_copy(), and WM_exit_ex().
| bool ANIM_driver_vars_paste | ( | ReportList * | reports, |
| FCurve * | fcu, | ||
| bool | replace ) |
Paste the variables in the buffer to the given FCurve.
Definition at line 712 of file drivers.cc.
References BKE_driver_invalidate_expression(), BKE_report(), BLI_listbase_clear(), BLI_listbase_is_empty(), FCurve::driver, driver_free_variable_ex(), driver_variables_copy(), driver_vars_copybuf, ELEM, ListBase::first, ListBase::last, DriverVar::next, DriverVar::prev, RPT_ERROR, and ChannelDriver::variables.
Referenced by graph_driver_vars_paste_exec().
| void ANIM_drivers_copybuf_free | ( | ) |
Clear copy-paste buffer for drivers.
Definition at line 546 of file drivers.cc.
References BKE_fcurve_free(), and channeldriver_copypaste_buf.
Referenced by ANIM_copy_as_driver(), ANIM_copy_driver(), and WM_exit_ex().
| const EnumPropertyItem * ANIM_keying_sets_enum_itemf | ( | bContext * | C, |
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| bool * | r_free ) |
Dynamically populate an enum of Keying Sets.
Definition at line 658 of file editors/animation/keyingsets.cc.
References Scene::active_keyingset, build_keyingset_enum(), C, CTX_data_scene(), rna_enum_dummy_DEFAULT_items, RNA_enum_item_add(), and RNA_enum_item_add_separator().
Referenced by ANIM_OT_keyframe_delete(), ANIM_OT_keyframe_insert(), and ANIM_OT_keyframe_insert_menu().
Check if KeyingSet can be used in the current context.
Definition at line 717 of file editors/animation/keyingsets.cc.
References C, KeyingSet::flag, KEYINGSET_ABSOLUTE, blender::animrig::keyingset_info_find_name(), KeyingSetInfo::poll, and KeyingSet::typeinfo.
Referenced by anim_keyingset_visit_for_search_impl(), and build_keyingset_enum().
Get the keying set from enum values generated in ANIM_keying_sets_enum_itemf.
Type is the Keying Set the user specified to use when calling the operator:
| type |
Definition at line 688 of file editors/animation/keyingsets.cc.
References Scene::active_keyingset, BLI_findlink(), builtin_keyingsets, and Scene::keyingsets.
Referenced by insert_key_exec(), and keyingset_get_from_op_with_error().
Definition at line 701 of file editors/animation/keyingsets.cc.
References BLI_findstring(), builtin_keyingsets, Scene::keyingsets, and offsetof.
Referenced by keyingset_get_from_op_with_error().
| void ANIM_keyingset_visit_for_search | ( | const bContext * | C, |
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| const char * | edit_text, | ||
| blender::FunctionRef< void(StringPropertySearchVisitParams)> | visit_fn ) |
Definition at line 636 of file editors/animation/keyingsets.cc.
References anim_keyingset_visit_for_search_impl(), and C.
| void ANIM_keyingset_visit_for_search_no_poll | ( | const bContext * | C, |
| PointerRNA * | ptr, | ||
| PropertyRNA * | prop, | ||
| const char * | edit_text, | ||
| blender::FunctionRef< void(StringPropertySearchVisitParams)> | visit_fn ) |
Definition at line 646 of file editors/animation/keyingsets.cc.
References anim_keyingset_visit_for_search_impl(), and C.
Referenced by ANIM_OT_keyframe_delete_by_name(), and ANIM_OT_keyframe_insert_by_name().
| bool ANIM_paste_driver | ( | ReportList * | reports, |
| ID * | id, | ||
| const char | rna_path[], | ||
| int | array_index, | ||
| short | flag ) |
Main Driver Management API calls.
Add a new driver for the specified property on the given ID block or replace an existing one with the driver + driver-curve data from the buffer.
Definition at line 610 of file drivers.cc.
References FCurve::bezt, BKE_report(), BKE_reportf(), channeldriver_copypaste_buf, copy_fmodifiers(), FCurve::driver, DRIVER_FCURVE_EMPTY, FCurve::extend, fcurve_copy_driver(), FCurve::fpt, MEM_dupallocN(), FCurve::modifiers, ID::name, ptr, RNA_id_pointer_create(), RNA_path_resolve_property(), RPT_ERROR, FCurve::totvert, and verify_driver_fcurve().
Referenced by paste_driver_button_exec().
| bool ANIM_remove_driver | ( | ID * | id, |
| const char | rna_path[], | ||
| int | array_index ) |
Main Driver Management API calls.
Remove the driver for the specified property on the given ID block.
Definition at line 505 of file drivers.cc.
References BKE_animdata_from_id(), BKE_fcurve_free(), BKE_fcurve_iter_step(), BLI_remlink(), DRIVER_FCURVE_LOOKUP_ONLY, AnimData::drivers, ListBase::first, FCurve::next, and verify_driver_fcurve().
Referenced by blender::ed::outliner::do_outliner_drivers_editop(), graph_driver_delete_invalid_exec(), pyrna_struct_driver_remove(), and remove_driver_button_exec().
Get the index of the Keying Set provided, for the given Scene.
Definition at line 560 of file editors/animation/keyingsets.cc.
References BLI_findindex(), builtin_keyingsets, and Scene::keyingsets.
| void ED_keyframes_add | ( | FCurve * | fcu, |
| int | num_keys_to_add ) |
Add the given number of keyframes to the FCurve. Their coordinates are uninitialized, so the curve should not be used without further attention.
The newly created keys are selected, existing keys are not touched.
This can be used to allocate all the keys at once, and then update them afterwards.
Definition at line 121 of file editors/animation/keyframing.cc.
References FCurve::bezt, BEZT_IPO_BEZ, BLI_assert_msg, BezTriple::f1, BezTriple::f2, BezTriple::f3, BezTriple::h1, BezTriple::h2, HD_AUTO_ANIM, BezTriple::ipo, MEM_recallocN, SELECT, and FCurve::totvert.
Referenced by blender::bke::tests::testcurve_with_duplicates().
| bool fcurve_is_changed | ( | PointerRNA | ptr, |
| PropertyRNA * | prop, | ||
| FCurve * | fcu, | ||
| const AnimationEvalContext * | anim_eval_context ) |
Lesser Keyframe Checking API call.
Definition at line 1638 of file editors/animation/keyframing.cc.
References FCurve::array_index, calculate_fcurve(), compare_ff_relative(), blender::animrig::get_rna_values(), PathResolvedRNA::prop, PathResolvedRNA::prop_index, PathResolvedRNA::ptr, ptr, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by ui_but_anim_flag().
| void update_autoflags_fcurve | ( | FCurve * | fcu, |
| bContext * | C, | ||
| ReportList * | reports, | ||
| PointerRNA * | ptr ) |
Lesser Key-framing API call.
Update integer/discrete flags of the FCurve (used when creating/inserting keyframes, but also through RNA when editing an ID prop, see #37103).
Definition at line 85 of file editors/animation/keyframing.cc.
References BKE_report(), BKE_reportf(), C, FCurve::flag, NA_EDITED, NC_ANIMATION, ND_KEYFRAME, ptr, FCurve::rna_path, RNA_path_resolve_property(), RNA_property_type(), RPT_, RPT_ERROR, blender::animrig::update_autoflags_fcurve_direct(), and WM_event_add_notifier().
| FCurve * verify_driver_fcurve | ( | ID * | id, |
| const char | rna_path[], | ||
| int | array_index, | ||
| eDriverFCurveCreationMode | creation_mode ) |
Get (or add relevant data to be able to do so) F-Curve from the driver stack, for the given Animation Data block. This assumes that all the destinations are valid.
Definition at line 51 of file drivers.cc.
References alloc_driver_fcurve(), BKE_animdata_ensure_id(), BKE_animdata_from_id(), BKE_fcurve_find(), BLI_addtail(), DRIVER_FCURVE_LOOKUP_ONLY, AnimData::drivers, and ELEM.
Referenced by add_driver_with_target(), ANIM_add_driver(), ANIM_copy_driver(), ANIM_paste_driver(), ANIM_remove_driver(), and ui_but_anim_expression_create().
|
extern |
Mapping Types enum for operators.
Definition at line 810 of file drivers.cc.
Referenced by ANIM_OT_driver_button_add_menu(), driver_mapping_type_itemf(), and UI_OT_eyedropper_driver().