From 2bc0bcbd26c809ce09f6c869515ce68d18120fdf Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Tue, 10 Jan 2023 00:04:35 -0600 Subject: PropertyUsage: Rename "DO_NOT_SHARE_ON_DUPLICATE" to "ALWAYS_DUPLICATE" --- doc/classes/@GlobalScope.xml | 4 ++-- doc/classes/Resource.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 2be15d5100..2f2165239a 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2664,8 +2664,8 @@ The property is an array. - - If the property is a [Resource], a new copy of it is always created when calling [method Node.duplicate] or [method Resource.duplicate]. + + When duplicating a resource with [method Resource.duplicate], and this flag is set on a property of that resource, the property should always be duplicated, regardless of the [code]subresources[/code] bool parameter. The property is only shown in the editor if modern renderers are supported (GLES3 is excluded). diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index e533fc1e32..7b6dd7d987 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -24,7 +24,7 @@ Duplicates this resource, returning a new resource with its [code]export[/code]ed or [constant PROPERTY_USAGE_STORAGE] properties copied from the original. - If [param subresources] is [code]false[/code], a shallow copy is returned. Nested resources within subresources are not duplicated and are shared from the original resource. This behavior can be overridden by the [constant PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE] flag. + If [param subresources] is [code]false[/code], a shallow copy is returned. Nested resources within subresources are not duplicated and are shared from the original resource. This behavior can be overridden by the [constant PROPERTY_USAGE_ALWAYS_DUPLICATE] flag. [b]Note:[/b] For custom resources, this method will fail if [method Object._init] has been defined with required parameters. -- cgit v1.2.3 From 2a65f6812b98ef24ad2fb156376932a87b55062f Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Tue, 10 Jan 2023 14:42:05 -0600 Subject: Add PROPERTY_USAGE_NEVER_DUPLICATE flag and use for script Co-authored-by: Yakov Borevich --- doc/classes/@GlobalScope.xml | 19 +++++++++++-------- doc/classes/Resource.xml | 3 ++- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 2f2165239a..4fdb7d82c5 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2667,22 +2667,25 @@ When duplicating a resource with [method Resource.duplicate], and this flag is set on a property of that resource, the property should always be duplicated, regardless of the [code]subresources[/code] bool parameter. - + + When duplicating a resource with [method Resource.duplicate], and this flag is set on a property of that resource, the property should never be duplicated, regardless of the [code]subresources[/code] bool parameter. + + The property is only shown in the editor if modern renderers are supported (GLES3 is excluded). - + - + - + - + - + - + - + The property is read-only in the [EditorInspector]. diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index 7b6dd7d987..67f466ad4c 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -24,7 +24,8 @@ Duplicates this resource, returning a new resource with its [code]export[/code]ed or [constant PROPERTY_USAGE_STORAGE] properties copied from the original. - If [param subresources] is [code]false[/code], a shallow copy is returned. Nested resources within subresources are not duplicated and are shared from the original resource. This behavior can be overridden by the [constant PROPERTY_USAGE_ALWAYS_DUPLICATE] flag. + If [param subresources] is [code]false[/code], a shallow copy is returned; nested resources within subresources are not duplicated and are shared from the original resource. If [param subresources] is [code]true[/code], a deep copy is returned; nested subresources will be duplicated and are not shared. + Subresource properties with the [constant PROPERTY_USAGE_ALWAYS_DUPLICATE] flag are always duplicated even with [param subresources] set to [code]false[/code], and properties with the [constant PROPERTY_USAGE_NEVER_DUPLICATE] flag are never duplicated even with [param subresources] set to [code]true[/code]. [b]Note:[/b] For custom resources, this method will fail if [method Object._init] has been defined with required parameters. -- cgit v1.2.3