Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/fcurve.c
| Show First 20 Lines • Show All 406 Lines • ▼ Show 20 Lines | FCurve *BKE_fcurve_find_by_rna_context_ui(bContext *C, | ||||
| if (prop && tptr.owner_id && RNA_property_animateable(&tptr, prop)) { | if (prop && tptr.owner_id && RNA_property_animateable(&tptr, prop)) { | ||||
| AnimData *adt = BKE_animdata_from_id(tptr.owner_id); | AnimData *adt = BKE_animdata_from_id(tptr.owner_id); | ||||
| int step = ( | int step = ( | ||||
| /* Always 1 in case we have no context (can't check in 'ancestors' of given RNA ptr). */ | /* Always 1 in case we have no context (can't check in 'ancestors' of given RNA ptr). */ | ||||
| C ? 2 : 1); | C ? 2 : 1); | ||||
| char *path = NULL; | char *path = NULL; | ||||
| if (!adt && C) { | if (!adt && C) { | ||||
| path = BKE_animdata_driver_path_hack(C, &tptr, prop, NULL); | path = RNA_path_from_ID_to_property(&tptr, prop); | ||||
| adt = BKE_animdata_from_id(tptr.owner_id); | adt = BKE_animdata_from_id(tptr.owner_id); | ||||
| step--; | step--; | ||||
| } | } | ||||
| /* Standard F-Curve - Animation (Action) or Drivers. */ | /* Standard F-Curve - Animation (Action) or Drivers. */ | ||||
| while (adt && step--) { | while (adt && step--) { | ||||
| if ((adt->action == NULL || adt->action->curves.first == NULL) && | if ((adt->action == NULL || adt->action->curves.first == NULL) && | ||||
| (adt->drivers.first == NULL)) { | (adt->drivers.first == NULL)) { | ||||
| Show All 34 Lines | while (adt && step--) { | ||||
| if (r_animdata) { | if (r_animdata) { | ||||
| *r_animdata = adt; | *r_animdata = adt; | ||||
| } | } | ||||
| *r_action = adt->action; | *r_action = adt->action; | ||||
| break; | break; | ||||
| } | } | ||||
| if (step) { | if (step) { | ||||
| char *tpath = BKE_animdata_driver_path_hack(C, &tptr, prop, path); | char *tpath = path ? path : RNA_path_from_ID_to_property(&tptr, prop); | ||||
| if (tpath && tpath != path) { | if (tpath && tpath != path) { | ||||
| MEM_freeN(path); | MEM_freeN(path); | ||||
| path = tpath; | path = tpath; | ||||
| adt = BKE_animdata_from_id(tptr.owner_id); | adt = BKE_animdata_from_id(tptr.owner_id); | ||||
| } | } | ||||
| else { | else { | ||||
| adt = NULL; | adt = NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,966 Lines • Show Last 20 Lines | |||||