Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_ops.c
| Show First 20 Lines • Show All 788 Lines • ▼ Show 20 Lines | bool UI_context_copy_to_selected_list(bContext *C, | ||||
| } | } | ||||
| else if (RNA_struct_is_a(ptr->type, &RNA_PoseBone)) { | else if (RNA_struct_is_a(ptr->type, &RNA_PoseBone)) { | ||||
| *r_lb = CTX_data_collection_get(C, "selected_pose_bones"); | *r_lb = CTX_data_collection_get(C, "selected_pose_bones"); | ||||
| } | } | ||||
| else if (RNA_struct_is_a(ptr->type, &RNA_Bone)) { | 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)) { | ||||
| /* Special case when we do this for 'Sequence.lock'. | |||||
| * (if the sequence is locked, it wont be in "selected_editable_sequences"). */ | |||||
| const char *prop_id = RNA_property_identifier(prop); | |||||
| if (STREQ(prop_id, "lock")) { | |||||
| *r_lb = CTX_data_collection_get(C, "selected_sequences"); | |||||
| } | |||||
| else { | |||||
| *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) && | else if (RNA_struct_is_a(ptr->type, &RNA_Constraint) && | ||||
| (path_from_bone = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_PoseBone)) != | (path_from_bone = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_PoseBone)) != | ||||
| NULL) { | NULL) { | ||||
| *r_lb = CTX_data_collection_get(C, "selected_pose_bones"); | *r_lb = CTX_data_collection_get(C, "selected_pose_bones"); | ||||
| *r_path = path_from_bone; | *r_path = path_from_bone; | ||||
| ▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | else if (OB_DATA_SUPPORT_ID(GS(id->name))) { | ||||
| *r_lb = lb; | *r_lb = lb; | ||||
| *r_path = path; | *r_path = path; | ||||
| } | } | ||||
| else if (GS(id->name) == ID_SCE) { | else if (GS(id->name) == ID_SCE) { | ||||
| /* Sequencer's ID is scene :/ */ | /* Sequencer's ID is scene :/ */ | ||||
| /* Try to recursively find an RNA_Sequence ancestor, | /* Try to recursively find an RNA_Sequence ancestor, | ||||
| * to handle situations like T41062... */ | * to handle situations like T41062... */ | ||||
| if ((*r_path = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_Sequence)) != NULL) { | if ((*r_path = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_Sequence)) != NULL) { | ||||
| /* Special case when we do this for 'Sequence.lock'. | |||||
| * (if the sequence is locked, it wont be in "selected_editable_sequences"). */ | |||||
| const char *prop_id = RNA_property_identifier(prop); | |||||
| if (STREQ(prop_id, "lock")) { | |||||
| *r_lb = CTX_data_collection_get(C, "selected_sequences"); | |||||
| } | |||||
| else { | |||||
| *r_lb = CTX_data_collection_get(C, "selected_editable_sequences"); | *r_lb = CTX_data_collection_get(C, "selected_editable_sequences"); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| return (*r_path != NULL); | return (*r_path != NULL); | ||||
| } | } | ||||
| else { | else { | ||||
| return false; | return false; | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 917 Lines • Show Last 20 Lines | |||||