Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_operators.c
| Show First 20 Lines • Show All 437 Lines • ▼ Show 20 Lines | # define TEST_PTR_DATA_TYPE(member, rna_type, rna_ptr, dataptr_cmp) \ | ||||
| member_id = ctx_member; \ | member_id = ctx_member; \ | ||||
| break; \ | break; \ | ||||
| } \ | } \ | ||||
| } \ | } \ | ||||
| (void)0 | (void)0 | ||||
| switch (GS(ptr->owner_id->name)) { | switch (GS(ptr->owner_id->name)) { | ||||
| case ID_SCE: { | case ID_SCE: { | ||||
| if (RNA_struct_is_a(ptr->type, &RNA_Sequence)) { | |||||
| member_id = "active_sequence_strip"; | |||||
| break; | |||||
| } | |||||
| CTX_TEST_PTR_ID(C, "scene", ptr->owner_id); | CTX_TEST_PTR_ID(C, "scene", ptr->owner_id); | ||||
| break; | break; | ||||
| } | } | ||||
| case ID_OB: { | case ID_OB: { | ||||
| CTX_TEST_PTR_ID(C, "object", ptr->owner_id); | CTX_TEST_PTR_ID(C, "object", ptr->owner_id); | ||||
| break; | break; | ||||
| } | } | ||||
| /* from rna_Main_objects_new */ | /* from rna_Main_objects_new */ | ||||
| ▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
| static char *wm_prop_pystring_from_context(bContext *C, | static char *wm_prop_pystring_from_context(bContext *C, | ||||
| PointerRNA *ptr, | PointerRNA *ptr, | ||||
| PropertyRNA *prop, | PropertyRNA *prop, | ||||
| int index) | int index) | ||||
| { | { | ||||
| const char *member_id = wm_context_member_from_ptr(C, ptr); | const char *member_id = wm_context_member_from_ptr(C, ptr); | ||||
| char *ret = NULL; | char *ret = NULL; | ||||
| if (member_id != NULL) { | if (member_id != NULL) { | ||||
| char *prop_str = RNA_path_struct_property_py(ptr, prop, index); | char *prop_str = NULL; | ||||
| if (RNA_struct_is_a(ptr->type, &RNA_Sequence)) { | |||||
| prop_str = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_Sequence); | |||||
| } | |||||
| else { | |||||
| prop_str = RNA_path_struct_property_py(ptr, prop, index); | |||||
| } | |||||
| if (prop_str) { | if (prop_str) { | ||||
campbellbarton: This block should be handled in `wm_context_member_from_ptr` (all other type spesific checks… | |||||
Not Done Inline ActionsNot sure how that would work (might have to have another look on Monday)? we need to go from Without extra path massage, we might be able to look up the context member correctly, but end up with something like Writing this from mobile, will check again on Monday. lichtwerk: Not sure how that would work (might have to have another look on Monday)?
But iirc, none of the… | |||||
| ret = BLI_sprintfN("bpy.context.%s.%s", member_id, prop_str); | ret = BLI_sprintfN("bpy.context.%s.%s", member_id, prop_str); | ||||
| MEM_freeN(prop_str); | MEM_freeN(prop_str); | ||||
| } | } | ||||
| } | } | ||||
| return ret; | return ret; | ||||
| } | } | ||||
| const char *WM_context_member_from_ptr(bContext *C, const PointerRNA *ptr) | const char *WM_context_member_from_ptr(bContext *C, const PointerRNA *ptr) | ||||
| ▲ Show 20 Lines • Show All 3,599 Lines • Show Last 20 Lines | |||||
This block should be handled in wm_context_member_from_ptr (all other type spesific checks are done there).