Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_ID.c
| Show First 20 Lines • Show All 644 Lines • ▼ Show 20 Lines | |||||
| static ID *rna_ID_evaluated_get(ID *id, struct Depsgraph *depsgraph) | static ID *rna_ID_evaluated_get(ID *id, struct Depsgraph *depsgraph) | ||||
| { | { | ||||
| return DEG_get_evaluated_id(depsgraph, id); | 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 = BKE_id_copy(bmain, id); | ID *newid = BKE_id_copy_for_use_in_bmain(bmain, id); | ||||
| if (newid != NULL) { | if (newid != NULL) { | ||||
| id_us_min(newid); | id_us_min(newid); | ||||
| } | } | ||||
| WM_main_add_notifier(NC_ID | NA_ADDED, NULL); | WM_main_add_notifier(NC_ID | NA_ADDED, NULL); | ||||
| return newid; | return newid; | ||||
| ▲ Show 20 Lines • Show All 1,378 Lines • ▼ Show 20 Lines | static void rna_def_ID(BlenderRNA *brna) | ||||
| parm = RNA_def_pointer( | parm = RNA_def_pointer( | ||||
| func, "depsgraph", "Depsgraph", "", "Dependency graph to perform lookup in"); | func, "depsgraph", "Depsgraph", "", "Dependency graph to perform lookup in"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| 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, "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).c" | |||||
brecht: `.c` -> `. ` | |||||
| "The result is added to the global database, and all referenced IDs of the result are " | |||||
brechtUnsubmitted Not Done Inline ActionsI don't think it's obvious what "original counterparts" means in this context, that this is about the depsgraph. brecht: I don't think it's obvious what "original counterparts" means in this context, that this is… | |||||
sergeyAuthorUnsubmitted Done Inline ActionsPulling "the depsgraph" into this equation to me is even more confusing. There is no "the depsgraph". One shouldn't really care if the data-block which is being copied is coming from global bmain, evaluated state of a dependency graph, or from object.to_mesh(). I've tried to rephrase the description. If you still find it confusing it would be very useful to have some suggestions of how exactly to improve the wording. sergey: Pulling "the depsgraph" into this equation to me is even more confusing. There is no "the… | |||||
| "assigned to their original counterparts"); | |||||
| 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, "asset_mark", "rna_ID_asset_mark"); | func = RNA_def_function(srna, "asset_mark", "rna_ID_asset_mark"); | ||||
| RNA_def_function_ui_description( | RNA_def_function_ui_description( | ||||
| func, | func, | ||||
| "Enable easier reuse of the data-block through the Asset Browser, with the help of " | "Enable easier reuse of the data-block through the Asset Browser, with the help of " | ||||
| ▲ Show 20 Lines • Show All 227 Lines • Show Last 20 Lines | |||||
.c -> .