Skip to content

Expanded setSecondaryTexture#80

Closed
cad3264 wants to merge 1 commit into
FiguraMC:mainfrom
cad3264:patch-1
Closed

Expanded setSecondaryTexture#80
cad3264 wants to merge 1 commit into
FiguraMC:mainfrom
cad3264:patch-1

Conversation

@cad3264

@cad3264 cad3264 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Using setSecondaryTexture without any values removes it, this is very helpful to know since using getSecondaryTexture returns ("PRIMARY", nil), which doesn't work in setSecondaryTexture.

Using setSecondaryTexture without any values removes it, this is very helpful to know since using getSecondaryTexture returns ("PRIMARY", nil), which doesn't work in setSecondaryTexture.
@penguinencounter

Copy link
Copy Markdown
Contributor

getSecondaryTexture returning "PRIMARY" is not intended (it's a side effect of this bit of code that just assumes that the default is "PRIMARY" in all cases, which it isn't)

Technically, passing nil to setSecondaryTexture removes the override from the secondary texture. This is not the same as removing the secondary texture in a few ways:

  • The default secondary texture (the _e texture, since the default behavior of the secondary layer is to render emissives) is used if nothing is overriding it
    • this is the same texture that is used if you setSecondaryTexture("SECONDARY")
  • Any texture override (i.e. explicit configuration with setSecondaryTexture) of a parent part will take priority over the default usage of the _e texture

@cad3264

cad3264 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

getSecondaryTexture returning "PRIMARY" is not intended (it's a side effect of this bit of code that just assumes that the default is "PRIMARY" in all cases, which it isn't)

Technically, passing nil to setSecondaryTexture removes the override from the secondary texture. This is not the same as removing the secondary texture in a few ways:

  • The default secondary texture (the _e texture, since the default behavior of the secondary layer is to render emissives) is used if nothing is overriding it

    • this is the same texture that is used if you setSecondaryTexture("SECONDARY")
  • Any texture override (i.e. explicit configuration with setSecondaryTexture) of a parent part will take priority over the default usage of the _e texture

Ah, I did not know that, but this should probably be in the documentaion.

@cad3264 cad3264 closed this Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants