#Any reason ForceBakingOnDisabledComponentsAttribute is internal?

1 messages · Page 1 of 1 (latest)

wintry idol
#
/// <summary>
/// Attribute that informs the baking system that bakers need to be run on the authoring component
/// even when the authoring component is disabled.
/// </summary>
internal class ForceBakingOnDisabledComponentsAttribute : Attribute { }```
Is there a reason this is internal? It doesn't seem used anywhere within any of the entities packages so seems like it was designed for users (and I'd like to use it, which I will, just curious about the reasoning)
flint aurora
#

I would've sworn the baking system didn't care if the authoring component was disabled and would run the baker anyways. My fairly old authoring scripts had manual if (!authoring.enabled) return; at the start. Those scripts date back a long time though. When did they start using the enabled state?

wintry idol
#

as far as I recall forever, some baking code

// We don't bake disabled components
bool isDisabled = component.Component.IsComponentDisabled();

// Rebake all bakers for this component
for (int i = 0, n = bakers.Length; i < n; ++i)
{
    var baker = bakers[i];

    // We don't run bake if the baker belongs to a disabled assembly, unless this Baker is enforcing it specifically
    if (!baker.AssemblyData.Enabled || (isDisabled && !baker.ForceBakingForDisabledComponents))
        continue;```