Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_ID.c
| Show First 20 Lines • Show All 429 Lines • ▼ Show 20 Lines | StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), | ||||
| return RNA_def_struct_ptr(&BLENDER_RNA, identifier, &RNA_PropertyGroup); /* XXX */ | return RNA_def_struct_ptr(&BLENDER_RNA, identifier, &RNA_PropertyGroup); /* XXX */ | ||||
| } | } | ||||
| StructRNA *rna_PropertyGroup_refine(PointerRNA *ptr) | StructRNA *rna_PropertyGroup_refine(PointerRNA *ptr) | ||||
| { | { | ||||
| return ptr->type; | return ptr->type; | ||||
| } | } | ||||
| static ID *rna_ID_evaluated_get(ID *id, struct Depsgraph *depsgraph) | |||||
| { | |||||
| return DEG_get_evaluated_id(depsgraph, id); | |||||
| } | |||||
| static ID *rna_ID_copy(ID *id, Main *bmain) | static ID *rna_ID_copy(ID *id, Main *bmain) | ||||
| { | { | ||||
| ID *newid; | ID *newid; | ||||
| if (BKE_id_copy(bmain, id, &newid)) { | if (BKE_id_copy(bmain, id, &newid)) { | ||||
| if (newid != NULL) { | if (newid != NULL) { | ||||
| id_us_min(newid); | id_us_min(newid); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 995 Lines • ▼ Show 20 Lines | prop = RNA_def_pointer( | ||||
| "preview", | "preview", | ||||
| "ImagePreview", | "ImagePreview", | ||||
| "Preview", | "Preview", | ||||
| "Preview image and icon of this data-block (None if not supported for this type of data)"); | "Preview image and icon of this data-block (None if not supported for this type of data)"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_IDPreview_get", NULL, NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_IDPreview_get", NULL, NULL, NULL); | ||||
| /* functions */ | /* functions */ | ||||
| func = RNA_def_function(srna, "evaluated_get", "rna_ID_evaluated_get"); | |||||
| RNA_def_function_ui_description( | |||||
| func, "Get corresponding evaluated ID from the given dependency graph"); | |||||
mont29: `evaluated ID from` | |||||
| parm = RNA_def_pointer( | |||||
| func, "depsgraph", "Depsgraph", "", "Dependency graph to perform lookup in"); | |||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | |||||
| parm = RNA_def_pointer(func, "id", "ID", "", "New copy of the ID"); | |||||
| RNA_def_function_return(func, parm); | |||||
| func = RNA_def_function(srna, "copy", "rna_ID_copy"); | func = RNA_def_function(srna, "copy", "rna_ID_copy"); | ||||
| RNA_def_function_ui_description( | RNA_def_function_ui_description( | ||||
| func, "Create a copy of this data-block (not supported for all data-blocks)"); | func, "Create a copy of this data-block (not supported for all data-blocks)"); | ||||
| RNA_def_function_flag(func, FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_MAIN); | ||||
| parm = RNA_def_pointer(func, "id", "ID", "", "New copy of the ID"); | parm = RNA_def_pointer(func, "id", "ID", "", "New copy of the ID"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "override_create", "rna_ID_override_create"); | func = RNA_def_function(srna, "override_create", "rna_ID_override_create"); | ||||
| ▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines | |||||
evaluated ID from