Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_eyedropper_driver.c
| Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | static void driverdropper_sample(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| /* Get paths for src... */ | /* Get paths for src... */ | ||||
| PointerRNA *target_ptr = &but->rnapoin; | PointerRNA *target_ptr = &but->rnapoin; | ||||
| PropertyRNA *target_prop = but->rnaprop; | PropertyRNA *target_prop = but->rnaprop; | ||||
| const int target_index = but->rnaindex; | const int target_index = but->rnaindex; | ||||
| char *target_path = RNA_path_from_ID_to_property(target_ptr, target_prop); | char *target_path = RNA_path_from_ID_to_property(target_ptr, target_prop); | ||||
| /* ... and destination */ | /* ... and destination */ | ||||
| char *dst_path = BKE_animdata_driver_path_hack(C, &ddr->ptr, ddr->prop, NULL); | char *dst_path = RNA_path_from_ID_to_property(&ddr->ptr, ddr->prop); | ||||
| /* Now create driver(s) */ | /* Now create driver(s) */ | ||||
| if (target_path && dst_path) { | if (target_path && dst_path) { | ||||
| int success = ANIM_add_driver_with_target(op->reports, | int success = ANIM_add_driver_with_target(op->reports, | ||||
| ddr->ptr.owner_id, | ddr->ptr.owner_id, | ||||
| dst_path, | dst_path, | ||||
| ddr->index, | ddr->index, | ||||
| target_ptr->owner_id, | target_ptr->owner_id, | ||||
| ▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines | |||||