Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_define.c
| Show First 20 Lines • Show All 1,264 Lines • ▼ Show 20 Lines | else { | ||||
| prop->flag |= PROP_IDPROPERTY; | prop->flag |= PROP_IDPROPERTY; | ||||
| prop->flag_internal |= PROP_INTERN_RUNTIME; | prop->flag_internal |= PROP_INTERN_RUNTIME; | ||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| if (cont->prophash) | if (cont->prophash) | ||||
| BLI_ghash_insert(cont->prophash, (void *)prop->identifier, prop); | BLI_ghash_insert(cont->prophash, (void *)prop->identifier, prop); | ||||
| #endif | #endif | ||||
| } | } | ||||
| /* Override handling. */ | |||||
| if (DefRNA.preprocess) { | |||||
| prop->override_diff = (RNAPropOverrideDiff)"rna_property_override_diff_default"; | |||||
| prop->override_store = (RNAPropOverrideStore)"rna_property_override_store_default"; | |||||
| prop->override_apply = (RNAPropOverrideApply)"rna_property_override_apply_default"; | |||||
| } | |||||
| /* TODO: do we want that for runtime-defined stuff too? I’d say no, but... maybe yes :/ */ | |||||
| rna_addtail(&cont->properties, prop); | rna_addtail(&cont->properties, prop); | ||||
| return prop; | return prop; | ||||
| } | } | ||||
| void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag) | void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag) | ||||
| { | { | ||||
| prop->flag |= flag; | prop->flag |= flag; | ||||
| ▲ Show 20 Lines • Show All 936 Lines • ▼ Show 20 Lines | void RNA_def_property_editable_array_func(PropertyRNA *prop, const char *editable) | ||||
| if (!DefRNA.preprocess) { | if (!DefRNA.preprocess) { | ||||
| fprintf(stderr, "%s: only during preprocessing.\n", __func__); | fprintf(stderr, "%s: only during preprocessing.\n", __func__); | ||||
| return; | return; | ||||
| } | } | ||||
| if (editable) prop->itemeditable = (ItemEditableFunc)editable; | if (editable) prop->itemeditable = (ItemEditableFunc)editable; | ||||
| } | } | ||||
| /** | |||||
| * Set custom callbacks for override operations handling. | |||||
| * | |||||
| * \note \a diff callback will also be used by RNA comparison/equality functions. | |||||
| */ | |||||
| void RNA_def_property_override_funcs(PropertyRNA *prop, const char *diff, const char *store, const char *apply) | |||||
| { | |||||
| if (!DefRNA.preprocess) { | |||||
| fprintf(stderr, "%s: only during preprocessing.\n", __func__); | |||||
| return; | |||||
| } | |||||
| if (diff) { | |||||
| prop->override_diff = (RNAPropOverrideDiff)diff; | |||||
| } | |||||
| if (store) { | |||||
| prop->override_store = (RNAPropOverrideStore)store; | |||||
| } | |||||
| if (apply) { | |||||
| prop->override_apply = (RNAPropOverrideApply)apply; | |||||
| } | |||||
| } | |||||
| void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func) | void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func) | ||||
| { | { | ||||
| if (!DefRNA.preprocess) { | if (!DefRNA.preprocess) { | ||||
| fprintf(stderr, "%s: only during preprocessing.\n", __func__); | fprintf(stderr, "%s: only during preprocessing.\n", __func__); | ||||
| return; | return; | ||||
| } | } | ||||
| prop->noteflag = noteflag; | prop->noteflag = noteflag; | ||||
| ▲ Show 20 Lines • Show All 1,363 Lines • Show Last 20 Lines | |||||