Cleanup: Rename: Static Override -> Library Override.

Better to make internal code naming match official/UI naming to some
extent, this will reduce confusion in the future.

This is 'breaking' scripts and files that would use that feature, but
since it is not yet officially supported nor exposed in 2.80, as far
as that release is concerned, it is effectively
a 'no functional changes' commit.
This commit is contained in:
Bastien Montagne 2019-06-14 23:16:04 +02:00
parent f640701858
commit 23254ce4ee
57 changed files with 844 additions and 839 deletions

View File

@ -168,7 +168,7 @@ def rna_idprop_ui_create(
prop_path = rna_idprop_quote_path(prop)
item.property_overridable_static_set(prop_path, overridable)
item.property_overridable_library_set(prop_path, overridable)
return rna_ui

View File

@ -1079,8 +1079,8 @@ rna_use_soft_limits = BoolProperty(
name="Use Soft Limits",
)
rna_is_overridable_static = BoolProperty(
name="Is Statically Overridable",
rna_is_overridable_library = BoolProperty(
name="Is Library Overridable",
default=False,
)
@ -1098,7 +1098,7 @@ class WM_OT_properties_edit(Operator):
min: rna_min
max: rna_max
use_soft_limits: rna_use_soft_limits
is_overridable_static: rna_is_overridable_static
is_overridable_library: rna_is_overridable_library
soft_min: rna_min
soft_max: rna_max
description: StringProperty(
@ -1166,7 +1166,7 @@ class WM_OT_properties_edit(Operator):
# print(exec_str)
exec(exec_str)
exec_str = "item.property_overridable_static_set('[\"%s\"]', %s)" % (prop, self.is_overridable_static)
exec_str = "item.property_overridable_library_set('[\"%s\"]', %s)" % (prop, self.is_overridable_library)
exec(exec_str)
rna_idprop_ui_prop_update(item, prop)
@ -1243,8 +1243,8 @@ class WM_OT_properties_edit(Operator):
item = eval("context.%s" % data_path)
# retrieve overridable static
exec_str = "item.is_property_overridable_static('[\"%s\"]')" % (self.property)
self.is_overridable_static = bool(eval(exec_str))
exec_str = "item.is_property_overridable_library('[\"%s\"]')" % (self.property)
self.is_overridable_library = bool(eval(exec_str))
# default default value
prop_type = type(self.get_value_eval())
@ -1320,8 +1320,8 @@ class WM_OT_properties_edit(Operator):
row = layout.row()
row.prop(self, "use_soft_limits")
if bpy.app.use_static_override:
row.prop(self, "is_overridable_static")
if bpy.app.use_library_override:
row.prop(self, "is_overridable_library")
row = layout.row(align=True)
row.enabled = self.use_soft_limits

View File

@ -25,39 +25,39 @@
*/
struct ID;
struct IDOverrideStatic;
struct IDOverrideStaticProperty;
struct IDOverrideStaticPropertyOperation;
struct IDOverrideLibrary;
struct IDOverrideLibraryProperty;
struct IDOverrideLibraryPropertyOperation;
struct Main;
void BKE_override_static_enable(const bool do_enable);
bool BKE_override_static_is_enabled(void);
void BKE_override_library_enable(const bool do_enable);
bool BKE_override_library_is_enabled(void);
struct IDOverrideStatic *BKE_override_static_init(struct ID *local_id, struct ID *reference_id);
void BKE_override_static_copy(struct ID *dst_id, const struct ID *src_id);
void BKE_override_static_clear(struct IDOverrideStatic *override);
void BKE_override_static_free(struct IDOverrideStatic **override);
struct IDOverrideLibrary *BKE_override_library_init(struct ID *local_id, struct ID *reference_id);
void BKE_override_library_copy(struct ID *dst_id, const struct ID *src_id);
void BKE_override_library_clear(struct IDOverrideLibrary *override);
void BKE_override_library_free(struct IDOverrideLibrary **override);
struct ID *BKE_override_static_create_from_id(struct Main *bmain, struct ID *reference_id);
bool BKE_override_static_create_from_tag(struct Main *bmain);
struct ID *BKE_override_library_create_from_id(struct Main *bmain, struct ID *reference_id);
bool BKE_override_library_create_from_tag(struct Main *bmain);
struct IDOverrideStaticProperty *BKE_override_static_property_find(
struct IDOverrideStatic *override, const char *rna_path);
struct IDOverrideStaticProperty *BKE_override_static_property_get(
struct IDOverrideStatic *override, const char *rna_path, bool *r_created);
void BKE_override_static_property_delete(struct IDOverrideStatic *override,
struct IDOverrideStaticProperty *override_property);
struct IDOverrideLibraryProperty *BKE_override_library_property_find(
struct IDOverrideLibrary *override, const char *rna_path);
struct IDOverrideLibraryProperty *BKE_override_library_property_get(
struct IDOverrideLibrary *override, const char *rna_path, bool *r_created);
void BKE_override_library_property_delete(struct IDOverrideLibrary *override,
struct IDOverrideLibraryProperty *override_property);
struct IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_find(
struct IDOverrideStaticProperty *override_property,
struct IDOverrideLibraryPropertyOperation *BKE_override_library_property_operation_find(
struct IDOverrideLibraryProperty *override_property,
const char *subitem_refname,
const char *subitem_locname,
const int subitem_refindex,
const int subitem_locindex,
const bool strict,
bool *r_strict);
struct IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_get(
struct IDOverrideStaticProperty *override_property,
struct IDOverrideLibraryPropertyOperation *BKE_override_library_property_operation_get(
struct IDOverrideLibraryProperty *override_property,
const short operation,
const char *subitem_refname,
const char *subitem_locname,
@ -66,32 +66,32 @@ struct IDOverrideStaticPropertyOperation *BKE_override_static_property_operation
const bool strict,
bool *r_strict,
bool *r_created);
void BKE_override_static_property_operation_delete(
struct IDOverrideStaticProperty *override_property,
struct IDOverrideStaticPropertyOperation *override_property_operation);
void BKE_override_library_property_operation_delete(
struct IDOverrideLibraryProperty *override_property,
struct IDOverrideLibraryPropertyOperation *override_property_operation);
bool BKE_override_static_status_check_local(struct Main *bmain, struct ID *local);
bool BKE_override_static_status_check_reference(struct Main *bmain, struct ID *local);
bool BKE_override_library_status_check_local(struct Main *bmain, struct ID *local);
bool BKE_override_library_status_check_reference(struct Main *bmain, struct ID *local);
bool BKE_override_static_operations_create(struct Main *bmain,
struct ID *local,
const bool force_auto);
void BKE_main_override_static_operations_create(struct Main *bmain, const bool force_auto);
bool BKE_override_library_operations_create(struct Main *bmain,
struct ID *local,
const bool force_auto);
void BKE_main_override_library_operations_create(struct Main *bmain, const bool force_auto);
void BKE_override_static_update(struct Main *bmain, struct ID *local);
void BKE_main_override_static_update(struct Main *bmain);
void BKE_override_library_update(struct Main *bmain, struct ID *local);
void BKE_main_override_library_update(struct Main *bmain);
/* Storage (.blend file writing) part. */
/* For now, we just use a temp main list. */
typedef struct Main OverrideStaticStorage;
typedef struct Main OverrideLibraryStorage;
OverrideStaticStorage *BKE_override_static_operations_store_initialize(void);
struct ID *BKE_override_static_operations_store_start(struct Main *bmain,
OverrideStaticStorage *override_storage,
struct ID *local);
void BKE_override_static_operations_store_end(OverrideStaticStorage *override_storage,
struct ID *local);
void BKE_override_static_operations_store_finalize(OverrideStaticStorage *override_storage);
OverrideLibraryStorage *BKE_override_library_operations_store_initialize(void);
struct ID *BKE_override_library_operations_store_start(struct Main *bmain,
OverrideLibraryStorage *override_storage,
struct ID *local);
void BKE_override_library_operations_store_end(OverrideLibraryStorage *override_storage,
struct ID *local);
void BKE_override_library_operations_store_finalize(OverrideLibraryStorage *override_storage);
#endif /* __BKE_LIBRARY_OVERRIDE_H__ */

View File

@ -51,8 +51,8 @@ enum {
* How to handle that kind of cases totally depends on what caller code is doing... */
IDWALK_CB_LOOPBACK = (1 << 4),
/** That ID is used as static override's reference by its owner. */
IDWALK_CB_STATIC_OVERRIDE_REFERENCE = (1 << 5),
/** That ID is used as library override's reference by its owner. */
IDWALK_CB_OVERRIDE_LIBRARY_REFERENCE = (1 << 5),
/**
* Adjusts #ID.us reference-count.

View File

@ -61,8 +61,8 @@ enum {
* is also performed. Usual nightmare...
*/
ID_REMAP_NO_INDIRECT_PROXY_DATA_USAGE = 1 << 4,
/** Do not remap static override pointers. */
ID_REMAP_SKIP_STATIC_OVERRIDE = 1 << 5,
/** Do not remap library override pointers. */
ID_REMAP_SKIP_OVERRIDE_LIBRARY = 1 << 5,
};
/* Note: Requiring new_id to be non-null, this *may* not be the case ultimately,

View File

@ -5100,7 +5100,7 @@ static bConstraint *add_new_constraint_internal(const char *name, short type)
/* Set up a generic constraint data-block. */
con->type = type;
con->flag |= CONSTRAINT_EXPAND | CONSTRAINT_STATICOVERRIDE_LOCAL;
con->flag |= CONSTRAINT_EXPAND | CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
con->enforce = 1.0f;
/* Determine a basic name, and info */

View File

@ -551,7 +551,7 @@ GpencilModifierData *BKE_gpencil_modifier_new(int type)
md->type = type;
md->mode = eGpencilModifierMode_Realtime | eGpencilModifierMode_Render |
eGpencilModifierMode_Expanded;
md->flag = eGpencilModifierFlag_StaticOverride_Local;
md->flag = eGpencilModifierFlag_OverrideLibrary_Local;
if (mti->flags & eGpencilModifierTypeFlag_EnableInEditmode) {
md->mode |= eGpencilModifierMode_Editmode;

View File

@ -2281,7 +2281,7 @@ void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const ID *id)
*/
void BKE_id_full_name_ui_prefix_get(char name[MAX_ID_FULL_NAME_UI], const ID *id)
{
name[0] = id->lib ? (ID_MISSING(id) ? 'M' : 'L') : ID_IS_STATIC_OVERRIDE(id) ? 'O' : ' ';
name[0] = id->lib ? (ID_MISSING(id) ? 'M' : 'L') : ID_IS_OVERRIDE_LIBRARY(id) ? 'O' : ' ';
name[1] = (id->flag & LIB_FAKEUSER) ? 'F' : ((id->us == 0) ? '0' : ' ');
name[2] = ' ';

View File

@ -47,108 +47,108 @@
#define OVERRIDE_AUTO_CHECK_DELAY 0.2 /* 200ms between auto-override checks. */
static void bke_override_property_copy(IDOverrideStaticProperty *op_dst,
IDOverrideStaticProperty *op_src);
static void bke_override_property_operation_copy(IDOverrideStaticPropertyOperation *opop_dst,
IDOverrideStaticPropertyOperation *opop_src);
static void bke_override_property_copy(IDOverrideLibraryProperty *op_dst,
IDOverrideLibraryProperty *op_src);
static void bke_override_property_operation_copy(IDOverrideLibraryPropertyOperation *opop_dst,
IDOverrideLibraryPropertyOperation *opop_src);
static void bke_override_property_clear(IDOverrideStaticProperty *op);
static void bke_override_property_operation_clear(IDOverrideStaticPropertyOperation *opop);
static void bke_override_property_clear(IDOverrideLibraryProperty *op);
static void bke_override_property_operation_clear(IDOverrideLibraryPropertyOperation *opop);
/* Temp, for until static override is ready and tested enough to go 'public',
/* Temp, for until library override is ready and tested enough to go 'public',
* we hide it by default in UI and such. */
static bool _override_static_enabled = false;
static bool _override_library_enabled = false;
void BKE_override_static_enable(const bool do_enable)
void BKE_override_library_enable(const bool do_enable)
{
_override_static_enabled = do_enable;
_override_library_enabled = do_enable;
}
bool BKE_override_static_is_enabled()
bool BKE_override_library_is_enabled()
{
return _override_static_enabled;
return _override_library_enabled;
}
/** Initialize empty overriding of \a reference_id by \a local_id. */
IDOverrideStatic *BKE_override_static_init(ID *local_id, ID *reference_id)
IDOverrideLibrary *BKE_override_library_init(ID *local_id, ID *reference_id)
{
/* If reference_id is NULL, we are creating an override template for purely local data.
* Else, reference *must* be linked data. */
BLI_assert(reference_id == NULL || reference_id->lib != NULL);
BLI_assert(local_id->override_static == NULL);
BLI_assert(local_id->override_library == NULL);
ID *ancestor_id;
for (ancestor_id = reference_id; ancestor_id != NULL && ancestor_id->override_static != NULL &&
ancestor_id->override_static->reference != NULL;
ancestor_id = ancestor_id->override_static->reference) {
for (ancestor_id = reference_id; ancestor_id != NULL && ancestor_id->override_library != NULL &&
ancestor_id->override_library->reference != NULL;
ancestor_id = ancestor_id->override_library->reference) {
/* pass */
}
if (ancestor_id != NULL && ancestor_id->override_static != NULL) {
if (ancestor_id != NULL && ancestor_id->override_library != NULL) {
/* Original ID has a template, use it! */
BKE_override_static_copy(local_id, ancestor_id);
if (local_id->override_static->reference != reference_id) {
id_us_min(local_id->override_static->reference);
local_id->override_static->reference = reference_id;
id_us_plus(local_id->override_static->reference);
BKE_override_library_copy(local_id, ancestor_id);
if (local_id->override_library->reference != reference_id) {
id_us_min(local_id->override_library->reference);
local_id->override_library->reference = reference_id;
id_us_plus(local_id->override_library->reference);
}
return local_id->override_static;
return local_id->override_library;
}
/* Else, generate new empty override. */
local_id->override_static = MEM_callocN(sizeof(*local_id->override_static), __func__);
local_id->override_static->reference = reference_id;
id_us_plus(local_id->override_static->reference);
local_id->tag &= ~LIB_TAG_OVERRIDESTATIC_REFOK;
local_id->override_library = MEM_callocN(sizeof(*local_id->override_library), __func__);
local_id->override_library->reference = reference_id;
id_us_plus(local_id->override_library->reference);
local_id->tag &= ~LIB_TAG_OVERRIDE_LIBRARY_REFOK;
/* TODO do we want to add tag or flag to referee to mark it as such? */
return local_id->override_static;
return local_id->override_library;
}
/** Deep copy of a whole override from \a src_id to \a dst_id. */
void BKE_override_static_copy(ID *dst_id, const ID *src_id)
void BKE_override_library_copy(ID *dst_id, const ID *src_id)
{
BLI_assert(src_id->override_static != NULL);
BLI_assert(src_id->override_library != NULL);
if (dst_id->override_static != NULL) {
if (src_id->override_static == NULL) {
BKE_override_static_free(&dst_id->override_static);
if (dst_id->override_library != NULL) {
if (src_id->override_library == NULL) {
BKE_override_library_free(&dst_id->override_library);
return;
}
else {
BKE_override_static_clear(dst_id->override_static);
BKE_override_library_clear(dst_id->override_library);
}
}
else if (src_id->override_static == NULL) {
else if (src_id->override_library == NULL) {
return;
}
else {
BKE_override_static_init(dst_id, NULL);
BKE_override_library_init(dst_id, NULL);
}
/* Source is already overriding data, we copy it but reuse its reference for dest ID.
* otherwise, source is only an override template, it then becomes reference of dest ID. */
dst_id->override_static->reference = src_id->override_static->reference ?
src_id->override_static->reference :
(ID *)src_id;
id_us_plus(dst_id->override_static->reference);
dst_id->override_library->reference = src_id->override_library->reference ?
src_id->override_library->reference :
(ID *)src_id;
id_us_plus(dst_id->override_library->reference);
BLI_duplicatelist(&dst_id->override_static->properties, &src_id->override_static->properties);
for (IDOverrideStaticProperty *op_dst = dst_id->override_static->properties.first,
*op_src = src_id->override_static->properties.first;
BLI_duplicatelist(&dst_id->override_library->properties, &src_id->override_library->properties);
for (IDOverrideLibraryProperty *op_dst = dst_id->override_library->properties.first,
*op_src = src_id->override_library->properties.first;
op_dst;
op_dst = op_dst->next, op_src = op_src->next) {
bke_override_property_copy(op_dst, op_src);
}
dst_id->tag &= ~LIB_TAG_OVERRIDESTATIC_REFOK;
dst_id->tag &= ~LIB_TAG_OVERRIDE_LIBRARY_REFOK;
}
/** Clear any overriding data from given \a override. */
void BKE_override_static_clear(IDOverrideStatic *override)
void BKE_override_library_clear(IDOverrideLibrary *override)
{
BLI_assert(override != NULL);
for (IDOverrideStaticProperty *op = override->properties.first; op; op = op->next) {
for (IDOverrideLibraryProperty *op = override->properties.first; op; op = op->next) {
bke_override_property_clear(op);
}
BLI_freelistN(&override->properties);
@ -158,16 +158,16 @@ void BKE_override_static_clear(IDOverrideStatic *override)
}
/** Free given \a override. */
void BKE_override_static_free(struct IDOverrideStatic **override)
void BKE_override_library_free(struct IDOverrideLibrary **override)
{
BLI_assert(*override != NULL);
BKE_override_static_clear(*override);
BKE_override_library_clear(*override);
MEM_freeN(*override);
*override = NULL;
}
static ID *override_static_create_from(Main *bmain, ID *reference_id)
static ID *override_library_create_from(Main *bmain, ID *reference_id)
{
ID *local_id;
@ -176,24 +176,26 @@ static ID *override_static_create_from(Main *bmain, ID *reference_id)
}
id_us_min(local_id);
BKE_override_static_init(local_id, reference_id);
local_id->override_static->flag |= STATICOVERRIDE_AUTO;
BKE_override_library_init(local_id, reference_id);
local_id->override_library->flag |= OVERRIDE_LIBRARY_AUTO;
return local_id;
}
/** Create an overridden local copy of linked reference. */
ID *BKE_override_static_create_from_id(Main *bmain, ID *reference_id)
ID *BKE_override_library_create_from_id(Main *bmain, ID *reference_id)
{
BLI_assert(reference_id != NULL);
BLI_assert(reference_id->lib != NULL);
ID *local_id = override_static_create_from(bmain, reference_id);
ID *local_id = override_library_create_from(bmain, reference_id);
/* Remapping, we obviously only want to affect local data
* (and not our own reference pointer to overridden ID). */
BKE_libblock_remap(
bmain, reference_id, local_id, ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_STATIC_OVERRIDE);
BKE_libblock_remap(bmain,
reference_id,
local_id,
ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_OVERRIDE_LIBRARY);
return local_id;
}
@ -205,14 +207,14 @@ ID *BKE_override_static_create_from_id(Main *bmain, ID *reference_id)
*
* \return \a true on success, \a false otherwise.
*/
bool BKE_override_static_create_from_tag(Main *bmain)
bool BKE_override_library_create_from_tag(Main *bmain)
{
ID *reference_id;
bool ret = true;
FOREACH_MAIN_ID_BEGIN (bmain, reference_id) {
if ((reference_id->tag & LIB_TAG_DOIT) != 0 && reference_id->lib != NULL) {
if ((reference_id->newid = override_static_create_from(bmain, reference_id)) == NULL) {
if ((reference_id->newid = override_library_create_from(bmain, reference_id)) == NULL) {
ret = false;
}
}
@ -226,7 +228,7 @@ bool BKE_override_static_create_from_tag(Main *bmain)
BKE_libblock_remap(bmain,
reference_id,
local_id,
ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_STATIC_OVERRIDE);
ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_OVERRIDE_LIBRARY);
}
}
FOREACH_MAIN_ID_END;
@ -237,26 +239,26 @@ bool BKE_override_static_create_from_tag(Main *bmain)
/**
* Find override property from given RNA path, if it exists.
*/
IDOverrideStaticProperty *BKE_override_static_property_find(IDOverrideStatic *override,
const char *rna_path)
IDOverrideLibraryProperty *BKE_override_library_property_find(IDOverrideLibrary *override,
const char *rna_path)
{
/* XXX TODO we'll most likely want a runtime ghash to store that mapping at some point. */
return BLI_findstring_ptr(
&override->properties, rna_path, offsetof(IDOverrideStaticProperty, rna_path));
&override->properties, rna_path, offsetof(IDOverrideLibraryProperty, rna_path));
}
/**
* Find override property from given RNA path, or create it if it does not exist.
*/
IDOverrideStaticProperty *BKE_override_static_property_get(IDOverrideStatic *override,
const char *rna_path,
bool *r_created)
IDOverrideLibraryProperty *BKE_override_library_property_get(IDOverrideLibrary *override,
const char *rna_path,
bool *r_created)
{
/* XXX TODO we'll most likely want a runtime ghash to store that mapping at some point. */
IDOverrideStaticProperty *op = BKE_override_static_property_find(override, rna_path);
IDOverrideLibraryProperty *op = BKE_override_library_property_find(override, rna_path);
if (op == NULL) {
op = MEM_callocN(sizeof(IDOverrideStaticProperty), __func__);
op = MEM_callocN(sizeof(IDOverrideLibraryProperty), __func__);
op->rna_path = BLI_strdup(rna_path);
BLI_addtail(&override->properties, op);
@ -271,26 +273,27 @@ IDOverrideStaticProperty *BKE_override_static_property_get(IDOverrideStatic *ove
return op;
}
void bke_override_property_copy(IDOverrideStaticProperty *op_dst, IDOverrideStaticProperty *op_src)
void bke_override_property_copy(IDOverrideLibraryProperty *op_dst,
IDOverrideLibraryProperty *op_src)
{
op_dst->rna_path = BLI_strdup(op_src->rna_path);
BLI_duplicatelist(&op_dst->operations, &op_src->operations);
for (IDOverrideStaticPropertyOperation *opop_dst = op_dst->operations.first,
*opop_src = op_src->operations.first;
for (IDOverrideLibraryPropertyOperation *opop_dst = op_dst->operations.first,
*opop_src = op_src->operations.first;
opop_dst;
opop_dst = opop_dst->next, opop_src = opop_src->next) {
bke_override_property_operation_copy(opop_dst, opop_src);
}
}
void bke_override_property_clear(IDOverrideStaticProperty *op)
void bke_override_property_clear(IDOverrideLibraryProperty *op)
{
BLI_assert(op->rna_path != NULL);
MEM_freeN(op->rna_path);
for (IDOverrideStaticPropertyOperation *opop = op->operations.first; opop; opop = opop->next) {
for (IDOverrideLibraryPropertyOperation *opop = op->operations.first; opop; opop = opop->next) {
bke_override_property_operation_clear(opop);
}
BLI_freelistN(&op->operations);
@ -299,8 +302,8 @@ void bke_override_property_clear(IDOverrideStaticProperty *op)
/**
* Remove and free given \a override_property from given ID \a override.
*/
void BKE_override_static_property_delete(IDOverrideStatic *override,
IDOverrideStaticProperty *override_property)
void BKE_override_library_property_delete(IDOverrideLibrary *override,
IDOverrideLibraryProperty *override_property)
{
bke_override_property_clear(override_property);
BLI_freelinkN(&override->properties, override_property);
@ -309,8 +312,8 @@ void BKE_override_static_property_delete(IDOverrideStatic *override,
/**
* Find override property operation from given sub-item(s), if it exists.
*/
IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_find(
IDOverrideStaticProperty *override_property,
IDOverrideLibraryPropertyOperation *BKE_override_library_property_operation_find(
IDOverrideLibraryProperty *override_property,
const char *subitem_refname,
const char *subitem_locname,
const int subitem_refindex,
@ -318,7 +321,7 @@ IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_find(
const bool strict,
bool *r_strict)
{
IDOverrideStaticPropertyOperation *opop;
IDOverrideLibraryPropertyOperation *opop;
const int subitem_defindex = -1;
if (r_strict) {
@ -328,7 +331,7 @@ IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_find(
if (subitem_locname != NULL) {
opop = BLI_findstring_ptr(&override_property->operations,
subitem_locname,
offsetof(IDOverrideStaticPropertyOperation, subitem_local_name));
offsetof(IDOverrideLibraryPropertyOperation, subitem_local_name));
if (opop == NULL) {
return NULL;
@ -344,9 +347,10 @@ IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_find(
}
if (subitem_refname != NULL) {
opop = BLI_findstring_ptr(&override_property->operations,
subitem_refname,
offsetof(IDOverrideStaticPropertyOperation, subitem_reference_name));
opop = BLI_findstring_ptr(
&override_property->operations,
subitem_refname,
offsetof(IDOverrideLibraryPropertyOperation, subitem_reference_name));
if (opop == NULL) {
return NULL;
@ -365,7 +369,7 @@ IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_find(
&override_property->operations,
&subitem_locindex,
sizeof(subitem_locindex),
offsetof(IDOverrideStaticPropertyOperation, subitem_local_index)))) {
offsetof(IDOverrideLibraryPropertyOperation, subitem_local_index)))) {
return ELEM(subitem_refindex, -1, opop->subitem_reference_index) ? opop : NULL;
}
@ -373,7 +377,7 @@ IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_find(
&override_property->operations,
&subitem_refindex,
sizeof(subitem_refindex),
offsetof(IDOverrideStaticPropertyOperation, subitem_reference_index)))) {
offsetof(IDOverrideLibraryPropertyOperation, subitem_reference_index)))) {
return ELEM(subitem_locindex, -1, opop->subitem_local_index) ? opop : NULL;
}
@ -383,7 +387,7 @@ IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_find(
&override_property->operations,
&subitem_defindex,
sizeof(subitem_defindex),
offsetof(IDOverrideStaticPropertyOperation, subitem_local_index)))) {
offsetof(IDOverrideLibraryPropertyOperation, subitem_local_index)))) {
if (r_strict) {
*r_strict = false;
}
@ -396,8 +400,8 @@ IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_find(
/**
* Find override property operation from given sub-item(s), or create it if it does not exist.
*/
IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_get(
IDOverrideStaticProperty *override_property,
IDOverrideLibraryPropertyOperation *BKE_override_library_property_operation_get(
IDOverrideLibraryProperty *override_property,
const short operation,
const char *subitem_refname,
const char *subitem_locname,
@ -407,7 +411,7 @@ IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_get(
bool *r_strict,
bool *r_created)
{
IDOverrideStaticPropertyOperation *opop = BKE_override_static_property_operation_find(
IDOverrideLibraryPropertyOperation *opop = BKE_override_library_property_operation_find(
override_property,
subitem_refname,
subitem_locname,
@ -417,7 +421,7 @@ IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_get(
r_strict);
if (opop == NULL) {
opop = MEM_callocN(sizeof(IDOverrideStaticPropertyOperation), __func__);
opop = MEM_callocN(sizeof(IDOverrideLibraryPropertyOperation), __func__);
opop->operation = operation;
if (subitem_locname) {
opop->subitem_local_name = BLI_strdup(subitem_locname);
@ -441,8 +445,8 @@ IDOverrideStaticPropertyOperation *BKE_override_static_property_operation_get(
return opop;
}
void bke_override_property_operation_copy(IDOverrideStaticPropertyOperation *opop_dst,
IDOverrideStaticPropertyOperation *opop_src)
void bke_override_property_operation_copy(IDOverrideLibraryPropertyOperation *opop_dst,
IDOverrideLibraryPropertyOperation *opop_src)
{
if (opop_src->subitem_reference_name) {
opop_dst->subitem_reference_name = BLI_strdup(opop_src->subitem_reference_name);
@ -452,7 +456,7 @@ void bke_override_property_operation_copy(IDOverrideStaticPropertyOperation *opo
}
}
void bke_override_property_operation_clear(IDOverrideStaticPropertyOperation *opop)
void bke_override_property_operation_clear(IDOverrideLibraryPropertyOperation *opop)
{
if (opop->subitem_reference_name) {
MEM_freeN(opop->subitem_reference_name);
@ -465,9 +469,9 @@ void bke_override_property_operation_clear(IDOverrideStaticPropertyOperation *op
/**
* Remove and free given \a override_property_operation from given ID \a override_property.
*/
void BKE_override_static_property_operation_delete(
IDOverrideStaticProperty *override_property,
IDOverrideStaticPropertyOperation *override_property_operation)
void BKE_override_library_property_operation_delete(
IDOverrideLibraryProperty *override_property,
IDOverrideLibraryPropertyOperation *override_property_operation)
{
bke_override_property_operation_clear(override_property_operation);
BLI_freelinkN(&override_property->operations, override_property_operation);
@ -483,11 +487,11 @@ void BKE_override_static_property_operation_delete(
* #IDOverrideProperty (of #IDOverridePropertyOperation) has to be added.
*
* \return true if status is OK, false otherwise. */
bool BKE_override_static_status_check_local(Main *bmain, ID *local)
bool BKE_override_library_status_check_local(Main *bmain, ID *local)
{
BLI_assert(local->override_static != NULL);
BLI_assert(local->override_library != NULL);
ID *reference = local->override_static->reference;
ID *reference = local->override_library->reference;
if (reference == NULL) {
/* This is an override template, local status is always OK! */
@ -506,11 +510,11 @@ bool BKE_override_static_status_check_local(Main *bmain, ID *local)
&rnaptr_local,
&rnaptr_reference,
NULL,
local->override_static,
local->override_library,
RNA_OVERRIDE_COMPARE_IGNORE_NON_OVERRIDABLE |
RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN,
NULL)) {
local->tag &= ~LIB_TAG_OVERRIDESTATIC_REFOK;
local->tag &= ~LIB_TAG_OVERRIDE_LIBRARY_REFOK;
return false;
}
@ -527,11 +531,11 @@ bool BKE_override_static_status_check_local(Main *bmain, ID *local)
* needs to be updated against it.
*
* \return true if status is OK, false otherwise. */
bool BKE_override_static_status_check_reference(Main *bmain, ID *local)
bool BKE_override_library_status_check_reference(Main *bmain, ID *local)
{
BLI_assert(local->override_static != NULL);
BLI_assert(local->override_library != NULL);
ID *reference = local->override_static->reference;
ID *reference = local->override_library->reference;
if (reference == NULL) {
/* This is an override template, reference is virtual, so its status is always OK! */
@ -540,12 +544,12 @@ bool BKE_override_static_status_check_reference(Main *bmain, ID *local)
BLI_assert(GS(local->name) == GS(reference->name));
if (reference->override_static && (reference->tag & LIB_TAG_OVERRIDESTATIC_REFOK) == 0) {
if (!BKE_override_static_status_check_reference(bmain, reference)) {
if (reference->override_library && (reference->tag & LIB_TAG_OVERRIDE_LIBRARY_REFOK) == 0) {
if (!BKE_override_library_status_check_reference(bmain, reference)) {
/* If reference is also override of another data-block, and its status is not OK,
* then this override is not OK either.
* Note that this should only happen when reloading libraries... */
local->tag &= ~LIB_TAG_OVERRIDESTATIC_REFOK;
local->tag &= ~LIB_TAG_OVERRIDE_LIBRARY_REFOK;
return false;
}
}
@ -558,10 +562,10 @@ bool BKE_override_static_status_check_reference(Main *bmain, ID *local)
&rnaptr_local,
&rnaptr_reference,
NULL,
local->override_static,
local->override_library,
RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN,
NULL)) {
local->tag &= ~LIB_TAG_OVERRIDESTATIC_REFOK;
local->tag &= ~LIB_TAG_OVERRIDE_LIBRARY_REFOK;
return false;
}
@ -581,23 +585,23 @@ bool BKE_override_static_status_check_reference(Main *bmain, ID *local)
* Generating diff values and applying overrides are much cheaper.
*
* \return true if new overriding op was created, or some local data was reset. */
bool BKE_override_static_operations_create(Main *bmain, ID *local, const bool force_auto)
bool BKE_override_library_operations_create(Main *bmain, ID *local, const bool force_auto)
{
BLI_assert(local->override_static != NULL);
const bool is_template = (local->override_static->reference == NULL);
BLI_assert(local->override_library != NULL);
const bool is_template = (local->override_library->reference == NULL);
bool ret = false;
if (!is_template && (force_auto || local->override_static->flag & STATICOVERRIDE_AUTO)) {
if (!is_template && (force_auto || local->override_library->flag & OVERRIDE_LIBRARY_AUTO)) {
PointerRNA rnaptr_local, rnaptr_reference;
RNA_id_pointer_create(local, &rnaptr_local);
RNA_id_pointer_create(local->override_static->reference, &rnaptr_reference);
RNA_id_pointer_create(local->override_library->reference, &rnaptr_reference);
eRNAOverrideMatchResult report_flags = 0;
RNA_struct_override_matches(bmain,
&rnaptr_local,
&rnaptr_reference,
NULL,
local->override_static,
local->override_library,
RNA_OVERRIDE_COMPARE_CREATE | RNA_OVERRIDE_COMPARE_RESTORE,
&report_flags);
if (report_flags & RNA_OVERRIDE_MATCH_RESULT_CREATED) {
@ -608,10 +612,10 @@ bool BKE_override_static_operations_create(Main *bmain, ID *local, const bool fo
printf("We did restore some properties of %s from its reference.\n", local->name);
}
if (ret) {
printf("We did generate static override rules for %s\n", local->name);
printf("We did generate library override rules for %s\n", local->name);
}
else {
printf("No new static override rules for %s\n", local->name);
printf("No new library override rules for %s\n", local->name);
}
#endif
}
@ -619,31 +623,31 @@ bool BKE_override_static_operations_create(Main *bmain, ID *local, const bool fo
}
/** Check all overrides from given \a bmain and create/update overriding operations as needed. */
void BKE_main_override_static_operations_create(Main *bmain, const bool force_auto)
void BKE_main_override_library_operations_create(Main *bmain, const bool force_auto)
{
ID *id;
FOREACH_MAIN_ID_BEGIN (bmain, id) {
if (force_auto ||
(ID_IS_STATIC_OVERRIDE_AUTO(id) && (id->tag & LIB_TAG_OVERRIDESTATIC_AUTOREFRESH))) {
BKE_override_static_operations_create(bmain, id, force_auto);
id->tag &= ~LIB_TAG_OVERRIDESTATIC_AUTOREFRESH;
(ID_IS_OVERRIDE_LIBRARY_AUTO(id) && (id->tag & LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH))) {
BKE_override_library_operations_create(bmain, id, force_auto);
id->tag &= ~LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH;
}
}
FOREACH_MAIN_ID_END;
}
/** Update given override from its reference (re-applying overridden properties). */
void BKE_override_static_update(Main *bmain, ID *local)
void BKE_override_library_update(Main *bmain, ID *local)
{
if (local->override_static == NULL || local->override_static->reference == NULL) {
if (local->override_library == NULL || local->override_library->reference == NULL) {
return;
}
/* Recursively do 'ancestors' overrides first, if any. */
if (local->override_static->reference->override_static &&
(local->override_static->reference->tag & LIB_TAG_OVERRIDESTATIC_REFOK) == 0) {
BKE_override_static_update(bmain, local->override_static->reference);
if (local->override_library->reference->override_library &&
(local->override_library->reference->tag & LIB_TAG_OVERRIDE_LIBRARY_REFOK) == 0) {
BKE_override_library_update(bmain, local->override_library->reference);
}
/* We want to avoid having to remap here, however creating up-to-date override is much simpler
@ -662,7 +666,7 @@ void BKE_override_static_update(Main *bmain, ID *local)
* is actually a (performances) issue here. */
ID *tmp_id;
BKE_id_copy(bmain, local->override_static->reference, &tmp_id);
BKE_id_copy(bmain, local->override_library->reference, &tmp_id);
if (tmp_id == NULL) {
return;
@ -671,13 +675,13 @@ void BKE_override_static_update(Main *bmain, ID *local)
PointerRNA rnaptr_src, rnaptr_dst, rnaptr_storage_stack, *rnaptr_storage = NULL;
RNA_id_pointer_create(local, &rnaptr_src);
RNA_id_pointer_create(tmp_id, &rnaptr_dst);
if (local->override_static->storage) {
if (local->override_library->storage) {
rnaptr_storage = &rnaptr_storage_stack;
RNA_id_pointer_create(local->override_static->storage, rnaptr_storage);
RNA_id_pointer_create(local->override_library->storage, rnaptr_storage);
}
RNA_struct_override_apply(
bmain, &rnaptr_dst, &rnaptr_src, rnaptr_storage, local->override_static);
bmain, &rnaptr_dst, &rnaptr_src, rnaptr_storage, local->override_library);
/* This also transfers all pointers (memory) owned by local to tmp_id, and vice-versa.
* So when we'll free tmp_id, we'll actually free old, outdated data from local. */
@ -688,15 +692,15 @@ void BKE_override_static_update(Main *bmain, ID *local)
/* XXX And crashing in complex cases (e.g. because depsgraph uses same data...). */
BKE_id_free_ex(bmain, tmp_id, LIB_ID_FREE_NO_UI_USER, true);
if (local->override_static->storage) {
if (local->override_library->storage) {
/* We know this datablock is not used anywhere besides local->override->storage. */
/* XXX For until we get fully shadow copies, we still need to ensure storage releases
* its usage of any ID pointers it may have. */
BKE_id_free_ex(bmain, local->override_static->storage, LIB_ID_FREE_NO_UI_USER, true);
local->override_static->storage = NULL;
BKE_id_free_ex(bmain, local->override_library->storage, LIB_ID_FREE_NO_UI_USER, true);
local->override_library->storage = NULL;
}
local->tag |= LIB_TAG_OVERRIDESTATIC_REFOK;
local->tag |= LIB_TAG_OVERRIDE_LIBRARY_REFOK;
/* Full rebuild of Depsgraph! */
DEG_on_visible_update(
@ -705,13 +709,13 @@ void BKE_override_static_update(Main *bmain, ID *local)
}
/** Update all overrides from given \a bmain. */
void BKE_main_override_static_update(Main *bmain)
void BKE_main_override_library_update(Main *bmain)
{
ID *id;
FOREACH_MAIN_ID_BEGIN (bmain, id) {
if (id->override_static != NULL && id->lib == NULL) {
BKE_override_static_update(bmain, id);
if (id->override_library != NULL && id->lib == NULL) {
BKE_override_library_update(bmain, id);
}
}
FOREACH_MAIN_ID_END;
@ -735,7 +739,7 @@ void BKE_main_override_static_update(Main *bmain)
*/
/** Initialize an override storage. */
OverrideStaticStorage *BKE_override_static_operations_store_initialize(void)
OverrideLibraryStorage *BKE_override_library_operations_store_initialize(void)
{
return BKE_main_new();
}
@ -745,13 +749,13 @@ OverrideStaticStorage *BKE_override_static_operations_store_initialize(void)
*
* Note that \a local ID is no more modified by this call,
* all extra data are stored in its temp \a storage_id copy. */
ID *BKE_override_static_operations_store_start(Main *bmain,
OverrideStaticStorage *override_storage,
ID *local)
ID *BKE_override_library_operations_store_start(Main *bmain,
OverrideLibraryStorage *override_storage,
ID *local)
{
BLI_assert(local->override_static != NULL);
BLI_assert(local->override_library != NULL);
BLI_assert(override_storage != NULL);
const bool is_template = (local->override_static->reference == NULL);
const bool is_template = (local->override_library->reference == NULL);
if (is_template) {
/* This is actually purely local data with an override template, nothing to do here! */
@ -759,7 +763,7 @@ ID *BKE_override_static_operations_store_start(Main *bmain,
}
/* Forcefully ensure we know about all needed override operations. */
BKE_override_static_operations_create(bmain, local, false);
BKE_override_library_operations_create(bmain, local, false);
ID *storage_id;
#ifdef DEBUG_OVERRIDE_TIMEIT
@ -777,18 +781,18 @@ ID *BKE_override_static_operations_store_start(Main *bmain,
if (storage_id != NULL) {
PointerRNA rnaptr_reference, rnaptr_final, rnaptr_storage;
RNA_id_pointer_create(local->override_static->reference, &rnaptr_reference);
RNA_id_pointer_create(local->override_library->reference, &rnaptr_reference);
RNA_id_pointer_create(local, &rnaptr_final);
RNA_id_pointer_create(storage_id, &rnaptr_storage);
if (!RNA_struct_override_store(
bmain, &rnaptr_final, &rnaptr_reference, &rnaptr_storage, local->override_static)) {
bmain, &rnaptr_final, &rnaptr_reference, &rnaptr_storage, local->override_library)) {
BKE_id_free_ex(override_storage, storage_id, LIB_ID_FREE_NO_UI_USER, true);
storage_id = NULL;
}
}
local->override_static->storage = storage_id;
local->override_library->storage = storage_id;
#ifdef DEBUG_OVERRIDE_TIMEIT
TIMEIT_END_AVERAGED(BKE_override_operations_store_start);
@ -797,17 +801,17 @@ ID *BKE_override_static_operations_store_start(Main *bmain,
}
/** Restore given ID modified by \a BKE_override_operations_store_start, to its original state. */
void BKE_override_static_operations_store_end(OverrideStaticStorage *UNUSED(override_storage),
ID *local)
void BKE_override_library_operations_store_end(OverrideLibraryStorage *UNUSED(override_storage),
ID *local)
{
BLI_assert(local->override_static != NULL);
BLI_assert(local->override_library != NULL);
/* Nothing else to do here really, we need to keep all temp override storage data-blocks in
* memory until whole file is written anyway (otherwise we'd get mem pointers overlap...). */
local->override_static->storage = NULL;
local->override_library->storage = NULL;
}
void BKE_override_static_operations_store_finalize(OverrideStaticStorage *override_storage)
void BKE_override_library_operations_store_finalize(OverrideLibraryStorage *override_storage)
{
/* We cannot just call BKE_main_free(override_storage), not until we have option to make 'ghost'
* copies of IDs without increasing usercount of used data-blocks. */

View File

@ -428,11 +428,11 @@ static void library_foreach_ID_link(Main *bmain,
continue;
}
if (id->override_static != NULL) {
CALLBACK_INVOKE_ID(id->override_static->reference,
IDWALK_CB_USER | IDWALK_CB_STATIC_OVERRIDE_REFERENCE);
CALLBACK_INVOKE_ID(id->override_static->storage,
IDWALK_CB_USER | IDWALK_CB_STATIC_OVERRIDE_REFERENCE);
if (id->override_library != NULL) {
CALLBACK_INVOKE_ID(id->override_library->reference,
IDWALK_CB_USER | IDWALK_CB_OVERRIDE_LIBRARY_REFERENCE);
CALLBACK_INVOKE_ID(id->override_library->storage,
IDWALK_CB_USER | IDWALK_CB_OVERRIDE_LIBRARY_REFERENCE);
}
library_foreach_idproperty_ID_link(&data, id->properties, IDWALK_CB_USER);

View File

@ -191,7 +191,7 @@ static int foreach_libblock_remap_callback(void *user_data, ID *id_self, ID **id
new_id = NULL;
}
const bool is_reference = (cb_flag & IDWALK_CB_STATIC_OVERRIDE_REFERENCE) != 0;
const bool is_reference = (cb_flag & IDWALK_CB_OVERRIDE_LIBRARY_REFERENCE) != 0;
const bool is_indirect = (cb_flag & IDWALK_CB_INDIRECT_USAGE) != 0;
const bool skip_indirect = (id_remap_data->flag & ID_REMAP_SKIP_INDIRECT_USAGE) != 0;
/* Note: proxy usage implies LIB_TAG_EXTERN, so on this aspect it is direct,
@ -202,7 +202,7 @@ static int foreach_libblock_remap_callback(void *user_data, ID *id_self, ID **id
const bool is_obj_editmode = (is_obj && BKE_object_is_in_editmode((Object *)id));
const bool is_never_null = ((cb_flag & IDWALK_CB_NEVER_NULL) && (new_id == NULL) &&
(id_remap_data->flag & ID_REMAP_FORCE_NEVER_NULL_USAGE) == 0);
const bool skip_reference = (id_remap_data->flag & ID_REMAP_SKIP_STATIC_OVERRIDE) != 0;
const bool skip_reference = (id_remap_data->flag & ID_REMAP_SKIP_OVERRIDE_LIBRARY) != 0;
const bool skip_never_null = (id_remap_data->flag & ID_REMAP_SKIP_NEVER_NULL_USAGE) != 0;
#ifdef DEBUG_PRINT
@ -756,8 +756,8 @@ void BKE_libblock_free_data(ID *id, const bool do_id_user)
MEM_freeN(id->properties);
}
if (id->override_static) {
BKE_override_static_free(&id->override_static);
if (id->override_library) {
BKE_override_library_free(&id->override_library);
}
/* XXX TODO remove animdata handling from each type's freeing func,

View File

@ -128,7 +128,7 @@ ModifierData *modifier_new(int type)
md->type = type;
md->mode = eModifierMode_Realtime | eModifierMode_Render | eModifierMode_Expanded;
md->flag = eModifierFlag_StaticOverride_Local;
md->flag = eModifierFlag_OverrideLibrary_Local;
if (mti->flags & eModifierTypeFlag_EnableInEditmode) {
md->mode |= eModifierMode_Editmode;

View File

@ -83,7 +83,7 @@ ShaderFxData *BKE_shaderfx_new(int type)
fx->type = type;
fx->mode = eShaderFxMode_Realtime | eShaderFxMode_Render | eShaderFxMode_Expanded;
fx->flag = eShaderFxFlag_StaticOverride_Local;
fx->flag = eShaderFxFlag_OverrideLibrary_Local;
if (fxi->flags & eShaderFxTypeFlag_EnableInEditmode) {
fx->mode |= eShaderFxMode_Editmode;

View File

@ -505,8 +505,8 @@ bool BKE_undosys_step_push_with_type(UndoStack *ustack,
/* Might not be final place for this to be called - probably only want to call it from some
* undo handlers, not all of them? */
if (BKE_override_static_is_enabled()) {
BKE_main_override_static_operations_create(G.main, false);
if (BKE_override_library_is_enabled()) {
BKE_main_override_library_operations_create(G.main, false);
}
/* Remove all undos after (also when 'ustack->step_active == NULL'). */

View File

@ -2622,9 +2622,10 @@ static void lib_link_id(FileData *fd, Main *main)
ID *id;
for (id = lb->first; id; id = id->next) {
if (id->override_static) {
id->override_static->reference = newlibadr_us(fd, id->lib, id->override_static->reference);
id->override_static->storage = newlibadr_us(fd, id->lib, id->override_static->storage);
if (id->override_library) {
id->override_library->reference = newlibadr_us(
fd, id->lib, id->override_library->reference);
id->override_library->storage = newlibadr_us(fd, id->lib, id->override_library->storage);
}
}
}
@ -2632,7 +2633,7 @@ static void lib_link_id(FileData *fd, Main *main)
static void direct_link_id_override_property_operation_cb(FileData *fd, void *data)
{
IDOverrideStaticPropertyOperation *opop = data;
IDOverrideLibraryPropertyOperation *opop = data;
opop->subitem_reference_name = newdataadr(fd, opop->subitem_reference_name);
opop->subitem_local_name = newdataadr(fd, opop->subitem_local_name);
@ -2640,7 +2641,7 @@ static void direct_link_id_override_property_operation_cb(FileData *fd, void *da
static void direct_link_id_override_property_cb(FileData *fd, void *data)
{
IDOverrideStaticProperty *op = data;
IDOverrideLibraryProperty *op = data;
op->rna_path = newdataadr(fd, op->rna_path);
link_list_ex(fd, &op->operations, direct_link_id_override_property_operation_cb);
@ -2662,9 +2663,9 @@ static void direct_link_id(FileData *fd, ID *id)
id->tag = 0;
/* Link direct data of overrides. */
if (id->override_static) {
id->override_static = newdataadr(fd, id->override_static);
link_list_ex(fd, &id->override_static->properties, direct_link_id_override_property_cb);
if (id->override_library) {
id->override_library = newdataadr(fd, id->override_library);
link_list_ex(fd, &id->override_library->properties, direct_link_id_override_property_cb);
}
DrawDataList *drawdata = DRW_drawdatalist_from_id(id);
@ -3675,9 +3676,9 @@ static void lib_link_constraints(FileData *fd, ID *id, ListBase *conlist)
/* own ipo, all constraints have it */
con->ipo = newlibadr_us(fd, id->lib, con->ipo); // XXX deprecated - old animation system
/* If linking from a library, clear 'local' static override flag. */
/* If linking from a library, clear 'local' library override flag. */
if (id->lib != NULL) {
con->flag &= ~CONSTRAINT_STATICOVERRIDE_LOCAL;
con->flag &= ~CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
}
}
@ -5161,10 +5162,10 @@ static void lib_link_modifiers(FileData *fd, Object *ob)
{
modifiers_foreachIDLink(ob, lib_link_modifiers_common, fd);
/* If linking from a library, clear 'local' static override flag. */
/* If linking from a library, clear 'local' library override flag. */
if (ob->id.lib != NULL) {
for (ModifierData *mod = ob->modifiers.first; mod != NULL; mod = mod->next) {
mod->flag &= ~eModifierFlag_StaticOverride_Local;
mod->flag &= ~eModifierFlag_OverrideLibrary_Local;
}
}
}
@ -5173,11 +5174,11 @@ static void lib_link_gpencil_modifiers(FileData *fd, Object *ob)
{
BKE_gpencil_modifiers_foreachIDLink(ob, lib_link_modifiers_common, fd);
/* If linking from a library, clear 'local' static override flag. */
/* If linking from a library, clear 'local' library override flag. */
if (ob->id.lib != NULL) {
for (GpencilModifierData *mod = ob->greasepencil_modifiers.first; mod != NULL;
mod = mod->next) {
mod->flag &= ~eGpencilModifierFlag_StaticOverride_Local;
mod->flag &= ~eGpencilModifierFlag_OverrideLibrary_Local;
}
}
}
@ -5186,10 +5187,10 @@ static void lib_link_shaderfxs(FileData *fd, Object *ob)
{
BKE_shaderfx_foreachIDLink(ob, lib_link_modifiers_common, fd);
/* If linking from a library, clear 'local' static override flag. */
/* If linking from a library, clear 'local' library override flag. */
if (ob->id.lib != NULL) {
for (ShaderFxData *fx = ob->shader_fx.first; fx != NULL; fx = fx->next) {
fx->flag &= ~eShaderFxFlag_StaticOverride_Local;
fx->flag &= ~eShaderFxFlag_OverrideLibrary_Local;
}
}
}
@ -9739,7 +9740,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
* we can re-generate overrides from their references. */
if (fd->memfile == NULL) {
/* Do not apply in undo case! */
BKE_main_override_static_update(bfd->main);
BKE_main_override_library_update(bfd->main);
}
BKE_collections_after_lib_link(bfd->main);
@ -10028,9 +10029,9 @@ static void expand_constraint_channels(FileData *fd, Main *mainvar, ListBase *ch
static void expand_id(FileData *fd, Main *mainvar, ID *id)
{
if (id->override_static) {
expand_doit(fd, mainvar, id->override_static->reference);
expand_doit(fd, mainvar, id->override_static->storage);
if (id->override_library) {
expand_doit(fd, mainvar, id->override_library->reference);
expand_doit(fd, mainvar, id->override_library->storage);
}
}

View File

@ -708,15 +708,16 @@ static void write_iddata(void *wd, const ID *id)
IDP_WriteProperty(id->properties, wd);
}
if (id->override_static) {
writestruct(wd, DATA, IDOverrideStatic, 1, id->override_static);
if (id->override_library) {
writestruct(wd, DATA, IDOverrideLibrary, 1, id->override_library);
writelist(wd, DATA, IDOverrideStaticProperty, &id->override_static->properties);
for (IDOverrideStaticProperty *op = id->override_static->properties.first; op; op = op->next) {
writelist(wd, DATA, IDOverrideLibraryProperty, &id->override_library->properties);
for (IDOverrideLibraryProperty *op = id->override_library->properties.first; op;
op = op->next) {
writedata(wd, DATA, strlen(op->rna_path) + 1, op->rna_path);
writelist(wd, DATA, IDOverrideStaticPropertyOperation, &op->operations);
for (IDOverrideStaticPropertyOperation *opop = op->operations.first; opop;
writelist(wd, DATA, IDOverrideLibraryPropertyOperation, &op->operations);
for (IDOverrideLibraryPropertyOperation *opop = op->operations.first; opop;
opop = opop->next) {
if (opop->subitem_reference_name) {
writedata(
@ -3775,9 +3776,8 @@ static bool write_file_handle(Main *mainvar,
* avoid thumbnail detecting changes because of this. */
mywrite_flush(wd);
OverrideStaticStorage *override_storage = wd->use_memfile ?
NULL :
BKE_override_static_operations_store_initialize();
OverrideLibraryStorage *override_storage =
wd->use_memfile ? NULL : BKE_override_library_operations_store_initialize();
/* This outer loop allows to save first data-blocks from real mainvar,
* then the temp ones from override process,
@ -3799,10 +3799,10 @@ static bool write_file_handle(Main *mainvar,
BLI_assert(
(id->tag & (LIB_TAG_NO_MAIN | LIB_TAG_NO_USER_REFCOUNT | LIB_TAG_NOT_ALLOCATED)) == 0);
const bool do_override = !ELEM(override_storage, NULL, bmain) && id->override_static;
const bool do_override = !ELEM(override_storage, NULL, bmain) && id->override_library;
if (do_override) {
BKE_override_static_operations_store_start(bmain, override_storage, id);
BKE_override_library_operations_store_start(bmain, override_storage, id);
}
switch ((ID_Type)GS(id->name)) {
@ -3922,7 +3922,7 @@ static bool write_file_handle(Main *mainvar,
}
if (do_override) {
BKE_override_static_operations_store_end(override_storage, id);
BKE_override_library_operations_store_end(override_storage, id);
}
}
@ -3931,7 +3931,7 @@ static bool write_file_handle(Main *mainvar,
} while ((bmain != override_storage) && (bmain = override_storage));
if (override_storage) {
BKE_override_static_operations_store_finalize(override_storage);
BKE_override_library_operations_store_finalize(override_storage);
override_storage = NULL;
}

View File

@ -265,8 +265,8 @@ void flush_editors_id_update(Depsgraph *graph, const DEGEditorUpdateContext *upd
deg_editors_id_update(update_ctx, id_orig);
}
/* ID may need to get its auto-override operations refreshed. */
if (ID_IS_STATIC_OVERRIDE_AUTO(id_orig)) {
id_orig->tag |= LIB_TAG_OVERRIDESTATIC_AUTOREFRESH;
if (ID_IS_OVERRIDE_LIBRARY_AUTO(id_orig)) {
id_orig->tag |= LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH;
}
/* Inform draw engines that something was changed. */
flush_engine_data_update(id_cow);

View File

@ -1462,7 +1462,7 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
void ui_but_override_flag(uiBut *but)
{
const int override_status = RNA_property_static_override_status(
const int override_status = RNA_property_override_library_status(
&but->rnapoin, but->rnaprop, but->rnaindex);
if (override_status & RNA_OVERRIDE_STATUS_OVERRIDDEN) {

View File

@ -524,7 +524,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
const bool is_array = RNA_property_array_length(&but->rnapoin, but->rnaprop) != 0;
const bool is_array_component = (is_array && but->rnaindex != -1);
const int override_status = RNA_property_static_override_status(ptr, prop, -1);
const int override_status = RNA_property_override_library_status(ptr, prop, -1);
const bool is_overridable = (override_status & RNA_OVERRIDE_STATUS_OVERRIDABLE) != 0;
/* Set the (button_pointer, button_prop)

View File

@ -430,7 +430,7 @@ static bool override_type_set_button_poll(bContext *C)
UI_context_active_but_prop_get(C, &ptr, &prop, &index);
const int override_status = RNA_property_static_override_status(&ptr, prop, index);
const int override_status = RNA_property_override_library_status(&ptr, prop, index);
return (ptr.data && prop && (override_status & RNA_OVERRIDE_STATUS_OVERRIDABLE));
}
@ -448,20 +448,20 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op)
switch (op_type) {
case UIOverride_Type_NOOP:
operation = IDOVERRIDESTATIC_OP_NOOP;
operation = IDOVERRIDE_LIBRARY_OP_NOOP;
break;
case UIOverride_Type_Replace:
operation = IDOVERRIDESTATIC_OP_REPLACE;
operation = IDOVERRIDE_LIBRARY_OP_REPLACE;
break;
case UIOverride_Type_Difference:
/* override code will automatically switch to subtract if needed. */
operation = IDOVERRIDESTATIC_OP_ADD;
operation = IDOVERRIDE_LIBRARY_OP_ADD;
break;
case UIOverride_Type_Factor:
operation = IDOVERRIDESTATIC_OP_MULTIPLY;
operation = IDOVERRIDE_LIBRARY_OP_MULTIPLY;
break;
default:
operation = IDOVERRIDESTATIC_OP_REPLACE;
operation = IDOVERRIDE_LIBRARY_OP_REPLACE;
BLI_assert(0);
break;
}
@ -475,7 +475,7 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op)
index = -1;
}
IDOverrideStaticPropertyOperation *opop = RNA_property_override_property_operation_get(
IDOverrideLibraryPropertyOperation *opop = RNA_property_override_property_operation_get(
&ptr, prop, operation, index, true, NULL, &created);
if (!created) {
opop->operation = operation;
@ -491,7 +491,7 @@ static int override_type_set_button_invoke(bContext *C,
#if 0 /* Disabled for now */
return WM_menu_invoke_ex(C, op, WM_OP_INVOKE_DEFAULT);
#else
RNA_enum_set(op->ptr, "type", IDOVERRIDESTATIC_OP_REPLACE);
RNA_enum_set(op->ptr, "type", IDOVERRIDE_LIBRARY_OP_REPLACE);
return override_type_set_button_exec(C, op);
#endif
}
@ -530,7 +530,7 @@ static bool override_remove_button_poll(bContext *C)
UI_context_active_but_prop_get(C, &ptr, &prop, &index);
const int override_status = RNA_property_static_override_status(&ptr, prop, index);
const int override_status = RNA_property_override_library_status(&ptr, prop, index);
return (ptr.data && ptr.id.data && prop && (override_status & RNA_OVERRIDE_STATUS_OVERRIDDEN));
}
@ -547,16 +547,16 @@ static int override_remove_button_exec(bContext *C, wmOperator *op)
UI_context_active_but_prop_get(C, &ptr, &prop, &index);
ID *id = ptr.id.data;
IDOverrideStaticProperty *oprop = RNA_property_override_property_find(&ptr, prop);
IDOverrideLibraryProperty *oprop = RNA_property_override_property_find(&ptr, prop);
BLI_assert(oprop != NULL);
BLI_assert(id != NULL && id->override_static != NULL);
BLI_assert(id != NULL && id->override_library != NULL);
const bool is_template = (id->override_static->reference == NULL);
const bool is_template = (id->override_library->reference == NULL);
/* We need source (i.e. linked data) to restore values of deleted overrides...
* If this is an override template, we obviously do not need to restore anything. */
if (!is_template) {
RNA_id_pointer_create(id->override_static->reference, &id_refptr);
RNA_id_pointer_create(id->override_library->reference, &id_refptr);
if (!RNA_path_resolve(&id_refptr, oprop->rna_path, &src, NULL)) {
BLI_assert(0 && "Failed to create matching source (linked data) RNA pointer");
}
@ -566,7 +566,7 @@ static int override_remove_button_exec(bContext *C, wmOperator *op)
bool is_strict_find;
/* Remove override operation for given item,
* add singular operations for the other items as needed. */
IDOverrideStaticPropertyOperation *opop = BKE_override_static_property_operation_find(
IDOverrideLibraryPropertyOperation *opop = BKE_override_library_property_operation_find(
oprop, NULL, NULL, index, index, false, &is_strict_find);
BLI_assert(opop != NULL);
if (!is_strict_find) {
@ -575,22 +575,22 @@ static int override_remove_button_exec(bContext *C, wmOperator *op)
* before removing generic one. */
for (int idx = RNA_property_array_length(&ptr, prop); idx--;) {
if (idx != index) {
BKE_override_static_property_operation_get(
BKE_override_library_property_operation_get(
oprop, opop->operation, NULL, NULL, idx, idx, true, NULL, NULL);
}
}
}
BKE_override_static_property_operation_delete(oprop, opop);
BKE_override_library_property_operation_delete(oprop, opop);
if (!is_template) {
RNA_property_copy(bmain, &ptr, &src, prop, index);
}
if (BLI_listbase_is_empty(&oprop->operations)) {
BKE_override_static_property_delete(id->override_static, oprop);
BKE_override_library_property_delete(id->override_library, oprop);
}
}
else {
/* Just remove whole generic override operation of this property. */
BKE_override_static_property_delete(id->override_static, oprop);
BKE_override_library_property_delete(id->override_library, oprop);
if (!is_template) {
RNA_property_copy(bmain, &ptr, &src, prop, -1);
}

View File

@ -515,8 +515,8 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
case UI_ID_LOCAL:
if (id) {
Main *bmain = CTX_data_main(C);
if (BKE_override_static_is_enabled() && CTX_wm_window(C)->eventstate->shift) {
ID *override_id = BKE_override_static_create_from_id(bmain, id);
if (BKE_override_library_is_enabled() && CTX_wm_window(C)->eventstate->shift) {
ID *override_id = BKE_override_library_create_from_id(bmain, id);
if (override_id != NULL) {
BKE_main_id_clear_newpoins(bmain);
@ -537,8 +537,8 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
}
break;
case UI_ID_OVERRIDE:
if (id && id->override_static) {
BKE_override_static_free(&id->override_static);
if (id && id->override_library) {
BKE_override_library_free(&id->override_library);
/* reassign to get get proper updates/notifiers */
idptr = RNA_property_pointer_get(&template_ui->ptr, template_ui->prop);
RNA_property_pointer_set(&template_ui->ptr, template_ui->prop, idptr, NULL);
@ -856,9 +856,9 @@ static void template_ID(bContext *C,
0,
0,
0,
BKE_override_static_is_enabled() ?
BKE_override_library_is_enabled() ?
TIP_("Direct linked library data-block, click to make local, "
"Shift + Click to create a static override") :
"Shift + Click to create a library override") :
TIP_("Direct linked library data-block, click to make local"));
if (disabled) {
UI_but_flag_enable(but, UI_BUT_DISABLED);
@ -869,22 +869,21 @@ static void template_ID(bContext *C,
}
}
}
else if (ID_IS_STATIC_OVERRIDE(id)) {
but = uiDefIconBut(
block,
UI_BTYPE_BUT,
0,
ICON_LIBRARY_DATA_OVERRIDE,
0,
0,
UI_UNIT_X,
UI_UNIT_Y,
NULL,
0,
0,
0,
0,
TIP_("Static override of linked library data-block, click to make fully local"));
else if (ID_IS_OVERRIDE_LIBRARY(id)) {
but = uiDefIconBut(block,
UI_BTYPE_BUT,
0,
ICON_LIBRARY_DATA_OVERRIDE,
0,
0,
UI_UNIT_X,
UI_UNIT_Y,
NULL,
0,
0,
0,
0,
TIP_("Library override of linked data-block, click to make fully local"));
UI_but_funcN_set(
but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_OVERRIDE));
}

View File

@ -651,9 +651,9 @@ static bool edit_constraint_poll_generic(bContext *C, StructRNA *rna_type)
return 0;
}
if (ID_IS_STATIC_OVERRIDE(ob)) {
CTX_wm_operator_poll_msg_set(C, "Cannot edit constraints coming from static override");
return (((bConstraint *)ptr.data)->flag & CONSTRAINT_STATICOVERRIDE_LOCAL) != 0;
if (ID_IS_OVERRIDE_LIBRARY(ob)) {
CTX_wm_operator_poll_msg_set(C, "Cannot edit constraints coming from library override");
return (((bConstraint *)ptr.data)->flag & CONSTRAINT_OVERRIDE_LIBRARY_LOCAL) != 0;
}
return 1;

View File

@ -402,10 +402,10 @@ static int gpencil_edit_modifier_poll_generic(bContext *C, StructRNA *rna_type,
return 0;
}
if (ID_IS_STATIC_OVERRIDE(ob)) {
CTX_wm_operator_poll_msg_set(C, "Cannot edit modifiers coming from static override");
return (((GpencilModifierData *)ptr.data)->flag & eGpencilModifierFlag_StaticOverride_Local) !=
0;
if (ID_IS_OVERRIDE_LIBRARY(ob)) {
CTX_wm_operator_poll_msg_set(C, "Cannot edit modifiers coming from library override");
return (((GpencilModifierData *)ptr.data)->flag &
eGpencilModifierFlag_OverrideLibrary_Local) != 0;
}
return 1;

View File

@ -59,7 +59,7 @@ void OBJECT_OT_vertex_parent_set(struct wmOperatorType *ot);
void OBJECT_OT_track_set(struct wmOperatorType *ot);
void OBJECT_OT_track_clear(struct wmOperatorType *ot);
void OBJECT_OT_make_local(struct wmOperatorType *ot);
void OBJECT_OT_make_override_static(struct wmOperatorType *ot);
void OBJECT_OT_make_override_library(struct wmOperatorType *ot);
void OBJECT_OT_make_single_user(struct wmOperatorType *ot);
void OBJECT_OT_make_links_scene(struct wmOperatorType *ot);
void OBJECT_OT_make_links_data(struct wmOperatorType *ot);

View File

@ -927,9 +927,9 @@ bool edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_fla
return 0;
}
if (ID_IS_STATIC_OVERRIDE(ob)) {
CTX_wm_operator_poll_msg_set(C, "Cannot edit modifiers coming from static override");
return (((ModifierData *)ptr.data)->flag & eModifierFlag_StaticOverride_Local) != 0;
if (ID_IS_OVERRIDE_LIBRARY(ob)) {
CTX_wm_operator_poll_msg_set(C, "Cannot edit modifiers coming from library override");
return (((ModifierData *)ptr.data)->flag & eModifierFlag_OverrideLibrary_Local) != 0;
}
return 1;

View File

@ -78,7 +78,7 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_track_set);
WM_operatortype_append(OBJECT_OT_track_clear);
WM_operatortype_append(OBJECT_OT_make_local);
WM_operatortype_append(OBJECT_OT_make_override_static);
WM_operatortype_append(OBJECT_OT_make_override_library);
WM_operatortype_append(OBJECT_OT_make_single_user);
WM_operatortype_append(OBJECT_OT_make_links_scene);
WM_operatortype_append(OBJECT_OT_make_links_data);

View File

@ -405,7 +405,7 @@ static int make_proxy_exec(bContext *C, wmOperator *op)
* will depend on order of bases.
*
* TODO(sergey): We really need to get rid of this bi-directional links
* in proxies with something like static overrides.
* in proxies with something like library overrides.
*/
newob->proxy->proxy_from = newob;
@ -2320,7 +2320,7 @@ void OBJECT_OT_make_local(wmOperatorType *ot)
ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "");
}
static void make_override_static_tag_object(Object *obact, Object *ob)
static void make_override_library_tag_object(Object *obact, Object *ob)
{
if (ob == obact) {
return;
@ -2354,17 +2354,17 @@ static void make_override_static_tag_object(Object *obact, Object *ob)
}
}
static void make_override_static_tag_collections(Collection *collection)
static void make_override_library_tag_collections(Collection *collection)
{
collection->id.tag |= LIB_TAG_DOIT;
for (CollectionChild *coll_child = collection->children.first; coll_child != NULL;
coll_child = coll_child->next) {
make_override_static_tag_collections(coll_child->collection);
make_override_library_tag_collections(coll_child->collection);
}
}
/* Set the object to override. */
static int make_override_static_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int make_override_library_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
Scene *scene = CTX_data_scene(C);
Object *obact = ED_object_active_context(C);
@ -2400,12 +2400,12 @@ static int make_override_static_invoke(bContext *C, wmOperator *op, const wmEven
/* Error.. cannot continue. */
BKE_report(op->reports,
RPT_ERROR,
"Can only make static override for a referenced object or collection");
"Can only make library override for a referenced object or collection");
return OPERATOR_CANCELLED;
}
}
static int make_override_static_exec(bContext *C, wmOperator *op)
static int make_override_library_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Object *obact = CTX_data_active_object(C);
@ -2421,10 +2421,10 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
Base *base = BLI_findlink(&dup_collection_objects, RNA_enum_get(op->ptr, "object"));
obact = base->object;
/* First, we make a static override of the linked collection itself, and all its children. */
make_override_static_tag_collections(collection);
/* First, we make a library override of the linked collection itself, and all its children. */
make_override_library_tag_collections(collection);
/* Then, we make static override of the whole set of objects in the Collection. */
/* Then, we make library override of the whole set of objects in the Collection. */
FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (collection, ob) {
ob->id.tag |= LIB_TAG_DOIT;
}
@ -2443,7 +2443,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
}
FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
success = BKE_override_static_create_from_tag(bmain);
success = BKE_override_library_create_from_tag(bmain);
/* Instantiate our newly overridden objects in scene, if not yet done. */
Scene *scene = CTX_data_scene(C);
@ -2452,7 +2452,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
BKE_collection_child_add(bmain, scene->master_collection, new_collection);
FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (new_collection, new_ob) {
if (new_ob != NULL && new_ob->id.override_static != NULL) {
if (new_ob != NULL && new_ob->id.override_library != NULL) {
if ((base = BKE_view_layer_base_find(view_layer, new_ob)) == NULL) {
BKE_collection_object_add_from(bmain, scene, obcollection, new_ob);
base = BKE_view_layer_base_find(view_layer, new_ob);
@ -2468,10 +2468,10 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
}
else {
/* Disable auto-override tags for non-active objects, will help with performaces... */
new_ob->id.override_static->flag &= ~STATICOVERRIDE_AUTO;
new_ob->id.override_library->flag &= ~OVERRIDE_LIBRARY_AUTO;
}
/* We still want to store all objects' current override status (i.e. change of parent). */
BKE_override_static_operations_create(bmain, &new_ob->id, true);
BKE_override_library_operations_create(bmain, &new_ob->id, true);
}
}
FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
@ -2496,10 +2496,10 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
obact->id.tag |= LIB_TAG_DOIT;
for (Object *ob = bmain->objects.first; ob != NULL; ob = ob->id.next) {
make_override_static_tag_object(obact, ob);
make_override_library_tag_object(obact, ob);
}
success = BKE_override_static_create_from_tag(bmain);
success = BKE_override_library_create_from_tag(bmain);
/* Also, we'd likely want to lock by default things like
* transformations of implicitly overridden objects? */
@ -2510,7 +2510,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
}
/* TODO: probably more cases where we want to do automated smart things in the future! */
else {
success = (BKE_override_static_create_from_id(bmain, &obact->id) != NULL);
success = (BKE_override_library_create_from_id(bmain, &obact->id) != NULL);
}
WM_event_add_notifier(C, NC_WINDOW, NULL);
@ -2518,28 +2518,28 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
return success ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
static bool make_override_static_poll(bContext *C)
static bool make_override_library_poll(bContext *C)
{
Object *obact = CTX_data_active_object(C);
/* Object must be directly linked to be overridable. */
return (BKE_override_static_is_enabled() && ED_operator_objectmode(C) && obact != NULL &&
return (BKE_override_library_is_enabled() && ED_operator_objectmode(C) && obact != NULL &&
((ID_IS_LINKED(obact) && obact->id.tag & LIB_TAG_EXTERN) ||
(!ID_IS_LINKED(obact) && obact->instance_collection != NULL &&
ID_IS_LINKED(obact->instance_collection))));
}
void OBJECT_OT_make_override_static(wmOperatorType *ot)
void OBJECT_OT_make_override_library(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Make Static Override";
ot->description = "Make local override of this library linked data-block";
ot->idname = "OBJECT_OT_make_override_static";
ot->name = "Make Library Override";
ot->description = "Make a local override of this library linked data-block";
ot->idname = "OBJECT_OT_make_override_library";
/* api callbacks */
ot->invoke = make_override_static_invoke;
ot->exec = make_override_static_exec;
ot->poll = make_override_static_poll;
ot->invoke = make_override_library_invoke;
ot->exec = make_override_library_exec;
ot->poll = make_override_library_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;

View File

@ -310,9 +310,9 @@ static bool edit_shaderfx_poll_generic(bContext *C, StructRNA *rna_type, int obt
return 0;
}
if (ID_IS_STATIC_OVERRIDE(ob)) {
CTX_wm_operator_poll_msg_set(C, "Cannot edit shaderfxs coming from static override");
return (((ShaderFxData *)ptr.data)->flag & eShaderFxFlag_StaticOverride_Local) != 0;
if (ID_IS_OVERRIDE_LIBRARY(ob)) {
CTX_wm_operator_poll_msg_set(C, "Cannot edit shaderfxs coming from library override");
return (((ShaderFxData *)ptr.data)->flag & eShaderFxFlag_OverrideLibrary_Local) != 0;
}
return 1;

View File

@ -2904,7 +2904,7 @@ static void outliner_draw_tree_element(bContext *C,
}
offsx += UI_UNIT_X + 4 * ufac;
}
else if (ELEM(tselem->type, 0, TSE_LAYER_COLLECTION) && ID_IS_STATIC_OVERRIDE(tselem->id)) {
else if (ELEM(tselem->type, 0, TSE_LAYER_COLLECTION) && ID_IS_OVERRIDE_LIBRARY(tselem->id)) {
UI_icon_draw_alpha((float)startx + offsx + 2 * ufac,
(float)*starty + 2 * ufac,
ICON_LIBRARY_DATA_OVERRIDE,

View File

@ -557,17 +557,17 @@ static void id_local_cb(bContext *C,
}
}
static void id_static_override_cb(bContext *C,
ReportList *UNUSED(reports),
Scene *UNUSED(scene),
TreeElement *UNUSED(te),
TreeStoreElem *UNUSED(tsep),
TreeStoreElem *tselem,
void *UNUSED(user_data))
static void id_override_library_cb(bContext *C,
ReportList *UNUSED(reports),
Scene *UNUSED(scene),
TreeElement *UNUSED(te),
TreeStoreElem *UNUSED(tsep),
TreeStoreElem *tselem,
void *UNUSED(user_data))
{
if (ID_IS_LINKED(tselem->id) && (tselem->id->tag & LIB_TAG_EXTERN)) {
Main *bmain = CTX_data_main(C);
ID *override_id = BKE_override_static_create_from_id(bmain, tselem->id);
ID *override_id = BKE_override_library_create_from_id(bmain, tselem->id);
if (override_id != NULL) {
BKE_main_id_clear_newpoins(bmain);
}
@ -1337,7 +1337,7 @@ typedef enum eOutlinerIdOpTypes {
OUTLINER_IDOP_UNLINK,
OUTLINER_IDOP_LOCAL,
OUTLINER_IDOP_STATIC_OVERRIDE,
OUTLINER_IDOP_OVERRIDE_LIBRARY,
OUTLINER_IDOP_SINGLE,
OUTLINER_IDOP_DELETE,
OUTLINER_IDOP_REMAP,
@ -1356,11 +1356,11 @@ typedef enum eOutlinerIdOpTypes {
static const EnumPropertyItem prop_id_op_types[] = {
{OUTLINER_IDOP_UNLINK, "UNLINK", 0, "Unlink", ""},
{OUTLINER_IDOP_LOCAL, "LOCAL", 0, "Make Local", ""},
{OUTLINER_IDOP_STATIC_OVERRIDE,
"STATIC_OVERRIDE",
{OUTLINER_IDOP_OVERRIDE_LIBRARY,
"OVERRIDE_LIBRARY",
0,
"Add Static Override",
"Add a local static override of this data-block"},
"Add Library Override",
"Add a local override of this linked data-block"},
{OUTLINER_IDOP_SINGLE, "SINGLE", 0, "Make Single User", ""},
{OUTLINER_IDOP_DELETE, "DELETE", ICON_X, "Delete", ""},
{OUTLINER_IDOP_REMAP,
@ -1389,7 +1389,7 @@ static const EnumPropertyItem *outliner_id_operation_itemf(bContext *UNUSED(C),
PropertyRNA *UNUSED(prop),
bool *r_free)
{
if (BKE_override_static_is_enabled()) {
if (BKE_override_library_is_enabled()) {
*r_free = false;
return prop_id_op_types;
}
@ -1398,7 +1398,7 @@ static const EnumPropertyItem *outliner_id_operation_itemf(bContext *UNUSED(C),
int totitem = 0;
for (const EnumPropertyItem *it = prop_id_op_types; it->identifier != NULL; it++) {
if (it->value == OUTLINER_IDOP_STATIC_OVERRIDE) {
if (it->value == OUTLINER_IDOP_OVERRIDE_LIBRARY) {
continue;
}
RNA_enum_item_add(&items, &totitem, it);
@ -1485,11 +1485,11 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
ED_undo_push(C, "Localized Data");
break;
}
case OUTLINER_IDOP_STATIC_OVERRIDE: {
if (BKE_override_static_is_enabled()) {
case OUTLINER_IDOP_OVERRIDE_LIBRARY: {
if (BKE_override_library_is_enabled()) {
/* make local */
outliner_do_libdata_operation(
C, op->reports, scene, soops, &soops->tree, id_static_override_cb, NULL);
C, op->reports, scene, soops, &soops->tree, id_override_library_cb, NULL);
ED_undo_push(C, "Overridden Data");
}
break;

View File

@ -133,7 +133,7 @@ enum {
enum {
/** This IDProp may be statically overridden.
* Should only be used/be relevant for custom properties. */
IDP_FLAG_OVERRIDABLE_STATIC = 1 << 0,
IDP_FLAG_OVERRIDABLE_LIBRARY = 1 << 0,
/** This means the property is set but RNA will return false when checking
* 'RNA_property_is_set', currently this is a runtime flag */
@ -144,8 +144,8 @@ enum {
/* Static ID override structs. */
typedef struct IDOverrideStaticPropertyOperation {
struct IDOverrideStaticPropertyOperation *next, *prev;
typedef struct IDOverrideLibraryPropertyOperation {
struct IDOverrideLibraryPropertyOperation *next, *prev;
/* Type of override. */
short operation;
@ -162,39 +162,39 @@ typedef struct IDOverrideStaticPropertyOperation {
char *subitem_local_name;
int subitem_reference_index;
int subitem_local_index;
} IDOverrideStaticPropertyOperation;
} IDOverrideLibraryPropertyOperation;
/* IDOverridePropertyOperation->operation. */
enum {
/* Basic operations. */
IDOVERRIDESTATIC_OP_NOOP = 0, /* Special value, forbids any overriding. */
IDOVERRIDE_LIBRARY_OP_NOOP = 0, /* Special value, forbids any overriding. */
IDOVERRIDESTATIC_OP_REPLACE = 1, /* Fully replace local value by reference one. */
IDOVERRIDE_LIBRARY_OP_REPLACE = 1, /* Fully replace local value by reference one. */
/* Numeric-only operations. */
IDOVERRIDESTATIC_OP_ADD = 101, /* Add local value to reference one. */
IDOVERRIDE_LIBRARY_OP_ADD = 101, /* Add local value to reference one. */
/* Subtract local value from reference one (needed due to unsigned values etc.). */
IDOVERRIDESTATIC_OP_SUBTRACT = 102,
IDOVERRIDE_LIBRARY_OP_SUBTRACT = 102,
/* Multiply reference value by local one (more useful than diff for scales and the like). */
IDOVERRIDESTATIC_OP_MULTIPLY = 103,
IDOVERRIDE_LIBRARY_OP_MULTIPLY = 103,
/* Collection-only operations. */
IDOVERRIDESTATIC_OP_INSERT_AFTER = 201, /* Insert after given reference's subitem. */
IDOVERRIDESTATIC_OP_INSERT_BEFORE = 202, /* Insert before given reference's subitem. */
IDOVERRIDE_LIBRARY_OP_INSERT_AFTER = 201, /* Insert after given reference's subitem. */
IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE = 202, /* Insert before given reference's subitem. */
/* We can add more if needed (move, delete, ...). */
};
/* IDOverridePropertyOperation->flag. */
enum {
/** User cannot remove that override operation. */
IDOVERRIDESTATIC_FLAG_MANDATORY = 1 << 0,
IDOVERRIDE_LIBRARY_FLAG_MANDATORY = 1 << 0,
/** User cannot change that override operation. */
IDOVERRIDESTATIC_FLAG_LOCKED = 1 << 1,
IDOVERRIDE_LIBRARY_FLAG_LOCKED = 1 << 1,
};
/** A single overridden property, contain all operations on this one. */
typedef struct IDOverrideStaticProperty {
struct IDOverrideStaticProperty *next, *prev;
typedef struct IDOverrideLibraryProperty {
struct IDOverrideLibraryProperty *next, *prev;
/**
* Path from ID to overridden property.
@ -204,10 +204,10 @@ typedef struct IDOverrideStaticProperty {
/** List of overriding operations (IDOverridePropertyOperation) applied to this property. */
ListBase operations;
} IDOverrideStaticProperty;
} IDOverrideLibraryProperty;
/* Main container for all overriding data info of a data-block. */
typedef struct IDOverrideStatic {
typedef struct IDOverrideLibrary {
/** Reference linked ID which this one overrides. */
struct ID *reference;
/** List of IDOverrideProperty structs. */
@ -220,10 +220,10 @@ typedef struct IDOverrideStatic {
/* Temp ID storing extra override data (used for differential operations only currently).
* Always NULL outside of read/write context. */
struct ID *storage;
} IDOverrideStatic;
} IDOverrideLibrary;
enum eStaticOverride_Flag {
STATICOVERRIDE_AUTO = 1 << 0, /* Allow automatic generation of overriding rules. */
enum eOverrideLibrary_Flag {
OVERRIDE_LIBRARY_AUTO = 1 << 0, /* Allow automatic generation of overriding rules. */
};
/* watch it: Sequence has identical beginning. */
@ -259,7 +259,7 @@ typedef struct ID {
IDProperty *properties;
/** Reference linked ID which this one overrides. */
IDOverrideStatic *override_static;
IDOverrideLibrary *override_library;
/**
* Only set for data-blocks which are coming from copy-on-write, points to
@ -436,15 +436,15 @@ typedef enum ID_Type {
#define ID_IS_LINKED(_id) (((ID *)(_id))->lib != NULL)
#define ID_IS_STATIC_OVERRIDE(_id) \
(((ID *)(_id))->override_static != NULL && ((ID *)(_id))->override_static->reference != NULL)
#define ID_IS_OVERRIDE_LIBRARY(_id) \
(((ID *)(_id))->override_library != NULL && ((ID *)(_id))->override_library->reference != NULL)
#define ID_IS_STATIC_OVERRIDE_TEMPLATE(_id) \
(((ID *)(_id))->override_static != NULL && ((ID *)(_id))->override_static->reference == NULL)
#define ID_IS_OVERRIDE_LIBRARY_TEMPLATE(_id) \
(((ID *)(_id))->override_library != NULL && ((ID *)(_id))->override_library->reference == NULL)
#define ID_IS_STATIC_OVERRIDE_AUTO(_id) \
(!ID_IS_LINKED((_id)) && ID_IS_STATIC_OVERRIDE((_id)) && \
(((ID *)(_id))->override_static->flag & STATICOVERRIDE_AUTO))
#define ID_IS_OVERRIDE_LIBRARY_AUTO(_id) \
(!ID_IS_LINKED((_id)) && ID_IS_OVERRIDE_LIBRARY((_id)) && \
(((ID *)(_id))->override_library->flag & OVERRIDE_LIBRARY_AUTO))
/* No copy-on-write for these types.
* Keep in sync with check_datablocks_copy_on_writable and deg_copy_on_write_is_needed */
@ -509,9 +509,9 @@ enum {
LIB_TAG_MISSING = 1 << 6,
/* RESET_NEVER tag data-block as being up-to-date regarding its reference. */
LIB_TAG_OVERRIDESTATIC_REFOK = 1 << 9,
LIB_TAG_OVERRIDE_LIBRARY_REFOK = 1 << 9,
/* RESET_NEVER tag data-block as needing an auto-override execution, if enabled. */
LIB_TAG_OVERRIDESTATIC_AUTOREFRESH = 1 << 17,
LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH = 1 << 17,
/* tag data-block has having an extra user. */
LIB_TAG_EXTRAUSER = 1 << 2,

View File

@ -691,7 +691,7 @@ typedef enum eBConstraint_Flags {
/* use bbone curve shape when calculating headtail values (also used by dependency graph!) */
CONSTRAINT_BBONE_SHAPE = (1 << 10),
/* That constraint has been inserted in local override (i.e. it can be fully edited!). */
CONSTRAINT_STATICOVERRIDE_LOCAL = (1 << 11),
CONSTRAINT_OVERRIDE_LIBRARY_LOCAL = (1 << 11),
/* use full transformation (not just segment locations) - only set at runtime */
CONSTRAINT_BBONE_SHAPE_FULL = (1 << 12),
} eBConstraint_Flags;

View File

@ -60,7 +60,7 @@ typedef enum GpencilModifierMode {
typedef enum {
/* This modifier has been inserted in local override, and hence can be fully edited. */
eGpencilModifierFlag_StaticOverride_Local = (1 << 0),
eGpencilModifierFlag_OverrideLibrary_Local = (1 << 0),
} GpencilModifierFlag;
typedef struct GpencilModifierData {

View File

@ -121,7 +121,7 @@ typedef struct ModifierData {
typedef enum {
/* This modifier has been inserted in local override, and hence can be fully edited. */
eModifierFlag_StaticOverride_Local = (1 << 0),
eModifierFlag_OverrideLibrary_Local = (1 << 0),
/* This modifier does not own its caches, but instead shares them with another modifier. */
eModifierFlag_SharedCaches = (1 << 1),
} ModifierFlag;

View File

@ -54,7 +54,7 @@ typedef enum ShaderFxMode {
typedef enum {
/* This fx has been inserted in local override, and hence can be fully edited. */
eShaderFxFlag_StaticOverride_Local = (1 << 0),
eShaderFxFlag_OverrideLibrary_Local = (1 << 0),
} ShaderFxFlag;
typedef struct ShaderFxData {

View File

@ -32,9 +32,9 @@ extern "C" {
#endif
struct ID;
struct IDOverrideStatic;
struct IDOverrideStaticProperty;
struct IDOverrideStaticPropertyOperation;
struct IDOverrideLibrary;
struct IDOverrideLibraryProperty;
struct IDOverrideLibraryPropertyOperation;
struct ListBase;
struct Main;
struct ReportList;
@ -287,8 +287,8 @@ extern StructRNA RNA_Histogram;
extern StructRNA RNA_HookGpencilModifier;
extern StructRNA RNA_HookModifier;
extern StructRNA RNA_ID;
extern StructRNA RNA_IDOverrideStatic;
extern StructRNA RNA_IDOverrideStaticProperty;
extern StructRNA RNA_IDOverrideLibrary;
extern StructRNA RNA_IDOverrideLibraryProperty;
extern StructRNA RNA_IKParam;
extern StructRNA RNA_Image;
extern StructRNA RNA_ImageFormatSettings;
@ -958,9 +958,9 @@ bool RNA_property_editable_flag(PointerRNA *ptr,
bool RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop);
bool RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop);
bool RNA_property_overridable_get(PointerRNA *ptr, PropertyRNA *prop);
bool RNA_property_overridable_static_set(PointerRNA *ptr,
PropertyRNA *prop,
const bool is_overridable);
bool RNA_property_overridable_library_set(PointerRNA *ptr,
PropertyRNA *prop,
const bool is_overridable);
bool RNA_property_overridden(PointerRNA *ptr, PropertyRNA *prop);
bool RNA_property_comparable(PointerRNA *ptr, PropertyRNA *prop);
bool RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop); /* slow, use with care */
@ -1470,7 +1470,7 @@ bool RNA_struct_override_matches(struct Main *bmain,
struct PointerRNA *ptr_local,
struct PointerRNA *ptr_reference,
const char *root_path,
struct IDOverrideStatic *override,
struct IDOverrideLibrary *override,
const eRNAOverrideMatch flags,
eRNAOverrideMatchResult *r_report_flags);
@ -1478,23 +1478,23 @@ bool RNA_struct_override_store(struct Main *bmain,
struct PointerRNA *ptr_local,
struct PointerRNA *ptr_reference,
PointerRNA *ptr_storage,
struct IDOverrideStatic *override);
struct IDOverrideLibrary *override);
void RNA_struct_override_apply(struct Main *bmain,
struct PointerRNA *ptr_local,
struct PointerRNA *ptr_override,
struct PointerRNA *ptr_storage,
struct IDOverrideStatic *override);
struct IDOverrideLibrary *override);
struct IDOverrideStaticProperty *RNA_property_override_property_find(PointerRNA *ptr,
PropertyRNA *prop);
struct IDOverrideStaticProperty *RNA_property_override_property_get(PointerRNA *ptr,
PropertyRNA *prop,
bool *r_created);
struct IDOverrideLibraryProperty *RNA_property_override_property_find(PointerRNA *ptr,
PropertyRNA *prop);
struct IDOverrideLibraryProperty *RNA_property_override_property_get(PointerRNA *ptr,
PropertyRNA *prop,
bool *r_created);
struct IDOverrideStaticPropertyOperation *RNA_property_override_property_operation_find(
struct IDOverrideLibraryPropertyOperation *RNA_property_override_property_operation_find(
PointerRNA *ptr, PropertyRNA *prop, const int index, const bool strict, bool *r_strict);
struct IDOverrideStaticPropertyOperation *RNA_property_override_property_operation_get(
struct IDOverrideLibraryPropertyOperation *RNA_property_override_property_operation_get(
PointerRNA *ptr,
PropertyRNA *prop,
const short operation,
@ -1503,9 +1503,9 @@ struct IDOverrideStaticPropertyOperation *RNA_property_override_property_operati
bool *r_strict,
bool *r_created);
eRNAOverrideStatus RNA_property_static_override_status(PointerRNA *ptr,
PropertyRNA *prop,
const int index);
eRNAOverrideStatus RNA_property_override_library_status(PointerRNA *ptr,
PropertyRNA *prop,
const int index);
void RNA_struct_state_owner_set(const char *name);
const char *RNA_struct_state_owner_get(void);

View File

@ -216,7 +216,7 @@ typedef enum PropertyFlag {
/* Pointers to data that is not owned by the struct.
* Typical example: Bone.parent, Bone.child, etc., and nearly all ID pointers.
* This is crucial information for processes that walk the whole data of an ID e.g.
* (like static override).
* (like library override).
* Note that all ID pointers are enforced to this by default,
* this probably will need to be rechecked (see ugly infamous NodeTrees of mat/tex/scene/etc.).
*/
@ -259,7 +259,7 @@ typedef enum PropertyFlag {
/* FREE FLAGS: 2, 3, 4, 5, 6, 7, 8, 9, 12 and above. */
typedef enum PropertyOverrideFlag {
/* Means the property can be overridden by a local 'proxy' of some linked datablock. */
PROPOVERRIDE_OVERRIDABLE_STATIC = (1 << 0),
PROPOVERRIDE_OVERRIDABLE_LIBRARY = (1 << 0),
/* Forbid usage of this property in comparison (& hence override) code.
* Useful e.g. for collections of data like mesh's geometry, particles, etc. */
@ -268,7 +268,7 @@ typedef enum PropertyOverrideFlag {
/*** Collections-related ***/
/* The property supports insertion (collections only). */
PROPOVERRIDE_STATIC_INSERTION = (1 << 10),
PROPOVERRIDE_LIBRARY_INSERTION = (1 << 10),
/* Only use indices to compare items in the property, never names (collections only). */
/* Useful when nameprop of the items is generated from other data

View File

@ -103,27 +103,27 @@ const EnumPropertyItem rna_enum_id_type_items[] = {
# include "WM_api.h"
void rna_ID_override_static_property_operation_refname_get(PointerRNA *ptr, char *value)
void rna_ID_override_library_property_operation_refname_get(PointerRNA *ptr, char *value)
{
IDOverrideStaticPropertyOperation *opop = ptr->data;
IDOverrideLibraryPropertyOperation *opop = ptr->data;
strcpy(value, (opop->subitem_reference_name == NULL) ? "" : opop->subitem_reference_name);
}
int rna_ID_override_static_property_operation_refname_length(PointerRNA *ptr)
int rna_ID_override_library_property_operation_refname_length(PointerRNA *ptr)
{
IDOverrideStaticPropertyOperation *opop = ptr->data;
IDOverrideLibraryPropertyOperation *opop = ptr->data;
return (opop->subitem_reference_name == NULL) ? 0 : strlen(opop->subitem_reference_name);
}
void rna_ID_override_static_property_operation_locname_get(PointerRNA *ptr, char *value)
void rna_ID_override_library_property_operation_locname_get(PointerRNA *ptr, char *value)
{
IDOverrideStaticPropertyOperation *opop = ptr->data;
IDOverrideLibraryPropertyOperation *opop = ptr->data;
strcpy(value, (opop->subitem_local_name == NULL) ? "" : opop->subitem_local_name);
}
int rna_ID_override_static_property_operation_locname_length(PointerRNA *ptr)
int rna_ID_override_library_property_operation_locname_length(PointerRNA *ptr)
{
IDOverrideStaticPropertyOperation *opop = ptr->data;
IDOverrideLibraryPropertyOperation *opop = ptr->data;
return (opop->subitem_local_name == NULL) ? 0 : strlen(opop->subitem_local_name);
}
@ -493,11 +493,11 @@ static ID *rna_ID_copy(ID *id, Main *bmain)
static ID *rna_ID_override_create(ID *id, Main *bmain)
{
if (!BKE_override_static_is_enabled() || id->lib == NULL) {
if (!BKE_override_library_is_enabled() || id->lib == NULL) {
return NULL;
}
return BKE_override_static_create_from_id(bmain, id);
return BKE_override_library_create_from_id(bmain, id);
}
static void rna_ID_update_tag(ID *id, Main *bmain, ReportList *reports, int flag)
@ -1220,44 +1220,44 @@ static void rna_def_image_preview(BlenderRNA *brna)
RNA_def_function_ui_description(func, "Reload the preview from its source path");
}
static void rna_def_ID_override_static_property_operation(BlenderRNA *brna)
static void rna_def_ID_override_library_property_operation(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static const EnumPropertyItem static_override_property_operation_items[] = {
{IDOVERRIDESTATIC_OP_NOOP,
static const EnumPropertyItem override_library_property_operation_items[] = {
{IDOVERRIDE_LIBRARY_OP_NOOP,
"NOOP",
0,
"No-Op",
"Does nothing, prevents adding actual overrides (NOT USED)"},
{IDOVERRIDESTATIC_OP_REPLACE,
{IDOVERRIDE_LIBRARY_OP_REPLACE,
"REPLACE",
0,
"Replace",
"Replace value of reference by overriding one"},
{IDOVERRIDESTATIC_OP_ADD,
{IDOVERRIDE_LIBRARY_OP_ADD,
"DIFF_ADD",
0,
"Differential",
"Stores and apply difference between reference and local value (NOT USED)"},
{IDOVERRIDESTATIC_OP_SUBTRACT,
{IDOVERRIDE_LIBRARY_OP_SUBTRACT,
"DIFF_SUB",
0,
"Differential",
"Stores and apply difference between reference and local value (NOT USED)"},
{IDOVERRIDESTATIC_OP_MULTIPLY,
{IDOVERRIDE_LIBRARY_OP_MULTIPLY,
"FACT_MULTIPLY",
0,
"Factor",
"Stores and apply multiplication factor between reference and local value (NOT USED)"},
{IDOVERRIDESTATIC_OP_INSERT_AFTER,
{IDOVERRIDE_LIBRARY_OP_INSERT_AFTER,
"INSERT_AFTER",
0,
"Insert After",
"Insert a new item into collection after the one referenced in subitem_reference_name or "
"_index"},
{IDOVERRIDESTATIC_OP_INSERT_BEFORE,
{IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE,
"INSERT_BEFORE",
0,
"Insert Before",
@ -1266,13 +1266,13 @@ static void rna_def_ID_override_static_property_operation(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem static_override_property_flag_items[] = {
{IDOVERRIDESTATIC_FLAG_MANDATORY,
static const EnumPropertyItem override_library_property_flag_items[] = {
{IDOVERRIDE_LIBRARY_FLAG_MANDATORY,
"MANDATORY",
0,
"Mandatory",
"For templates, prevents the user from removing pre-defined operation (NOT USED)"},
{IDOVERRIDESTATIC_FLAG_LOCKED,
{IDOVERRIDE_LIBRARY_FLAG_LOCKED,
"LOCKED",
0,
"Locked",
@ -1280,21 +1280,21 @@ static void rna_def_ID_override_static_property_operation(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL},
};
srna = RNA_def_struct(brna, "IDOverrideStaticPropertyOperation", NULL);
srna = RNA_def_struct(brna, "IDOverrideLibraryPropertyOperation", NULL);
RNA_def_struct_ui_text(srna,
"ID Static Override Property Operation",
"ID Library Override Property Operation",
"Description of an override operation over an overridden property");
prop = RNA_def_enum(srna,
"operation",
static_override_property_operation_items,
IDOVERRIDESTATIC_OP_REPLACE,
override_library_property_operation_items,
IDOVERRIDE_LIBRARY_OP_REPLACE,
"Operation",
"What override operation is performed");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* For now. */
prop = RNA_def_enum(
srna, "flag", static_override_property_flag_items, 0, "Flags", "Optional flags (NOT USED)");
srna, "flag", override_library_property_flag_items, 0, "Flags", "Optional flags (NOT USED)");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* For now. */
prop = RNA_def_string(srna,
@ -1305,8 +1305,8 @@ static void rna_def_ID_override_static_property_operation(BlenderRNA *brna)
"Used to handle insertions into collection");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* For now. */
RNA_def_property_string_funcs(prop,
"rna_ID_override_static_property_operation_refname_get",
"rna_ID_override_static_property_operation_refname_length",
"rna_ID_override_library_property_operation_refname_get",
"rna_ID_override_library_property_operation_refname_length",
NULL);
prop = RNA_def_string(srna,
@ -1317,8 +1317,8 @@ static void rna_def_ID_override_static_property_operation(BlenderRNA *brna)
"Used to handle insertions into collection");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* For now. */
RNA_def_property_string_funcs(prop,
"rna_ID_override_static_property_operation_locname_get",
"rna_ID_override_static_property_operation_locname_length",
"rna_ID_override_library_property_operation_locname_get",
"rna_ID_override_library_property_operation_locname_length",
NULL);
prop = RNA_def_int(srna,
@ -1344,14 +1344,14 @@ static void rna_def_ID_override_static_property_operation(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* For now. */
}
static void rna_def_ID_override_static_property(BlenderRNA *brna)
static void rna_def_ID_override_library_property(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "IDOverrideStaticProperty", NULL);
srna = RNA_def_struct(brna, "IDOverrideLibraryProperty", NULL);
RNA_def_struct_ui_text(
srna, "ID Static Override Property", "Description of an overridden property");
srna, "ID Library Override Property", "Description of an overridden property");
/* String pointer, we *should* add get/set/etc.
* But NULL rna_path would be a nasty bug anyway. */
@ -1365,21 +1365,21 @@ static void rna_def_ID_override_static_property(BlenderRNA *brna)
RNA_def_collection(srna,
"operations",
"IDOverrideStaticPropertyOperation",
"IDOverrideLibraryPropertyOperation",
"Operations",
"List of overriding operations for a property");
rna_def_ID_override_static_property_operation(brna);
rna_def_ID_override_library_property_operation(brna);
}
static void rna_def_ID_override_static(BlenderRNA *brna)
static void rna_def_ID_override_library(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna = RNA_def_struct(brna, "IDOverrideStatic", NULL);
srna = RNA_def_struct(brna, "IDOverrideLibrary", NULL);
RNA_def_struct_ui_text(
srna, "ID Static Override", "Struct gathering all data needed by statically overridden IDs");
srna, "ID Library Override", "Struct gathering all data needed by overridden linked IDs");
RNA_def_pointer(
srna, "reference", "ID", "Reference ID", "Linked ID used as reference by this override");
@ -1390,15 +1390,15 @@ static void rna_def_ID_override_static(BlenderRNA *brna)
true,
"Auto Generate Override",
"Automatically generate overriding operations by detecting changes in properties");
RNA_def_property_boolean_sdna(prop, NULL, "flag", STATICOVERRIDE_AUTO);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OVERRIDE_LIBRARY_AUTO);
RNA_def_collection(srna,
"properties",
"IDOverrideStaticProperty",
"IDOverrideLibraryProperty",
"Properties",
"List of overridden properties");
rna_def_ID_override_static_property(brna);
rna_def_ID_override_library_property(brna);
}
static void rna_def_ID(BlenderRNA *brna)
@ -1486,7 +1486,7 @@ static void rna_def_ID(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Library", "Library file the data-block is linked from");
prop = RNA_def_pointer(
srna, "override_static", "IDOverrideStatic", "Static Override", "Static override data");
srna, "override_library", "IDOverrideLibrary", "Library Override", "Library override data");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop = RNA_def_pointer(
@ -1659,7 +1659,7 @@ void RNA_def_ID(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Any Type", "RNA type used for pointers to any possible data");
rna_def_ID(brna);
rna_def_ID_override_static(brna);
rna_def_ID_override_library(brna);
rna_def_image_preview(brna);
rna_def_ID_properties(brna);
rna_def_ID_materials(brna);

View File

@ -2053,7 +2053,7 @@ bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop)
return ((flag & PROP_EDITABLE) && (flag & PROP_REGISTER) == 0 &&
(!id || ((!ID_IS_LINKED(id) || (prop->flag & PROP_LIB_EXCEPTION)) &&
(!id->override_static || RNA_property_overridable_get(ptr, prop)))));
(!id->override_library || RNA_property_overridable_get(ptr, prop)))));
}
/**
@ -2087,7 +2087,7 @@ bool RNA_property_editable_info(PointerRNA *ptr, PropertyRNA *prop, const char *
}
return false;
}
if (id->override_static != NULL && !RNA_property_overridable_get(ptr, prop)) {
if (id->override_library != NULL && !RNA_property_overridable_get(ptr, prop)) {
if (!(*r_info)[0]) {
*r_info = N_("Can't edit this property from an override data-block");
}
@ -2184,39 +2184,39 @@ bool RNA_property_overridable_get(PointerRNA *ptr, PropertyRNA *prop)
* for now we can live with those special-cases handling I think. */
if (RNA_struct_is_a(ptr->type, &RNA_Constraint)) {
bConstraint *con = ptr->data;
if (con->flag & CONSTRAINT_STATICOVERRIDE_LOCAL) {
if (con->flag & CONSTRAINT_OVERRIDE_LIBRARY_LOCAL) {
return true;
}
}
else if (RNA_struct_is_a(ptr->type, &RNA_Modifier)) {
ModifierData *mod = ptr->data;
if (mod->flag & eModifierFlag_StaticOverride_Local) {
if (mod->flag & eModifierFlag_OverrideLibrary_Local) {
return true;
}
}
/* If this is a RNA-defined property (real or 'virtual' IDProp),
* we want to use RNA prop flag. */
return !(prop->flag_override & PROPOVERRIDE_NO_COMPARISON) &&
(prop->flag_override & PROPOVERRIDE_OVERRIDABLE_STATIC);
(prop->flag_override & PROPOVERRIDE_OVERRIDABLE_LIBRARY);
}
else {
/* If this is a real 'pure' IDProp (aka custom property), we want to use the IDProp flag. */
return !(prop->flag_override & PROPOVERRIDE_NO_COMPARISON) &&
(((IDProperty *)prop)->flag & IDP_FLAG_OVERRIDABLE_STATIC);
(((IDProperty *)prop)->flag & IDP_FLAG_OVERRIDABLE_LIBRARY);
}
}
/* Should only be used for custom properties */
bool RNA_property_overridable_static_set(PointerRNA *UNUSED(ptr),
PropertyRNA *prop,
const bool is_overridable)
bool RNA_property_overridable_library_set(PointerRNA *UNUSED(ptr),
PropertyRNA *prop,
const bool is_overridable)
{
/* Only works for pure custom properties IDProps. */
if (prop->magic != RNA_MAGIC) {
IDProperty *idprop = (IDProperty *)prop;
idprop->flag = is_overridable ? (idprop->flag | IDP_FLAG_OVERRIDABLE_STATIC) :
(idprop->flag & ~IDP_FLAG_OVERRIDABLE_STATIC);
idprop->flag = is_overridable ? (idprop->flag | IDP_FLAG_OVERRIDABLE_LIBRARY) :
(idprop->flag & ~IDP_FLAG_OVERRIDABLE_LIBRARY);
return true;
}
@ -2228,11 +2228,11 @@ bool RNA_property_overridden(PointerRNA *ptr, PropertyRNA *prop)
char *rna_path = RNA_path_from_ID_to_property(ptr, prop);
ID *id = ptr->id.data;
if (rna_path == NULL || id == NULL || id->override_static == NULL) {
if (rna_path == NULL || id == NULL || id->override_library == NULL) {
return false;
}
return (BKE_override_static_property_find(id->override_static, rna_path) != NULL);
return (BKE_override_library_property_find(id->override_library, rna_path) != NULL);
}
bool RNA_property_comparable(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
@ -8026,7 +8026,7 @@ static bool rna_property_override_operation_apply(Main *bmain,
PointerRNA *ptr_item_local,
PointerRNA *ptr_item_override,
PointerRNA *ptr_item_storage,
IDOverrideStaticPropertyOperation *opop);
IDOverrideLibraryPropertyOperation *opop);
bool RNA_property_copy(
Main *bmain, PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, int index)
@ -8060,8 +8060,8 @@ bool RNA_property_copy(
return false;
}
IDOverrideStaticPropertyOperation opop = {
.operation = IDOVERRIDESTATIC_OP_REPLACE,
IDOverrideLibraryPropertyOperation opop = {
.operation = IDOVERRIDE_LIBRARY_OP_REPLACE,
.subitem_reference_index = index,
.subitem_local_index = index,
};
@ -8099,7 +8099,7 @@ static int rna_property_override_diff(Main *bmain,
PropertyRNA *prop_b,
const char *rna_path,
eRNACompareMode mode,
IDOverrideStatic *override,
IDOverrideLibrary *override,
const int flags,
eRNAOverrideMatchResult *r_report_flags);
@ -8167,7 +8167,7 @@ static int rna_property_override_diff(Main *bmain,
PropertyRNA *prop_b,
const char *rna_path,
eRNACompareMode mode,
IDOverrideStatic *override,
IDOverrideLibrary *override,
const int flags,
eRNAOverrideMatchResult *r_report_flags)
{
@ -8299,7 +8299,7 @@ static bool rna_property_override_operation_store(Main *bmain,
PropertyRNA *prop_local,
PropertyRNA *prop_reference,
PropertyRNA *prop_storage,
IDOverrideStaticProperty *op)
IDOverrideLibraryProperty *op)
{
int len_local, len_reference, len_storage = 0;
bool changed = false;
@ -8325,12 +8325,12 @@ static bool rna_property_override_operation_store(Main *bmain,
(!ptr_storage || prop_local->override_store == prop_storage->override_store) &&
prop_local->override_store != NULL);
for (IDOverrideStaticPropertyOperation *opop = op->operations.first; opop; opop = opop->next) {
for (IDOverrideLibraryPropertyOperation *opop = op->operations.first; opop; opop = opop->next) {
/* Only needed for diff operations. */
if (!ELEM(opop->operation,
IDOVERRIDESTATIC_OP_ADD,
IDOVERRIDESTATIC_OP_SUBTRACT,
IDOVERRIDESTATIC_OP_MULTIPLY)) {
IDOVERRIDE_LIBRARY_OP_ADD,
IDOVERRIDE_LIBRARY_OP_SUBTRACT,
IDOVERRIDE_LIBRARY_OP_MULTIPLY)) {
continue;
}
@ -8362,20 +8362,20 @@ static bool rna_property_override_operation_apply(Main *bmain,
PointerRNA *ptr_item_local,
PointerRNA *ptr_item_override,
PointerRNA *ptr_item_storage,
IDOverrideStaticPropertyOperation *opop)
IDOverrideLibraryPropertyOperation *opop)
{
int len_local, len_reference, len_storage = 0;
const short override_op = opop->operation;
if (override_op == IDOVERRIDESTATIC_OP_NOOP) {
if (override_op == IDOVERRIDE_LIBRARY_OP_NOOP) {
return true;
}
if (ELEM(override_op,
IDOVERRIDESTATIC_OP_ADD,
IDOVERRIDESTATIC_OP_SUBTRACT,
IDOVERRIDESTATIC_OP_MULTIPLY) &&
IDOVERRIDE_LIBRARY_OP_ADD,
IDOVERRIDE_LIBRARY_OP_SUBTRACT,
IDOVERRIDE_LIBRARY_OP_MULTIPLY) &&
!ptr_storage) {
/* We cannot apply 'diff' override operations without some reference storage.
* This should typically only happen at read time of .blend file... */
@ -8383,9 +8383,9 @@ static bool rna_property_override_operation_apply(Main *bmain,
}
if (ELEM(override_op,
IDOVERRIDESTATIC_OP_ADD,
IDOVERRIDESTATIC_OP_SUBTRACT,
IDOVERRIDESTATIC_OP_MULTIPLY) &&
IDOVERRIDE_LIBRARY_OP_ADD,
IDOVERRIDE_LIBRARY_OP_SUBTRACT,
IDOVERRIDE_LIBRARY_OP_MULTIPLY) &&
!prop_storage) {
/* We cannot apply 'diff' override operations without some reference storage.
* This should typically only happen at read time of .blend file... */
@ -8471,7 +8471,7 @@ bool RNA_struct_override_matches(Main *bmain,
PointerRNA *ptr_local,
PointerRNA *ptr_reference,
const char *root_path,
IDOverrideStatic *override,
IDOverrideLibrary *override,
const eRNAOverrideMatch flags,
eRNAOverrideMatchResult *r_report_flags)
{
@ -8566,7 +8566,7 @@ bool RNA_struct_override_matches(Main *bmain,
// printf("Override Checking %s\n", rna_path);
if (ignore_overridden && BKE_override_static_property_find(override, rna_path) != NULL) {
if (ignore_overridden && BKE_override_library_property_find(override, rna_path) != NULL) {
RNA_PATH_FREE;
continue;
}
@ -8605,16 +8605,16 @@ bool RNA_struct_override_matches(Main *bmain,
if (diff != 0) {
/* XXX TODO: refine this for per-item overriding of arrays... */
IDOverrideStaticProperty *op = BKE_override_static_property_find(override, rna_path);
IDOverrideStaticPropertyOperation *opop = op ? op->operations.first : NULL;
IDOverrideLibraryProperty *op = BKE_override_library_property_find(override, rna_path);
IDOverrideLibraryPropertyOperation *opop = op ? op->operations.first : NULL;
if (do_restore && (report_flags & RNA_OVERRIDE_MATCH_RESULT_CREATED) == 0) {
/* We are allowed to restore to reference's values. */
if (ELEM(NULL, op, opop) || opop->operation == IDOVERRIDESTATIC_OP_NOOP) {
if (ELEM(NULL, op, opop) || opop->operation == IDOVERRIDE_LIBRARY_OP_NOOP) {
/* We should restore that property to its reference value */
if (RNA_property_editable(ptr_local, prop_local)) {
IDOverrideStaticPropertyOperation opop_tmp = {
.operation = IDOVERRIDESTATIC_OP_REPLACE,
IDOverrideLibraryPropertyOperation opop_tmp = {
.operation = IDOVERRIDE_LIBRARY_OP_REPLACE,
.subitem_reference_index = -1,
.subitem_local_index = -1,
};
@ -8697,14 +8697,14 @@ bool RNA_struct_override_store(Main *bmain,
PointerRNA *ptr_local,
PointerRNA *ptr_reference,
PointerRNA *ptr_storage,
IDOverrideStatic *override)
IDOverrideLibrary *override)
{
bool changed = false;
#ifdef DEBUG_OVERRIDE_TIMEIT
TIMEIT_START_AVERAGED(RNA_struct_override_store);
#endif
for (IDOverrideStaticProperty *op = override->properties.first; op; op = op->next) {
for (IDOverrideLibraryProperty *op = override->properties.first; op; op = op->next) {
/* Simplified for now! */
PointerRNA data_reference, data_local;
PropertyRNA *prop_reference, *prop_local;
@ -8749,13 +8749,13 @@ static void rna_property_override_apply_ex(Main *bmain,
PointerRNA *ptr_item_local,
PointerRNA *ptr_item_override,
PointerRNA *ptr_item_storage,
IDOverrideStaticProperty *op,
IDOverrideLibraryProperty *op,
const bool do_insert)
{
for (IDOverrideStaticPropertyOperation *opop = op->operations.first; opop; opop = opop->next) {
for (IDOverrideLibraryPropertyOperation *opop = op->operations.first; opop; opop = opop->next) {
if (!do_insert != !ELEM(opop->operation,
IDOVERRIDESTATIC_OP_INSERT_AFTER,
IDOVERRIDESTATIC_OP_INSERT_BEFORE)) {
IDOVERRIDE_LIBRARY_OP_INSERT_AFTER,
IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE)) {
if (!do_insert) {
printf("Skipping insert override operations in first pass (%s)!\n", op->rna_path);
}
@ -8785,7 +8785,7 @@ void RNA_struct_override_apply(Main *bmain,
PointerRNA *ptr_local,
PointerRNA *ptr_override,
PointerRNA *ptr_storage,
IDOverrideStatic *override)
IDOverrideLibrary *override)
{
#ifdef DEBUG_OVERRIDE_TIMEIT
TIMEIT_START_AVERAGED(RNA_struct_override_apply);
@ -8796,7 +8796,7 @@ void RNA_struct_override_apply(Main *bmain,
*/
bool do_insert = false;
for (int i = 0; i < 2; i++, do_insert = true) {
for (IDOverrideStaticProperty *op = override->properties.first; op; op = op->next) {
for (IDOverrideLibraryProperty *op = override->properties.first; op; op = op->next) {
/* Simplified for now! */
PointerRNA data_override, data_local;
PointerRNA data_item_override, data_item_local;
@ -8832,7 +8832,7 @@ void RNA_struct_override_apply(Main *bmain,
#ifndef NDEBUG
else {
printf(
"Failed to apply static override operation to '%s.%s' "
"Failed to apply library override operation to '%s.%s' "
"(could not resolve some properties, local: %d, override: %d)\n",
((ID *)ptr_override->id.data)->name,
op->rna_path,
@ -8847,58 +8847,58 @@ void RNA_struct_override_apply(Main *bmain,
#endif
}
IDOverrideStaticProperty *RNA_property_override_property_find(PointerRNA *ptr, PropertyRNA *prop)
IDOverrideLibraryProperty *RNA_property_override_property_find(PointerRNA *ptr, PropertyRNA *prop)
{
ID *id = ptr->id.data;
if (!id || !id->override_static) {
if (!id || !id->override_library) {
return NULL;
}
char *rna_path = RNA_path_from_ID_to_property(ptr, prop);
if (rna_path) {
IDOverrideStaticProperty *op = BKE_override_static_property_find(id->override_static,
rna_path);
IDOverrideLibraryProperty *op = BKE_override_library_property_find(id->override_library,
rna_path);
MEM_freeN(rna_path);
return op;
}
return NULL;
}
IDOverrideStaticProperty *RNA_property_override_property_get(PointerRNA *ptr,
PropertyRNA *prop,
bool *r_created)
IDOverrideLibraryProperty *RNA_property_override_property_get(PointerRNA *ptr,
PropertyRNA *prop,
bool *r_created)
{
ID *id = ptr->id.data;
if (!id || !id->override_static) {
if (!id || !id->override_library) {
return NULL;
}
char *rna_path = RNA_path_from_ID_to_property(ptr, prop);
if (rna_path) {
IDOverrideStaticProperty *op = BKE_override_static_property_get(
id->override_static, rna_path, r_created);
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
id->override_library, rna_path, r_created);
MEM_freeN(rna_path);
return op;
}
return NULL;
}
IDOverrideStaticPropertyOperation *RNA_property_override_property_operation_find(
IDOverrideLibraryPropertyOperation *RNA_property_override_property_operation_find(
PointerRNA *ptr, PropertyRNA *prop, const int index, const bool strict, bool *r_strict)
{
IDOverrideStaticProperty *op = RNA_property_override_property_find(ptr, prop);
IDOverrideLibraryProperty *op = RNA_property_override_property_find(ptr, prop);
if (!op) {
return NULL;
}
return BKE_override_static_property_operation_find(
return BKE_override_library_property_operation_find(
op, NULL, NULL, index, index, strict, r_strict);
}
IDOverrideStaticPropertyOperation *RNA_property_override_property_operation_get(
IDOverrideLibraryPropertyOperation *RNA_property_override_property_operation_get(
PointerRNA *ptr,
PropertyRNA *prop,
const short operation,
@ -8907,27 +8907,27 @@ IDOverrideStaticPropertyOperation *RNA_property_override_property_operation_get(
bool *r_strict,
bool *r_created)
{
IDOverrideStaticProperty *op = RNA_property_override_property_get(ptr, prop, NULL);
IDOverrideLibraryProperty *op = RNA_property_override_property_get(ptr, prop, NULL);
if (!op) {
return NULL;
}
return BKE_override_static_property_operation_get(
return BKE_override_library_property_operation_get(
op, operation, NULL, NULL, index, index, strict, r_strict, r_created);
}
eRNAOverrideStatus RNA_property_static_override_status(PointerRNA *ptr,
PropertyRNA *prop,
const int index)
eRNAOverrideStatus RNA_property_override_library_status(PointerRNA *ptr,
PropertyRNA *prop,
const int index)
{
int override_status = 0;
if (!BKE_override_static_is_enabled()) {
if (!BKE_override_library_is_enabled()) {
return override_status;
}
if (!ptr || !prop || !ptr->id.data || !((ID *)ptr->id.data)->override_static) {
if (!ptr || !prop || !ptr->id.data || !((ID *)ptr->id.data)->override_library) {
return override_status;
}
@ -8935,14 +8935,14 @@ eRNAOverrideStatus RNA_property_static_override_status(PointerRNA *ptr,
override_status |= RNA_OVERRIDE_STATUS_OVERRIDABLE;
}
IDOverrideStaticPropertyOperation *opop = RNA_property_override_property_operation_find(
IDOverrideLibraryPropertyOperation *opop = RNA_property_override_property_operation_find(
ptr, prop, index, false, NULL);
if (opop != NULL) {
override_status |= RNA_OVERRIDE_STATUS_OVERRIDDEN;
if (opop->flag & IDOVERRIDESTATIC_FLAG_MANDATORY) {
if (opop->flag & IDOVERRIDE_LIBRARY_FLAG_MANDATORY) {
override_status |= RNA_OVERRIDE_STATUS_MANDATORY;
}
if (opop->flag & IDOVERRIDESTATIC_FLAG_LOCKED) {
if (opop->flag & IDOVERRIDE_LIBRARY_FLAG_LOCKED) {
override_status |= RNA_OVERRIDE_STATUS_LOCKED;
}
}

View File

@ -714,10 +714,10 @@ bool rna_AnimaData_override_apply(Main *UNUSED(bmain),
PointerRNA *UNUSED(ptr_item_dst),
PointerRNA *UNUSED(ptr_item_src),
PointerRNA *UNUSED(ptr_item_storage),
IDOverrideStaticPropertyOperation *opop)
IDOverrideLibraryPropertyOperation *opop)
{
BLI_assert(len_dst == len_src && (!ptr_storage || len_dst == len_storage) && len_dst == 0);
BLI_assert(opop->operation == IDOVERRIDESTATIC_OP_REPLACE &&
BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_REPLACE &&
"Unsupported RNA override operation on animdata pointer");
UNUSED_VARS_NDEBUG(ptr_storage, len_dst, len_src, len_storage, opop);
@ -1239,7 +1239,7 @@ void rna_def_animdata_common(StructRNA *srna)
prop = RNA_def_property(srna, "animation_data", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "adt");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_override_funcs(prop, NULL, NULL, "rna_AnimaData_override_apply");
RNA_def_property_ui_text(prop, "Animation Data", "Animation data for this data-block");
}
@ -1265,7 +1265,7 @@ static void rna_def_animdata(BlenderRNA *brna)
prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
/* this flag as well as the dynamic test must be defined for this to be editable... */
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_pointer_funcs(
prop, NULL, "rna_AnimData_action_set", NULL, "rna_Action_id_poll");
RNA_def_property_editable_func(prop, "rna_AnimData_action_editable");
@ -1304,7 +1304,7 @@ static void rna_def_animdata(BlenderRNA *brna)
prop = RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "drivers", NULL);
RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this data-block");
rna_api_animdata_drivers(brna, prop);

View File

@ -128,10 +128,10 @@ static bool rna_Collection_objects_override_apply(Main *bmain,
PointerRNA *ptr_item_dst,
PointerRNA *ptr_item_src,
PointerRNA *UNUSED(ptr_item_storage),
IDOverrideStaticPropertyOperation *opop)
IDOverrideLibraryPropertyOperation *opop)
{
(void)opop;
BLI_assert(opop->operation == IDOVERRIDESTATIC_OP_REPLACE &&
BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_REPLACE &&
"Unsupported RNA override operation on collections' objects");
Collection *coll_dst = ptr_dst->id.data;
@ -231,10 +231,10 @@ static bool rna_Collection_children_override_apply(Main *bmain,
PointerRNA *ptr_item_dst,
PointerRNA *ptr_item_src,
PointerRNA *UNUSED(ptr_item_storage),
IDOverrideStaticPropertyOperation *opop)
IDOverrideLibraryPropertyOperation *opop)
{
(void)opop;
BLI_assert(opop->operation == IDOVERRIDESTATIC_OP_REPLACE &&
BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_REPLACE &&
"Unsupported RNA override operation on collections' objects");
Collection *coll_dst = ptr_dst->id.data;
@ -385,7 +385,7 @@ void RNA_def_collections(BlenderRNA *brna)
prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Collection_objects_override_apply");
RNA_def_property_ui_text(prop, "Objects", "Objects that are directly in this collection");
RNA_def_property_collection_funcs(prop,
@ -415,7 +415,7 @@ void RNA_def_collections(BlenderRNA *brna)
prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Collection");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Collection_children_override_apply");
RNA_def_property_ui_text(
prop, "Children", "Collections that are immediate children of this collection");
@ -434,7 +434,7 @@ void RNA_def_collections(BlenderRNA *brna)
prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", COLLECTION_RESTRICT_SELECT);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Collection_hide_select_set");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, -1);
RNA_def_property_ui_text(prop, "Disable Selection", "Disable selection in viewport");
@ -443,7 +443,7 @@ void RNA_def_collections(BlenderRNA *brna)
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", COLLECTION_RESTRICT_VIEWPORT);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Collection_hide_viewport_set");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1);
RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
@ -452,7 +452,7 @@ void RNA_def_collections(BlenderRNA *brna)
prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", COLLECTION_RESTRICT_RENDER);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Collection_hide_render_set");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, -1);
RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders");

View File

@ -798,7 +798,7 @@ static void rna_def_constraint_target_common(StructRNA *srna)
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
@ -821,7 +821,7 @@ static void rna_def_constrainttarget(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "tar");
RNA_def_property_ui_text(prop, "Target", "Target object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(
prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
@ -851,7 +851,7 @@ static void rna_def_constrainttarget_bone(BlenderRNA *brna)
RNA_def_property_pointer_funcs(
prop, NULL, "rna_ConstraintTargetBone_target_set", NULL, "rna_Armature_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(
prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
@ -1075,7 +1075,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "poletar");
RNA_def_property_ui_text(prop, "Pole Target", "Object for pole rotation");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop = RNA_def_property(srna, "pole_subtarget", PROP_STRING, PROP_NONE);
@ -1539,7 +1539,7 @@ static void rna_def_constraint_action(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll");
RNA_def_property_ui_text(prop, "Action", "The constraining action");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
prop = RNA_def_property(srna, "use_bone_object_action", PROP_BOOLEAN, PROP_NONE);
@ -1647,7 +1647,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
RNA_def_property_ui_text(prop, "Target", "Target Curve object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TIME);
@ -1806,7 +1806,7 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
RNA_def_property_ui_text(prop, "Target", "Target Object (Curves only)");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop = RNA_def_property(srna, "main_axis", PROP_ENUM, PROP_NONE);
@ -2430,7 +2430,7 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll");
RNA_def_property_ui_text(prop, "Target", "Target Mesh object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop = RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE);
@ -2586,7 +2586,7 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll");
RNA_def_property_ui_text(prop, "Target", "Curve that controls this relationship");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE);
@ -2755,7 +2755,7 @@ static void rna_def_constraint_pivot(BlenderRNA *brna)
RNA_def_property_ui_text(
prop, "Target", "Target Object, defining the position of the pivot when defined");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
@ -2812,7 +2812,7 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "clip");
RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* track */
@ -2846,7 +2846,7 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna)
RNA_def_property_ui_text(
prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
RNA_def_property_pointer_funcs(prop,
NULL,
@ -2862,7 +2862,7 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna)
"Depth Object",
"Object used to define depth in camera space by projecting onto surface of this object");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
RNA_def_property_pointer_funcs(prop,
NULL,
@ -2900,7 +2900,7 @@ static void rna_def_constraint_camera_solver(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "clip");
RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* use default clip */
@ -2926,7 +2926,7 @@ static void rna_def_constraint_object_solver(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "clip");
RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
/* use default clip */
@ -2947,7 +2947,7 @@ static void rna_def_constraint_object_solver(BlenderRNA *brna)
RNA_def_property_ui_text(
prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
RNA_def_property_pointer_funcs(prop,
NULL,
@ -2972,7 +2972,7 @@ static void rna_def_constraint_transform_cache(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "CacheFile");
RNA_def_property_ui_text(prop, "Cache File", "");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, 0, "rna_Constraint_dependency_update");
prop = RNA_def_property(srna, "object_path", PROP_STRING, PROP_NONE);
@ -3028,14 +3028,14 @@ void RNA_def_constraint(BlenderRNA *brna)
/* flags */
prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_OFF);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Disable", "Enable/Disable Constraint");
RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI");
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);

View File

@ -1708,7 +1708,7 @@ static void rna_def_drivertarget(BlenderRNA *brna)
prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ID");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable");
/* note: custom set function is ONLY to avoid rna setting a user for this. */
RNA_def_property_pointer_funcs(
@ -1814,7 +1814,7 @@ static void rna_def_drivervar(BlenderRNA *brna)
prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "targets", "num_targets");
RNA_def_property_struct_type(prop, "DriverTarget");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Targets", "Sources of input data for evaluating this variable");
/* Name Validity Flags */
@ -1892,7 +1892,7 @@ static void rna_def_channeldriver(BlenderRNA *brna)
prop = RNA_def_property(srna, "variables", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "variables", NULL);
RNA_def_property_struct_type(prop, "DriverVariable");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Variables", "Properties acting as inputs for this driver");
rna_def_channeldriver_variables(brna, prop);
@ -2252,7 +2252,7 @@ static void rna_def_fcurve(BlenderRNA *brna)
/* Pointers */
prop = RNA_def_property(srna, "driver", PROP_POINTER, PROP_NONE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Driver", "Channel Driver (only set for Driver F-Curves)");

View File

@ -1645,7 +1645,7 @@ static void rna_def_modifier_gpencilarmature(BlenderRNA *brna)
RNA_def_property_pointer_funcs(
prop, NULL, "rna_ArmatureGpencilModifier_object_set", NULL, "rna_Armature_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update");
prop = RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
@ -1720,13 +1720,13 @@ void RNA_def_greasepencil_modifier(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "mode", eGpencilModifierMode_Realtime);
RNA_def_property_ui_text(prop, "Realtime", "Display modifier in viewport");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_ON, 1);
prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eGpencilModifierMode_Render);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Render", "Use modifier during render");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_ON, 1);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL);
@ -1740,7 +1740,7 @@ void RNA_def_greasepencil_modifier(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eGpencilModifierMode_Expanded);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);

View File

@ -722,7 +722,7 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA);
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name");
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_reload_update");
@ -763,7 +763,7 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Packed Files", "Collection of packed images");
prop = RNA_def_property(srna, "use_view_as_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_VIEW_AS_RENDER);
RNA_def_property_ui_text(
prop,
@ -772,31 +772,31 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);
prop = RNA_def_property(srna, "use_deinterlace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DEINTERLACE);
RNA_def_property_ui_text(prop, "Deinterlace", "Deinterlace movie file on load");
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_reload_update");
prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_USE_VIEWS);
RNA_def_property_ui_text(prop, "Use Multi-View", "Use Multiple Views (when available)");
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_views_format_update");
prop = RNA_def_property(srna, "is_stereo_3d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_boolean_funcs(prop, "rna_Image_is_stereo_3d_get", NULL);
RNA_def_property_ui_text(prop, "Stereo 3D", "Image has left and right views");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop = RNA_def_property(srna, "is_multiview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_boolean_funcs(prop, "rna_Image_is_multiview_get", NULL);
RNA_def_property_ui_text(prop, "Multiple Views", "Image has more than one view");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved");
@ -839,7 +839,7 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_float_sdna(prop, NULL, "aspx");
RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, 0.1f, FLT_MAX);
@ -890,7 +890,7 @@ static void rna_def_image(BlenderRNA *brna)
prop = RNA_def_float_vector(
srna, "resolution", 2, NULL, 0, 0, "Resolution", "X/Y pixels per meter", 0, 0);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_float_funcs(prop, "rna_Image_resolution_get", "rna_Image_resolution_set", NULL);
prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_UNSIGNED);
@ -926,7 +926,7 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Color Space Settings", "Input color space settings");
prop = RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_enum_items(prop, alpha_mode_items);
RNA_def_property_ui_text(prop,
"Alpha Mode",
@ -936,7 +936,7 @@ static void rna_def_image(BlenderRNA *brna)
/* multiview */
prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_enum_sdna(prop, NULL, "views_format");
RNA_def_property_enum_items(prop, rna_enum_views_format_items);
RNA_def_property_ui_text(prop, "Views Format", "Mode to load image views");

View File

@ -32,9 +32,9 @@
struct Depsgraph;
struct FreestyleSettings;
struct ID;
struct IDOverrideStatic;
struct IDOverrideStaticProperty;
struct IDOverrideStaticPropertyOperation;
struct IDOverrideLibrary;
struct IDOverrideLibraryProperty;
struct IDOverrideLibraryPropertyOperation;
struct IDProperty;
struct Main;
struct Mesh;
@ -221,7 +221,7 @@ bool rna_AnimaData_override_apply(struct Main *bmain,
struct PointerRNA *ptr_item_local,
struct PointerRNA *ptr_item_reference,
struct PointerRNA *ptr_item_storage,
struct IDOverrideStaticPropertyOperation *opop);
struct IDOverrideLibraryPropertyOperation *opop);
void rna_def_animviz_common(struct StructRNA *srna);
void rna_def_motionpath_common(struct StructRNA *srna);
@ -478,7 +478,7 @@ int rna_property_override_diff_default(struct Main *bmain,
const int len_a,
const int len_b,
const int mode,
struct IDOverrideStatic *override,
struct IDOverrideLibrary *override,
const char *rna_path,
const int flags,
bool *r_override_changed);
@ -493,7 +493,7 @@ bool rna_property_override_store_default(struct Main *bmain,
const int len_local,
const int len_reference,
const int len_storage,
struct IDOverrideStaticPropertyOperation *opop);
struct IDOverrideLibraryPropertyOperation *opop);
bool rna_property_override_apply_default(struct Main *bmain,
struct PointerRNA *ptr_dst,
@ -508,7 +508,7 @@ bool rna_property_override_apply_default(struct Main *bmain,
struct PointerRNA *ptr_item_dst,
struct PointerRNA *ptr_item_src,
struct PointerRNA *ptr_item_storage,
struct IDOverrideStaticPropertyOperation *opop);
struct IDOverrideLibraryPropertyOperation *opop);
/* Builtin Property Callbacks */

View File

@ -30,9 +30,9 @@ struct CollectionPropertyIterator;
struct ContainerRNA;
struct FunctionRNA;
struct GHash;
struct IDOverrideStatic;
struct IDOverrideStaticProperty;
struct IDOverrideStaticPropertyOperation;
struct IDOverrideLibrary;
struct IDOverrideLibraryProperty;
struct IDOverrideLibraryPropertyOperation;
struct IDProperty;
struct Main;
struct PointerRNA;
@ -175,7 +175,7 @@ typedef int (*RNAPropOverrideDiff)(struct Main *bmain,
const int len_a,
const int len_b,
const int mode,
struct IDOverrideStatic *override,
struct IDOverrideLibrary *override,
const char *rna_path,
const int flags,
bool *r_override_changed);
@ -200,7 +200,7 @@ typedef bool (*RNAPropOverrideStore)(struct Main *bmain,
const int len_local,
const int len_reference,
const int len_storage,
struct IDOverrideStaticPropertyOperation *opop);
struct IDOverrideLibraryPropertyOperation *opop);
/**
* Apply given override operation from src to dst (using value from storage as second operand
@ -222,7 +222,7 @@ typedef bool (*RNAPropOverrideApply)(struct Main *bmain,
struct PointerRNA *ptr_item_dst,
struct PointerRNA *ptr_item_src,
struct PointerRNA *ptr_item_storage,
struct IDOverrideStaticPropertyOperation *opop);
struct IDOverrideLibraryPropertyOperation *opop);
/* Container - generic abstracted container of RNA properties */
typedef struct ContainerRNA {

View File

@ -369,7 +369,7 @@ static void rna_def_layer_collection(BlenderRNA *brna)
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LAYER_COLLECTION_HIDE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_LayerCollection_hide_viewport_set");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollection_update");
@ -456,7 +456,7 @@ static void rna_def_object_base(BlenderRNA *brna)
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BASE_HIDDEN);
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);

View File

@ -2181,7 +2181,7 @@ static void rna_def_modifier_armature(BlenderRNA *brna)
RNA_def_property_pointer_funcs(
prop, NULL, "rna_ArmatureModifier_object_set", NULL, "rna_Armature_object_poll");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
prop = RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
@ -5946,13 +5946,13 @@ void RNA_def_modifier(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime);
RNA_def_property_ui_text(prop, "Realtime", "Display modifier in viewport");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_ON, 1);
prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Render", "Use modifier during render");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_ON, 1);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL);
@ -5972,7 +5972,7 @@ void RNA_def_modifier(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);

View File

@ -1383,9 +1383,9 @@ bool rna_Object_constraints_override_apply(Main *UNUSED(bmain),
PointerRNA *UNUSED(ptr_item_dst),
PointerRNA *UNUSED(ptr_item_src),
PointerRNA *UNUSED(ptr_item_storage),
IDOverrideStaticPropertyOperation *opop)
IDOverrideLibraryPropertyOperation *opop)
{
BLI_assert(opop->operation == IDOVERRIDESTATIC_OP_INSERT_AFTER &&
BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_INSERT_AFTER &&
"Unsupported RNA override operation on constraints collection");
Object *ob_dst = (Object *)ptr_dst->id.data;
@ -1471,9 +1471,9 @@ bool rna_Object_modifiers_override_apply(Main *UNUSED(bmain),
PointerRNA *UNUSED(ptr_item_dst),
PointerRNA *UNUSED(ptr_item_src),
PointerRNA *UNUSED(ptr_item_storage),
IDOverrideStaticPropertyOperation *opop)
IDOverrideLibraryPropertyOperation *opop)
{
BLI_assert(opop->operation == IDOVERRIDESTATIC_OP_INSERT_AFTER &&
BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_INSERT_AFTER &&
"Unsupported RNA override operation on modifiers collection");
Object *ob_dst = (Object *)ptr_dst->id.data;
@ -1930,7 +1930,7 @@ static void rna_def_material_slot(BlenderRNA *brna)
RNA_def_property_enum_items(prop, link_items);
RNA_def_property_enum_funcs(
prop, "rna_MaterialSlot_link_get", "rna_MaterialSlot_link_set", NULL);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Link", "Link material to object or the object's data");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_MaterialSlot_update");
@ -1938,7 +1938,7 @@ static void rna_def_material_slot(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_editable_func(prop, "rna_MaterialSlot_material_editable");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_pointer_funcs(prop,
"rna_MaterialSlot_material_get",
"rna_MaterialSlot_material_set",
@ -2356,7 +2356,7 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_pointer_funcs(
prop, NULL, "rna_Object_data_set", "rna_Object_data_typef", "rna_Object_data_poll");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Data", "Object data");
RNA_def_property_update(prop, 0, "rna_Object_internal_update_data");
@ -2388,7 +2388,7 @@ static void rna_def_object(BlenderRNA *brna)
prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Parent", "Parent Object");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update");
@ -2451,7 +2451,7 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "MaterialSlot");
RNA_def_property_override_flag(prop,
PROPOVERRIDE_OVERRIDABLE_STATIC | PROPOVERRIDE_NO_PROP_NAME);
PROPOVERRIDE_OVERRIDABLE_LIBRARY | PROPOVERRIDE_NO_PROP_NAME);
/* don't dereference pointer! */
RNA_def_property_collection_funcs(
prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL);
@ -2465,7 +2465,7 @@ static void rna_def_object(BlenderRNA *brna)
NULL,
"rna_MaterialSlot_material_poll");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_editable_func(prop, "rna_Object_active_material_editable");
RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_MaterialSlot_update");
@ -2473,7 +2473,7 @@ static void rna_def_object(BlenderRNA *brna)
prop = RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "actcol");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_int_funcs(prop,
"rna_Object_active_material_index_get",
"rna_Object_active_material_index_set",
@ -2485,7 +2485,7 @@ static void rna_def_object(BlenderRNA *brna)
prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_editable_array_func(prop, "rna_Object_location_editable");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Location", "Location of the object");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
@ -2493,7 +2493,7 @@ static void rna_def_object(BlenderRNA *brna)
prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_float_array_default(prop, rna_default_quaternion);
RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions");
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
@ -2507,7 +2507,7 @@ static void rna_def_object(BlenderRNA *brna)
prop, "rna_Object_rotation_axis_angle_get", "rna_Object_rotation_axis_angle_set", NULL);
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable");
RNA_def_property_float_array_default(prop, rna_default_axis_angle);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(
prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
@ -2515,7 +2515,7 @@ static void rna_def_object(BlenderRNA *brna)
prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_editable_array_func(prop, "rna_Object_rotation_euler_editable");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers");
RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update");
@ -2528,7 +2528,7 @@ static void rna_def_object(BlenderRNA *brna)
prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_flag(prop, PROP_PROPORTIONAL);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_editable_array_func(prop, "rna_Object_scale_editable");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3);
RNA_def_property_float_array_default(prop, rna_default_scale_3d);
@ -2680,8 +2680,8 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(
prop, "Modifiers", "Modifiers affecting the geometric data of the object");
RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Object_modifiers_override_apply");
RNA_def_property_override_flag(prop,
PROPOVERRIDE_OVERRIDABLE_STATIC | PROPOVERRIDE_STATIC_INSERTION);
RNA_def_property_override_flag(
prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY | PROPOVERRIDE_LIBRARY_INSERTION);
rna_def_object_modifiers(brna, prop);
/* Grease Pencil modifiers. */
@ -2702,8 +2702,8 @@ static void rna_def_object(BlenderRNA *brna)
/* constraints */
prop = RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
RNA_def_property_override_flag(prop,
PROPOVERRIDE_OVERRIDABLE_STATIC | PROPOVERRIDE_STATIC_INSERTION);
RNA_def_property_override_flag(
prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY | PROPOVERRIDE_LIBRARY_INSERTION);
RNA_def_property_ui_text(
prop, "Constraints", "Constraints affecting the transformation of the object");
RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Object_constraints_override_apply");
@ -2850,7 +2850,7 @@ static void rna_def_object(BlenderRNA *brna)
/* restrict */
prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEWPORT);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1);
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
@ -2858,14 +2858,14 @@ static void rna_def_object(BlenderRNA *brna)
prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_SELECT);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Disable Selection", "Disable selection in viewport");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, -1);
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, -1);
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
@ -2985,7 +2985,7 @@ static void rna_def_object(BlenderRNA *brna)
prop = RNA_def_property(srna, "pose", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pose");
RNA_def_property_struct_type(prop, "Pose");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Pose", "Current pose for armatures");
/* shape keys */

View File

@ -614,9 +614,9 @@ bool rna_PoseChannel_constraints_override_apply(Main *UNUSED(bmain),
PointerRNA *UNUSED(ptr_item_dst),
PointerRNA *UNUSED(ptr_item_src),
PointerRNA *UNUSED(ptr_item_storage),
IDOverrideStaticPropertyOperation *opop)
IDOverrideLibraryPropertyOperation *opop)
{
BLI_assert(opop->operation == IDOVERRIDESTATIC_OP_INSERT_AFTER &&
BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_INSERT_AFTER &&
"Unsupported RNA override operation on constraints collection");
bPoseChannel *pchan_dst = (bPoseChannel *)ptr_dst->data;
@ -946,8 +946,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
/* Bone Constraints */
prop = RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
RNA_def_property_override_flag(prop,
PROPOVERRIDE_OVERRIDABLE_STATIC | PROPOVERRIDE_STATIC_INSERTION);
RNA_def_property_override_flag(
prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY | PROPOVERRIDE_LIBRARY_INSERTION);
RNA_def_property_ui_text(prop, "Constraints", "Constraints that act on this PoseChannel");
RNA_def_property_override_funcs(prop, NULL, NULL, "rna_PoseChannel_constraints_override_apply");
@ -987,7 +987,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
/* Transformation settings */
prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_location_editable");
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
@ -996,7 +996,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_flag(prop, PROP_PROPORTIONAL);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_scale_editable");
RNA_def_property_float_array_default(prop, rna_default_scale_3d);
RNA_def_property_ui_text(prop, "Scale", "");
@ -1004,7 +1004,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable");
RNA_def_property_float_array_default(prop, rna_default_quaternion);
RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions");
@ -1014,7 +1014,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
* having a single one is better for Keyframing and other property-management situations...
*/
prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_array(prop, 4);
RNA_def_property_float_funcs(prop,
"rna_PoseChannel_rotation_axis_angle_get",
@ -1028,7 +1028,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "eul");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_euler_editable");
RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
@ -1277,7 +1277,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "custom_tx");
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_PTR_NO_OWNERSHIP);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop,
"Custom Shape Transform",
"Bone that defines the display transform of this custom shape");
@ -1580,7 +1580,7 @@ static void rna_def_pose(BlenderRNA *brna)
prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL);
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature");
/* can be removed, only for fast lookup */
RNA_def_property_collection_funcs(

View File

@ -613,7 +613,7 @@ static bool rna_Property_overridable_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return (prop->flag_override & PROPOVERRIDE_OVERRIDABLE_STATIC) != 0;
return (prop->flag_override & PROPOVERRIDE_OVERRIDABLE_LIBRARY) != 0;
}
static bool rna_Property_use_output_get(PointerRNA *ptr)
@ -1176,7 +1176,7 @@ static bool rna_property_override_diff_propptr_validate_diffing(PointerRNA *prop
/* We do a generic quick first comparison checking for "name" and/or "type" properties.
* We assume that is any of those are false, then we are not handling the same data.
* This helps a lot in static override case, especially to detect inserted items in collections.
* This helps a lot in library override case, especially to detect inserted items in collections.
*/
if (!no_prop_name && (is_valid_for_diffing || do_force_name)) {
PropertyRNA *nameprop_a = RNA_struct_name_property(propptr_a->type);
@ -1239,7 +1239,7 @@ static int rna_property_override_diff_propptr(Main *bmain,
eRNACompareMode mode,
const bool no_ownership,
const bool no_prop_name,
IDOverrideStatic *override,
IDOverrideLibrary *override,
const char *rna_path,
const int flags,
bool *r_override_changed)
@ -1279,12 +1279,12 @@ static int rna_property_override_diff_propptr(Main *bmain,
if (do_create && comp != 0) {
bool created = false;
IDOverrideStaticProperty *op = BKE_override_static_property_get(
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
override, rna_path, &created);
if (op != NULL && created) { /* If not yet overridden... */
BKE_override_static_property_operation_get(
op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
BKE_override_library_property_operation_get(
op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
if (r_override_changed) {
*r_override_changed = created;
}
@ -1325,7 +1325,7 @@ int rna_property_override_diff_default(Main *bmain,
const int len_a,
const int len_b,
const int mode,
IDOverrideStatic *override,
IDOverrideLibrary *override,
const char *rna_path,
const int flags,
bool *r_override_changed)
@ -1357,12 +1357,12 @@ int rna_property_override_diff_default(Main *bmain,
if (do_create && comp != 0) {
/* XXX TODO this will have to be refined to handle array items */
bool created = false;
IDOverrideStaticProperty *op = BKE_override_static_property_get(
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
override, rna_path, &created);
if (op != NULL && created) {
BKE_override_static_property_operation_get(
op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
BKE_override_library_property_operation_get(
op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
if (r_override_changed) {
*r_override_changed = created;
}
@ -1388,12 +1388,12 @@ int rna_property_override_diff_default(Main *bmain,
if (do_create && comp != 0) {
bool created = false;
IDOverrideStaticProperty *op = BKE_override_static_property_get(
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
override, rna_path, &created);
if (op != NULL && created) { /* If not yet overridden... */
BKE_override_static_property_operation_get(
op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
BKE_override_library_property_operation_get(
op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
if (r_override_changed) {
*r_override_changed = created;
}
@ -1422,12 +1422,12 @@ int rna_property_override_diff_default(Main *bmain,
if (do_create && comp != 0) {
/* XXX TODO this will have to be refined to handle array items */
bool created = false;
IDOverrideStaticProperty *op = BKE_override_static_property_get(
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
override, rna_path, &created);
if (op != NULL && created) {
BKE_override_static_property_operation_get(
op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
BKE_override_library_property_operation_get(
op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
if (r_override_changed) {
*r_override_changed = created;
}
@ -1453,12 +1453,12 @@ int rna_property_override_diff_default(Main *bmain,
if (do_create && comp != 0) {
bool created = false;
IDOverrideStaticProperty *op = BKE_override_static_property_get(
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
override, rna_path, &created);
if (op != NULL && created) { /* If not yet overridden... */
BKE_override_static_property_operation_get(
op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
BKE_override_library_property_operation_get(
op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
if (r_override_changed) {
*r_override_changed = created;
}
@ -1487,12 +1487,12 @@ int rna_property_override_diff_default(Main *bmain,
if (do_create && comp != 0) {
/* XXX TODO this will have to be refined to handle array items */
bool created = false;
IDOverrideStaticProperty *op = BKE_override_static_property_get(
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
override, rna_path, &created);
if (op != NULL && created) {
BKE_override_static_property_operation_get(
op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
BKE_override_library_property_operation_get(
op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
if (r_override_changed) {
*r_override_changed = created;
}
@ -1518,12 +1518,12 @@ int rna_property_override_diff_default(Main *bmain,
if (do_create && comp != 0) {
bool created = false;
IDOverrideStaticProperty *op = BKE_override_static_property_get(
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
override, rna_path, &created);
if (op != NULL && created) { /* If not yet overridden... */
BKE_override_static_property_operation_get(
op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
BKE_override_library_property_operation_get(
op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
if (r_override_changed) {
*r_override_changed = created;
}
@ -1541,12 +1541,12 @@ int rna_property_override_diff_default(Main *bmain,
if (do_create && comp != 0) {
bool created = false;
IDOverrideStaticProperty *op = BKE_override_static_property_get(
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
override, rna_path, &created);
if (op != NULL && created) { /* If not yet overridden... */
BKE_override_static_property_operation_get(
op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
BKE_override_library_property_operation_get(
op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
if (r_override_changed) {
*r_override_changed = created;
}
@ -1575,12 +1575,12 @@ int rna_property_override_diff_default(Main *bmain,
if (do_create && comp != 0) {
bool created = false;
IDOverrideStaticProperty *op = BKE_override_static_property_get(
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
override, rna_path, &created);
if (op != NULL && created) { /* If not yet overridden... */
BKE_override_static_property_operation_get(
op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
BKE_override_library_property_operation_get(
op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL);
if (r_override_changed) {
*r_override_changed = created;
}
@ -1626,7 +1626,7 @@ int rna_property_override_diff_default(Main *bmain,
/* Note: we assume we only insert in ptr_a (i.e. we can only get new items in ptr_a),
* and that we never remove anything. */
const bool use_insertion = (RNA_property_override_flag(prop_a) &
PROPOVERRIDE_STATIC_INSERTION) &&
PROPOVERRIDE_LIBRARY_INSERTION) &&
do_create;
const bool no_prop_name = (RNA_property_override_flag(prop_a) & PROPOVERRIDE_NO_PROP_NAME) !=
0;
@ -1724,7 +1724,7 @@ int rna_property_override_diff_default(Main *bmain,
is_id,
is_valid_for_diffing,
is_valid_for_insertion,
(RNA_property_override_flag(prop_a) & PROPOVERRIDE_STATIC_INSERTION) != 0,
(RNA_property_override_flag(prop_a) & PROPOVERRIDE_LIBRARY_INSERTION) != 0,
do_create);
}
# endif
@ -1767,33 +1767,34 @@ int rna_property_override_diff_default(Main *bmain,
* We also assume then that _a data is the one where things are inserted. */
if (is_valid_for_insertion && use_insertion) {
bool created;
IDOverrideStaticProperty *op = BKE_override_static_property_get(
IDOverrideLibraryProperty *op = BKE_override_library_property_get(
override, rna_path, &created);
if (is_first_insert) {
/* We need to clean up all possible existing insertion operations,
* otherwise we'd end up with a mess of ops everytime something changes. */
for (IDOverrideStaticPropertyOperation *opop = op->operations.first; opop != NULL;) {
IDOverrideStaticPropertyOperation *opop_next = opop->next;
for (IDOverrideLibraryPropertyOperation *opop = op->operations.first;
opop != NULL;) {
IDOverrideLibraryPropertyOperation *opop_next = opop->next;
if (ELEM(opop->operation,
IDOVERRIDESTATIC_OP_INSERT_AFTER,
IDOVERRIDESTATIC_OP_INSERT_BEFORE)) {
BKE_override_static_property_operation_delete(op, opop);
IDOVERRIDE_LIBRARY_OP_INSERT_AFTER,
IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE)) {
BKE_override_library_property_operation_delete(op, opop);
}
opop = opop_next;
}
is_first_insert = false;
}
BKE_override_static_property_operation_get(op,
IDOVERRIDESTATIC_OP_INSERT_AFTER,
NULL,
prev_propname_a,
-1,
idx_a - 1,
true,
NULL,
NULL);
BKE_override_library_property_operation_get(op,
IDOVERRIDE_LIBRARY_OP_INSERT_AFTER,
NULL,
prev_propname_a,
-1,
idx_a - 1,
true,
NULL,
NULL);
# if 0
printf("%s: Adding insertion op override after '%s'/%d\n",
rna_path,
@ -1894,7 +1895,7 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
const int len_local,
const int len_reference,
const int len_storage,
IDOverrideStaticPropertyOperation *opop)
IDOverrideLibraryPropertyOperation *opop)
{
BLI_assert(len_local == len_reference && (!ptr_storage || len_local == len_storage));
UNUSED_VARS_NDEBUG(len_reference, len_storage);
@ -1904,9 +1905,9 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
const int index = is_array ? opop->subitem_reference_index : 0;
if (!ELEM(opop->operation,
IDOVERRIDESTATIC_OP_ADD,
IDOVERRIDESTATIC_OP_SUBTRACT,
IDOVERRIDESTATIC_OP_MULTIPLY)) {
IDOVERRIDE_LIBRARY_OP_ADD,
IDOVERRIDE_LIBRARY_OP_SUBTRACT,
IDOVERRIDE_LIBRARY_OP_MULTIPLY)) {
return changed;
}
@ -1936,12 +1937,12 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
RNA_property_int_get_array(ptr_reference, prop_reference, array_a);
switch (opop->operation) {
case IDOVERRIDESTATIC_OP_ADD:
case IDOVERRIDESTATIC_OP_SUBTRACT: {
const int fac = opop->operation == IDOVERRIDESTATIC_OP_ADD ? 1 : -1;
const int other_op = opop->operation == IDOVERRIDESTATIC_OP_ADD ?
IDOVERRIDESTATIC_OP_SUBTRACT :
IDOVERRIDESTATIC_OP_ADD;
case IDOVERRIDE_LIBRARY_OP_ADD:
case IDOVERRIDE_LIBRARY_OP_SUBTRACT: {
const int fac = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? 1 : -1;
const int other_op = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ?
IDOVERRIDE_LIBRARY_OP_SUBTRACT :
IDOVERRIDE_LIBRARY_OP_ADD;
bool do_set = true;
array_b = (len_local > RNA_STACK_ARRAY) ?
MEM_mallocN(sizeof(*array_b) * len_local, __func__) :
@ -1956,7 +1957,7 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
if (array_b[j] < prop_min || array_b[j] > prop_max) {
/* We failed to find a suitable diff op,
* fall back to plain REPLACE one. */
opop->operation = IDOVERRIDESTATIC_OP_REPLACE;
opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE;
do_set = false;
break;
}
@ -1986,18 +1987,18 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
const int value = RNA_PROPERTY_GET_SINGLE(int, ptr_reference, prop_reference, index);
switch (opop->operation) {
case IDOVERRIDESTATIC_OP_ADD:
case IDOVERRIDESTATIC_OP_SUBTRACT: {
const int fac = opop->operation == IDOVERRIDESTATIC_OP_ADD ? 1 : -1;
const int other_op = opop->operation == IDOVERRIDESTATIC_OP_ADD ?
IDOVERRIDESTATIC_OP_SUBTRACT :
IDOVERRIDESTATIC_OP_ADD;
case IDOVERRIDE_LIBRARY_OP_ADD:
case IDOVERRIDE_LIBRARY_OP_SUBTRACT: {
const int fac = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? 1 : -1;
const int other_op = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ?
IDOVERRIDE_LIBRARY_OP_SUBTRACT :
IDOVERRIDE_LIBRARY_OP_ADD;
int b = fac * (RNA_PROPERTY_GET_SINGLE(int, ptr_local, prop_local, index) - value);
if (b < prop_min || b > prop_max) {
opop->operation = other_op;
b = -b;
if (b < prop_min || b > prop_max) {
opop->operation = IDOVERRIDESTATIC_OP_REPLACE;
opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE;
break;
}
}
@ -2026,12 +2027,12 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
RNA_property_float_get_array(ptr_reference, prop_reference, array_a);
switch (opop->operation) {
case IDOVERRIDESTATIC_OP_ADD:
case IDOVERRIDESTATIC_OP_SUBTRACT: {
const float fac = opop->operation == IDOVERRIDESTATIC_OP_ADD ? 1.0 : -1.0;
const int other_op = opop->operation == IDOVERRIDESTATIC_OP_ADD ?
IDOVERRIDESTATIC_OP_SUBTRACT :
IDOVERRIDESTATIC_OP_ADD;
case IDOVERRIDE_LIBRARY_OP_ADD:
case IDOVERRIDE_LIBRARY_OP_SUBTRACT: {
const float fac = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? 1.0 : -1.0;
const int other_op = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ?
IDOVERRIDE_LIBRARY_OP_SUBTRACT :
IDOVERRIDE_LIBRARY_OP_ADD;
bool do_set = true;
array_b = (len_local > RNA_STACK_ARRAY) ?
MEM_mallocN(sizeof(*array_b) * len_local, __func__) :
@ -2046,7 +2047,7 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
if (array_b[j] < prop_min || array_b[j] > prop_max) {
/* We failed to find a suitable diff op,
* fall back to plain REPLACE one. */
opop->operation = IDOVERRIDESTATIC_OP_REPLACE;
opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE;
do_set = false;
break;
}
@ -2063,7 +2064,7 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
}
break;
}
case IDOVERRIDESTATIC_OP_MULTIPLY: {
case IDOVERRIDE_LIBRARY_OP_MULTIPLY: {
bool do_set = true;
array_b = (len_local > RNA_STACK_ARRAY) ?
MEM_mallocN(sizeof(*array_b) * len_local, __func__) :
@ -2072,7 +2073,7 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
for (int i = len_local; i--;) {
array_b[i] = array_a[i] == 0.0f ? array_b[i] : array_b[i] / array_a[i];
if (array_b[i] < prop_min || array_b[i] > prop_max) {
opop->operation = IDOVERRIDESTATIC_OP_REPLACE;
opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE;
do_set = false;
break;
}
@ -2099,18 +2100,18 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
const float value = RNA_PROPERTY_GET_SINGLE(float, ptr_reference, prop_reference, index);
switch (opop->operation) {
case IDOVERRIDESTATIC_OP_ADD:
case IDOVERRIDESTATIC_OP_SUBTRACT: {
const float fac = opop->operation == IDOVERRIDESTATIC_OP_ADD ? 1.0f : -1.0f;
const int other_op = opop->operation == IDOVERRIDESTATIC_OP_ADD ?
IDOVERRIDESTATIC_OP_SUBTRACT :
IDOVERRIDESTATIC_OP_ADD;
case IDOVERRIDE_LIBRARY_OP_ADD:
case IDOVERRIDE_LIBRARY_OP_SUBTRACT: {
const float fac = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? 1.0f : -1.0f;
const int other_op = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ?
IDOVERRIDE_LIBRARY_OP_SUBTRACT :
IDOVERRIDE_LIBRARY_OP_ADD;
float b = fac * (RNA_PROPERTY_GET_SINGLE(float, ptr_local, prop_local, index) - value);
if (b < prop_min || b > prop_max) {
opop->operation = other_op;
b = -b;
if (b < prop_min || b > prop_max) {
opop->operation = IDOVERRIDESTATIC_OP_REPLACE;
opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE;
break;
}
}
@ -2118,11 +2119,11 @@ bool rna_property_override_store_default(Main *UNUSED(bmain),
RNA_PROPERTY_SET_SINGLE(float, ptr_storage, prop_storage, index, b);
break;
}
case IDOVERRIDESTATIC_OP_MULTIPLY: {
case IDOVERRIDE_LIBRARY_OP_MULTIPLY: {
const float b = RNA_property_float_get_index(ptr_local, prop_local, index) /
(value == 0.0f ? 1.0f : value);
if (b < prop_min || b > prop_max) {
opop->operation = IDOVERRIDESTATIC_OP_REPLACE;
opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE;
break;
}
changed = true;
@ -2170,7 +2171,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
PointerRNA *UNUSED(ptr_item_dst),
PointerRNA *UNUSED(ptr_item_src),
PointerRNA *UNUSED(ptr_item_storage),
IDOverrideStaticPropertyOperation *opop)
IDOverrideLibraryPropertyOperation *opop)
{
BLI_assert(len_dst == len_src && (!ptr_storage || len_dst == len_storage));
UNUSED_VARS_NDEBUG(len_src, len_storage);
@ -2191,7 +2192,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
RNA_property_boolean_get_array(ptr_src, prop_src, array_a);
switch (override_op) {
case IDOVERRIDESTATIC_OP_REPLACE:
case IDOVERRIDE_LIBRARY_OP_REPLACE:
RNA_property_boolean_set_array(ptr_dst, prop_dst, array_a);
break;
default:
@ -2207,7 +2208,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
const bool value = RNA_PROPERTY_GET_SINGLE(boolean, ptr_src, prop_src, index);
switch (override_op) {
case IDOVERRIDESTATIC_OP_REPLACE:
case IDOVERRIDE_LIBRARY_OP_REPLACE:
RNA_PROPERTY_SET_SINGLE(boolean, ptr_dst, prop_dst, index, value);
break;
default:
@ -2225,18 +2226,18 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
array_stack_a;
switch (override_op) {
case IDOVERRIDESTATIC_OP_REPLACE:
case IDOVERRIDE_LIBRARY_OP_REPLACE:
RNA_property_int_get_array(ptr_src, prop_src, array_a);
RNA_property_int_set_array(ptr_dst, prop_dst, array_a);
break;
case IDOVERRIDESTATIC_OP_ADD:
case IDOVERRIDESTATIC_OP_SUBTRACT:
case IDOVERRIDE_LIBRARY_OP_ADD:
case IDOVERRIDE_LIBRARY_OP_SUBTRACT:
RNA_property_int_get_array(ptr_dst, prop_dst, array_a);
array_b = (len_dst > RNA_STACK_ARRAY) ?
MEM_mallocN(sizeof(*array_b) * len_dst, __func__) :
array_stack_b;
RNA_property_int_get_array(ptr_storage, prop_storage, array_b);
if (override_op == IDOVERRIDESTATIC_OP_ADD) {
if (override_op == IDOVERRIDE_LIBRARY_OP_ADD) {
for (int i = len_dst; i--;) {
array_a[i] += array_b[i];
}
@ -2266,14 +2267,14 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
0;
switch (override_op) {
case IDOVERRIDESTATIC_OP_REPLACE:
case IDOVERRIDE_LIBRARY_OP_REPLACE:
RNA_PROPERTY_SET_SINGLE(int,
ptr_dst,
prop_dst,
index,
RNA_PROPERTY_GET_SINGLE(int, ptr_src, prop_src, index));
break;
case IDOVERRIDESTATIC_OP_ADD:
case IDOVERRIDE_LIBRARY_OP_ADD:
RNA_PROPERTY_SET_SINGLE(int,
ptr_dst,
prop_dst,
@ -2281,7 +2282,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
RNA_PROPERTY_GET_SINGLE(int, ptr_dst, prop_dst, index) -
storage_value);
break;
case IDOVERRIDESTATIC_OP_SUBTRACT:
case IDOVERRIDE_LIBRARY_OP_SUBTRACT:
RNA_PROPERTY_SET_SINGLE(int,
ptr_dst,
prop_dst,
@ -2304,24 +2305,24 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
array_stack_a;
switch (override_op) {
case IDOVERRIDESTATIC_OP_REPLACE:
case IDOVERRIDE_LIBRARY_OP_REPLACE:
RNA_property_float_get_array(ptr_src, prop_src, array_a);
RNA_property_float_set_array(ptr_dst, prop_dst, array_a);
break;
case IDOVERRIDESTATIC_OP_ADD:
case IDOVERRIDESTATIC_OP_SUBTRACT:
case IDOVERRIDESTATIC_OP_MULTIPLY:
case IDOVERRIDE_LIBRARY_OP_ADD:
case IDOVERRIDE_LIBRARY_OP_SUBTRACT:
case IDOVERRIDE_LIBRARY_OP_MULTIPLY:
RNA_property_float_get_array(ptr_dst, prop_dst, array_a);
array_b = (len_dst > RNA_STACK_ARRAY) ?
MEM_mallocN(sizeof(*array_b) * len_dst, __func__) :
array_stack_b;
RNA_property_float_get_array(ptr_storage, prop_storage, array_b);
if (override_op == IDOVERRIDESTATIC_OP_ADD) {
if (override_op == IDOVERRIDE_LIBRARY_OP_ADD) {
for (int i = len_dst; i--;) {
array_a[i] += array_b[i];
}
}
else if (override_op == IDOVERRIDESTATIC_OP_SUBTRACT) {
else if (override_op == IDOVERRIDE_LIBRARY_OP_SUBTRACT) {
for (int i = len_dst; i--;) {
array_a[i] -= array_b[i];
}
@ -2351,14 +2352,14 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
0.0f;
switch (override_op) {
case IDOVERRIDESTATIC_OP_REPLACE:
case IDOVERRIDE_LIBRARY_OP_REPLACE:
RNA_PROPERTY_SET_SINGLE(float,
ptr_dst,
prop_dst,
index,
RNA_PROPERTY_GET_SINGLE(float, ptr_src, prop_src, index));
break;
case IDOVERRIDESTATIC_OP_ADD:
case IDOVERRIDE_LIBRARY_OP_ADD:
RNA_PROPERTY_SET_SINGLE(float,
ptr_dst,
prop_dst,
@ -2366,7 +2367,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
RNA_PROPERTY_GET_SINGLE(float, ptr_dst, prop_dst, index) +
storage_value);
break;
case IDOVERRIDESTATIC_OP_SUBTRACT:
case IDOVERRIDE_LIBRARY_OP_SUBTRACT:
RNA_PROPERTY_SET_SINGLE(float,
ptr_dst,
prop_dst,
@ -2374,7 +2375,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
RNA_PROPERTY_GET_SINGLE(float, ptr_dst, prop_dst, index) -
storage_value);
break;
case IDOVERRIDESTATIC_OP_MULTIPLY:
case IDOVERRIDE_LIBRARY_OP_MULTIPLY:
RNA_PROPERTY_SET_SINGLE(float,
ptr_dst,
prop_dst,
@ -2392,7 +2393,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
const int value = RNA_property_enum_get(ptr_src, prop_src);
switch (override_op) {
case IDOVERRIDESTATIC_OP_REPLACE:
case IDOVERRIDE_LIBRARY_OP_REPLACE:
RNA_property_enum_set(ptr_dst, prop_dst, value);
break;
/* TODO support add/sub, for bitflags? */
@ -2406,7 +2407,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
PointerRNA value = RNA_property_pointer_get(ptr_src, prop_src);
switch (override_op) {
case IDOVERRIDESTATIC_OP_REPLACE:
case IDOVERRIDE_LIBRARY_OP_REPLACE:
RNA_property_pointer_set(ptr_dst, prop_dst, value, NULL);
break;
default:
@ -2420,7 +2421,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain),
char *value = RNA_property_string_get_alloc(ptr_src, prop_src, buff, sizeof(buff), NULL);
switch (override_op) {
case IDOVERRIDESTATIC_OP_REPLACE:
case IDOVERRIDE_LIBRARY_OP_REPLACE:
RNA_property_string_set(ptr_dst, prop_dst, value);
break;
default:

View File

@ -6586,13 +6586,13 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
"Number of time the light is reinjected inside light grids, "
"0 disable indirect diffuse light");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, eevee_shadow_size_items);
RNA_def_property_enum_default(prop, 512);
RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items);
@ -6600,7 +6600,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop,
"Irradiance Visibility Size",
"Size of the shadow map applied to each irradiance sample");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
prop = RNA_def_property(srna, "gi_irradiance_smoothing", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, FLT_MAX);
@ -6609,7 +6609,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop,
"Irradiance Smoothing",
"Smoother irradiance interpolation but introduce light bleeding");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "gi_glossy_clamp", PROP_FLOAT, PROP_NONE);
@ -6619,14 +6619,14 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
"Clamp pixel intensity to reduce noise inside glossy reflections "
"from reflection cubemaps (0 to disabled)");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
prop = RNA_def_property(srna, "gi_filter_quality", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, 3.0f);
RNA_def_property_ui_text(
prop, "Filter Quality", "Take more samples during cubemap filtering to remove artifacts");
RNA_def_property_range(prop, 1.0f, 8.0f);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
prop = RNA_def_property(srna, "gi_show_irradiance", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SHOW_IRRADIANCE);
@ -6634,7 +6634,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_HIDE_ON, 1);
RNA_def_property_ui_text(
prop, "Show Irradiance Cache", "Display irradiance samples in the viewport");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "gi_show_cubemaps", PROP_BOOLEAN, PROP_NONE);
@ -6643,7 +6643,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_HIDE_ON, 1);
RNA_def_property_ui_text(
prop, "Show Cubemap Cache", "Display captured cubemaps in the viewport");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "gi_irradiance_display_size", PROP_FLOAT, PROP_DISTANCE);
@ -6678,14 +6678,14 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_int_default(prop, 16);
RNA_def_property_ui_text(prop, "Viewport Samples", "Number of samples, unlimited if 0");
RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "taa_render_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_default(prop, 64);
RNA_def_property_ui_text(prop, "Render Samples", "Number of samples per pixels for rendering");
RNA_def_property_range(prop, 1, INT_MAX);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "use_taa_reprojection", PROP_BOOLEAN, PROP_NONE);
@ -6695,7 +6695,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
"Viewport Denoising",
"Denoise image using temporal reprojection "
"(can leave some ghosting)");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
/* Screen Space Subsurface Scattering */
@ -6703,7 +6703,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_int_default(prop, 7);
RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute the scattering effect");
RNA_def_property_range(prop, 1, 32);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "sss_jitter_threshold", PROP_FLOAT, PROP_FACTOR);
@ -6711,7 +6711,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(
prop, "Jitter Threshold", "Rotate samples that are below this threshold");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "use_sss_separate_albedo", PROP_BOOLEAN, PROP_NONE);
@ -6721,7 +6721,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
"Separate Albedo",
"Avoid albedo being blurred by the subsurface scattering "
"but uses more video memory");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
/* Screen Space Reflection */
@ -6729,28 +6729,28 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSR_ENABLED);
RNA_def_property_boolean_default(prop, 0);
RNA_def_property_ui_text(prop, "Screen Space Reflections", "Enable screen space reflection");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "use_ssr_refraction", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSR_REFRACTION);
RNA_def_property_boolean_default(prop, 0);
RNA_def_property_ui_text(prop, "Screen Space Refractions", "Enable screen space Refractions");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "use_ssr_halfres", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSR_HALF_RESOLUTION);
RNA_def_property_boolean_default(prop, 1);
RNA_def_property_ui_text(prop, "Half Res Trace", "Raytrace at a lower resolution");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "ssr_quality", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 0.25f);
RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the screen space raytracing");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "ssr_max_roughness", PROP_FLOAT, PROP_FACTOR);
@ -6758,7 +6758,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(
prop, "Max Roughness", "Do not raytrace reflections for roughness above this value");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "ssr_thickness", PROP_FLOAT, PROP_DISTANCE);
@ -6766,21 +6766,21 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Thickness", "Pixel thickness used to detect intersection");
RNA_def_property_range(prop, 1e-6f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 5, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "ssr_border_fade", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 0.075f);
RNA_def_property_ui_text(prop, "Edge Fading", "Screen percentage used to fade the SSR");
RNA_def_property_range(prop, 0.0f, 0.5f);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "ssr_firefly_fac", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, 10.0f);
RNA_def_property_ui_text(prop, "Clamp", "Clamp pixel intensity to remove noise (0 to disabled)");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
/* Volumetrics */
@ -6789,7 +6789,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Start", "Start distance of the volumetric effect");
RNA_def_property_range(prop, 1e-6f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "volumetric_end", PROP_FLOAT, PROP_DISTANCE);
@ -6797,7 +6797,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "End", "End distance of the volumetric effect");
RNA_def_property_range(prop, 1e-6f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE);
@ -6807,21 +6807,21 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
"Tile Size",
"Control the quality of the volumetric effects "
"(lower size increase vram usage and quality)");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_default(prop, 64);
RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute volumetric effects");
RNA_def_property_range(prop, 1, 256);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "volumetric_sample_distribution", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 0.8f);
RNA_def_property_ui_text(
prop, "Exponential Sampling", "Distribute more samples closer to the camera");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "use_volumetric_lights", PROP_BOOLEAN, PROP_NONE);
@ -6829,14 +6829,14 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_boolean_default(prop, 1);
RNA_def_property_ui_text(
prop, "Volumetric Lighting", "Enable scene light interactions with volumetrics");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, 0.0f);
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clamp", "Maximum light contribution, reducing noise");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "use_volumetric_shadows", PROP_BOOLEAN, PROP_NONE);
@ -6844,7 +6844,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_boolean_default(prop, 0);
RNA_def_property_ui_text(
prop, "Volumetric Shadows", "Generate shadows from volumetric material (Very expensive)");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "volumetric_shadow_samples", PROP_INT, PROP_NONE);
@ -6852,7 +6852,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_range(prop, 1, 128);
RNA_def_property_ui_text(
prop, "Volumetric Shadow Samples", "Number of samples to compute volumetric shadowing");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
/* Ambient Occlusion */
@ -6862,7 +6862,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop,
"Ambient Occlusion",
"Enable ambient occlusion to simulate medium scale indirect shadowing");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "use_gtao_bent_normals", PROP_BOOLEAN, PROP_NONE);
@ -6870,7 +6870,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_boolean_default(prop, 1);
RNA_def_property_ui_text(
prop, "Bent Normals", "Compute main non occluded direction to sample the environment");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "use_gtao_bounce", PROP_BOOLEAN, PROP_NONE);
@ -6880,7 +6880,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
"Bounces Approximation",
"An approximation to simulate light bounces "
"giving less occlusion on brighter objects");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "gtao_factor", PROP_FLOAT, PROP_FACTOR);
@ -6888,14 +6888,14 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 2);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "gtao_quality", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 0.25f);
RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the horizon search");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "gtao_distance", PROP_FLOAT, PROP_DISTANCE);
@ -6904,7 +6904,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
prop, "Distance", "Distance of object that contribute to the ambient occlusion effect");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
/* Depth of Field */
@ -6914,7 +6914,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
prop, "Max Size", "Max size of the bokeh shape for the depth of field (lower is faster)");
RNA_def_property_range(prop, 0.0f, 2000.0f);
RNA_def_property_ui_range(prop, 2.0f, 200.0f, 1, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
prop = RNA_def_property(srna, "bokeh_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 1.0f);
@ -6922,7 +6922,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
prop, "Sprite Threshold", "Brightness threshold for using sprite base depth of field");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
/* Bloom */
@ -6930,7 +6930,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_BLOOM_ENABLED);
RNA_def_property_boolean_default(prop, 0);
RNA_def_property_ui_text(prop, "Bloom", "High brightness pixels generate a glowing effect");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "bloom_threshold", PROP_FLOAT, PROP_FACTOR);
@ -6938,21 +6938,21 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Threshold", "Filters out pixels under this level of brightness");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "bloom_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_array_default(prop, default_bloom_color);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Color applied to the bloom effect");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "bloom_knee", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_ui_text(prop, "Knee", "Makes transition between under/over-threshold gradual");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "bloom_radius", PROP_FLOAT, PROP_FACTOR);
@ -6960,7 +6960,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Radius", "Bloom spread distance");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "bloom_clamp", PROP_FLOAT, PROP_FACTOR);
@ -6969,7 +6969,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
prop, "Clamp", "Maximum intensity a bloom pixel can have (0 to disabled)");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 1, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "bloom_intensity", PROP_FLOAT, PROP_FACTOR);
@ -6977,7 +6977,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Intensity", "Blend factor");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_range(prop, 0.0f, 0.1f, 1, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
/* Motion blur */
@ -6985,14 +6985,14 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_MOTION_BLUR_ENABLED);
RNA_def_property_boolean_default(prop, 0);
RNA_def_property_ui_text(prop, "Motion Blur", "Enable motion blur effect (only in camera view)");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_default(prop, 8);
RNA_def_property_ui_text(prop, "Samples", "Number of samples to take with motion blur");
RNA_def_property_range(prop, 1, 64);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_FACTOR);
@ -7000,7 +7000,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 2);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
/* Shadows */
@ -7008,7 +7008,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_enum_default(prop, SHADOW_ESM);
RNA_def_property_enum_items(prop, eevee_shadow_method_items);
RNA_def_property_ui_text(prop, "Method", "Technique use to compute the shadows");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "shadow_cube_size", PROP_ENUM, PROP_NONE);
@ -7016,7 +7016,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_enum_items(prop, eevee_shadow_size_items);
RNA_def_property_ui_text(
prop, "Cube Shadows Resolution", "Size of point and area light shadow maps");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "shadow_cascade_size", PROP_ENUM, PROP_NONE);
@ -7024,14 +7024,14 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_enum_items(prop, eevee_shadow_size_items);
RNA_def_property_ui_text(
prop, "Directional Shadows Resolution", "Size of sun light shadow maps");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "use_shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SHADOW_HIGH_BITDEPTH);
RNA_def_property_boolean_default(prop, 0);
RNA_def_property_ui_text(prop, "High Bitdepth", "Use 32bit shadows");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "use_soft_shadows", PROP_BOOLEAN, PROP_NONE);
@ -7039,7 +7039,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_boolean_default(prop, 0);
RNA_def_property_ui_text(
prop, "Soft Shadows", "Randomize shadowmaps origin to create soft shadows");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "light_threshold", PROP_FLOAT, PROP_UNSIGNED);
@ -7049,7 +7049,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
"Minimum light intensity for a light to contribute to the lighting");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
/* Overscan */
@ -7060,7 +7060,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
"Overscan",
"Internally render past the image border to avoid "
"screen-space effects disappearing");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
prop = RNA_def_property(srna, "overscan_size", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, NULL, "overscan");
@ -7071,7 +7071,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
"internal render buffers");
RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 2);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
}
void RNA_def_scene(BlenderRNA *brna)

View File

@ -675,13 +675,13 @@ void RNA_def_shader_fx(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "mode", eShaderFxMode_Realtime);
RNA_def_property_ui_text(prop, "Realtime", "Display effect in viewport");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_ON, 1);
prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eShaderFxMode_Render);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Render", "Use effect during render");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_ON, 1);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL);
@ -695,7 +695,7 @@ void RNA_def_shader_fx(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eShaderFxMode_Expanded);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "Expanded", "Set effect expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);

View File

@ -392,25 +392,25 @@ static PyObject *bpy_app_autoexec_fail_message_get(PyObject *UNUSED(self), void
return PyC_UnicodeFromByte(G.autoexec_fail);
}
PyDoc_STRVAR(bpy_app_use_static_override_doc,
"Boolean, whether static override is exposed in UI or not.");
static PyObject *bpy_app_use_static_override_get(PyObject *UNUSED(self), void *UNUSED(closure))
PyDoc_STRVAR(bpy_app_use_override_library_doc,
"Boolean, whether library override is exposed in UI or not.");
static PyObject *bpy_app_use_override_library_get(PyObject *UNUSED(self), void *UNUSED(closure))
{
return PyBool_FromLong((long)BKE_override_static_is_enabled());
return PyBool_FromLong((long)BKE_override_library_is_enabled());
}
static int bpy_app_use_static_override_set(PyObject *UNUSED(self),
PyObject *value,
void *UNUSED(closure))
static int bpy_app_use_override_library_set(PyObject *UNUSED(self),
PyObject *value,
void *UNUSED(closure))
{
const int param = PyC_Long_AsBool(value);
if (param == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "bpy.app.use_static_override must be a boolean");
PyErr_SetString(PyExc_TypeError, "bpy.app.use_override_library must be a boolean");
return -1;
}
BKE_override_static_enable((const bool)param);
BKE_override_library_enable((const bool)param);
return 0;
}
@ -497,10 +497,10 @@ static PyGetSetDef bpy_app_getsets[] = {
(char *)bpy_app_debug_doc,
(void *)G_DEBUG_IO},
{(char *)"use_static_override",
bpy_app_use_static_override_get,
bpy_app_use_static_override_set,
(char *)bpy_app_use_static_override_doc,
{(char *)"use_override_library",
bpy_app_use_override_library_get,
bpy_app_use_override_library_set,
(char *)bpy_app_use_override_library_doc,
NULL},
{(char *)"use_event_simulate",
bpy_app_global_flag_get,

View File

@ -3681,27 +3681,27 @@ static PyObject *pyrna_struct_is_property_readonly(BPy_StructRNA *self, PyObject
return PyBool_FromLong(!RNA_property_editable(&self->ptr, prop));
}
PyDoc_STRVAR(pyrna_struct_is_property_overridable_static_doc,
".. method:: is_property_overridable_static(property)\n"
PyDoc_STRVAR(pyrna_struct_is_property_overridable_library_doc,
".. method:: is_property_overridable_library(property)\n"
"\n"
" Check if a property is statically overridable.\n"
"\n"
" :return: True when the property is statically overridable.\n"
" :rtype: boolean\n");
static PyObject *pyrna_struct_is_property_overridable_static(BPy_StructRNA *self, PyObject *args)
static PyObject *pyrna_struct_is_property_overridable_library(BPy_StructRNA *self, PyObject *args)
{
PropertyRNA *prop;
const char *name;
PYRNA_STRUCT_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "s:is_property_overridable_static", &name)) {
if (!PyArg_ParseTuple(args, "s:is_property_overridable_library", &name)) {
return NULL;
}
if ((prop = RNA_struct_find_property(&self->ptr, name)) == NULL) {
PyErr_Format(PyExc_TypeError,
"%.200s.is_property_overridable_static(\"%.200s\") not found",
"%.200s.is_property_overridable_library(\"%.200s\") not found",
RNA_struct_identifier(self->ptr.type),
name);
return NULL;
@ -3711,14 +3711,14 @@ static PyObject *pyrna_struct_is_property_overridable_static(BPy_StructRNA *self
}
PyDoc_STRVAR(
pyrna_struct_property_overridable_static_set_doc,
".. method:: property_overridable_static_set(property)\n"
pyrna_struct_property_overridable_library_set_doc,
".. method:: property_overridable_library_set(property)\n"
"\n"
" Define a property as statically overridable or not (only for custom properties!).\n"
"\n"
" :return: True when the overridable status of the property was successfully set.\n"
" :rtype: boolean\n");
static PyObject *pyrna_struct_property_overridable_static_set(BPy_StructRNA *self, PyObject *args)
static PyObject *pyrna_struct_property_overridable_library_set(BPy_StructRNA *self, PyObject *args)
{
PropertyRNA *prop;
const char *name;
@ -3726,20 +3726,20 @@ static PyObject *pyrna_struct_property_overridable_static_set(BPy_StructRNA *sel
PYRNA_STRUCT_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "sp:property_overridable_static_set", &name, &is_overridable)) {
if (!PyArg_ParseTuple(args, "sp:property_overridable_library_set", &name, &is_overridable)) {
return NULL;
}
if ((prop = RNA_struct_find_property(&self->ptr, name)) == NULL) {
PyErr_Format(PyExc_TypeError,
"%.200s.property_overridable_static_set(\"%.200s\") not found",
"%.200s.property_overridable_library_set(\"%.200s\") not found",
RNA_struct_identifier(self->ptr.type),
name);
return NULL;
}
return PyBool_FromLong(
(long)RNA_property_overridable_static_set(&self->ptr, prop, (bool)is_overridable));
(long)RNA_property_overridable_library_set(&self->ptr, prop, (bool)is_overridable));
}
PyDoc_STRVAR(pyrna_struct_path_resolve_doc,
@ -5476,14 +5476,14 @@ static struct PyMethodDef pyrna_struct_methods[] = {
(PyCFunction)pyrna_struct_is_property_readonly,
METH_VARARGS,
pyrna_struct_is_property_readonly_doc},
{"is_property_overridable_static",
(PyCFunction)pyrna_struct_is_property_overridable_static,
{"is_property_overridable_library",
(PyCFunction)pyrna_struct_is_property_overridable_library,
METH_VARARGS,
pyrna_struct_is_property_overridable_static_doc},
{"property_overridable_static_set",
(PyCFunction)pyrna_struct_property_overridable_static_set,
pyrna_struct_is_property_overridable_library_doc},
{"property_overridable_library_set",
(PyCFunction)pyrna_struct_property_overridable_library_set,
METH_VARARGS,
pyrna_struct_property_overridable_static_set_doc},
pyrna_struct_property_overridable_library_set_doc},
{"path_resolve",
(PyCFunction)pyrna_struct_path_resolve,
METH_VARARGS,

View File

@ -1112,14 +1112,14 @@ static int arg_handle_factory_startup_set(int UNUSED(argc),
return 0;
}
static const char arg_handle_enable_static_override_doc[] =
static const char arg_handle_enable_override_library_doc[] =
"\n\t"
"Enable Static Override features in the UI.";
static int arg_handle_enable_static_override(int UNUSED(argc),
const char **UNUSED(argv),
void *UNUSED(data))
"Enable Library Override features in the UI.";
static int arg_handle_enable_override_library(int UNUSED(argc),
const char **UNUSED(argv),
void *UNUSED(data))
{
BKE_override_static_enable(true);
BKE_override_library_enable(true);
return 0;
}
@ -2177,7 +2177,7 @@ void main_args_setup(bContext *C, bArgs *ba)
BLI_argsAdd(ba, 1, NULL, "--app-template", CB(arg_handle_app_template), NULL);
BLI_argsAdd(ba, 1, NULL, "--factory-startup", CB(arg_handle_factory_startup_set), NULL);
BLI_argsAdd(
ba, 1, NULL, "--enable-static-override", CB(arg_handle_enable_static_override), NULL);
ba, 1, NULL, "--enable-library-override", CB(arg_handle_enable_override_library), NULL);
BLI_argsAdd(ba, 1, NULL, "--enable-event-simulate", CB(arg_handle_enable_event_simulate), NULL);
/* TODO, add user env vars? */