Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_ops.c
| Show First 20 Lines • Show All 729 Lines • ▼ Show 20 Lines | bool UI_context_copy_to_selected_list(bContext *C, | ||||
| PointerRNA *ptr, | PointerRNA *ptr, | ||||
| PropertyRNA *prop, | PropertyRNA *prop, | ||||
| ListBase *r_lb, | ListBase *r_lb, | ||||
| bool *r_use_path_from_id, | bool *r_use_path_from_id, | ||||
| char **r_path) | char **r_path) | ||||
| { | { | ||||
| *r_use_path_from_id = false; | *r_use_path_from_id = false; | ||||
| *r_path = NULL; | *r_path = NULL; | ||||
| /* special case for bone constraints */ | |||||
| char *path_from_bone = NULL; | |||||
| /* PropertyGroup objects don't have a reference to the struct that actually owns | /* PropertyGroup objects don't have a reference to the struct that actually owns | ||||
| * them, so it is normally necessary to do a brute force search to find it. This | * them, so it is normally necessary to do a brute force search to find it. This | ||||
| * handles the search for non-ID owners by using the 'active' reference as a hint | * handles the search for non-ID owners by using the 'active' reference as a hint | ||||
| * to preserve efficiency. Only properties defined through RNA are handled, as | * to preserve efficiency. Only properties defined through RNA are handled, as | ||||
| * custom properties cannot be assumed to be valid for all instances. | * custom properties cannot be assumed to be valid for all instances. | ||||
| * | * | ||||
| * Properties owned by the ID are handled by the 'if (ptr->owner_id)' case below. | * Properties owned by the ID are handled by the 'if (ptr->owner_id)' case below. | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | else if (RNA_struct_is_a(ptr->type, &RNA_Bone)) { | ||||
| ui_context_selected_bones_via_pose(C, r_lb); | ui_context_selected_bones_via_pose(C, r_lb); | ||||
| } | } | ||||
| else if (RNA_struct_is_a(ptr->type, &RNA_Sequence)) { | else if (RNA_struct_is_a(ptr->type, &RNA_Sequence)) { | ||||
| *r_lb = CTX_data_collection_get(C, "selected_editable_sequences"); | *r_lb = CTX_data_collection_get(C, "selected_editable_sequences"); | ||||
| } | } | ||||
| else if (RNA_struct_is_a(ptr->type, &RNA_FCurve)) { | else if (RNA_struct_is_a(ptr->type, &RNA_FCurve)) { | ||||
| *r_lb = CTX_data_collection_get(C, "selected_editable_fcurves"); | *r_lb = CTX_data_collection_get(C, "selected_editable_fcurves"); | ||||
| } | } | ||||
| else if (RNA_struct_is_a(ptr->type, &RNA_Constraint) && | |||||
| (path_from_bone = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_PoseBone)) != NULL) { | |||||
| *r_lb = CTX_data_collection_get(C, "selected_pose_bones"); | |||||
| *r_path = path_from_bone; | |||||
| } | |||||
| else if (RNA_struct_is_a(ptr->type, &RNA_Node) || RNA_struct_is_a(ptr->type, &RNA_NodeSocket)) { | else if (RNA_struct_is_a(ptr->type, &RNA_Node) || RNA_struct_is_a(ptr->type, &RNA_NodeSocket)) { | ||||
| ListBase lb = {NULL, NULL}; | ListBase lb = {NULL, NULL}; | ||||
| char *path = NULL; | char *path = NULL; | ||||
| bNode *node = NULL; | bNode *node = NULL; | ||||
| /* Get the node we're editing */ | /* Get the node we're editing */ | ||||
| if (RNA_struct_is_a(ptr->type, &RNA_NodeSocket)) { | if (RNA_struct_is_a(ptr->type, &RNA_NodeSocket)) { | ||||
| bNodeTree *ntree = (bNodeTree *)ptr->owner_id; | bNodeTree *ntree = (bNodeTree *)ptr->owner_id; | ||||
| ▲ Show 20 Lines • Show All 1,016 Lines • Show Last 20 Lines | |||||