Being able to change ColorMap in Surface Appearance during runtime despite the API saying you can't

I don’t have the permissions required to type in there sadly

1 Like

@Pan_Shyrikys

Sorry, it’s not very clear from your repro steps what is the issue? Could you clarify a bit more please?
Are you changing the ColorMap from scripts and expect and error? If so please provide a placefile with a script and steps to reproduce.

Thanks!

1 Like

The API says that you cannot change any of the SurfaceAppearance properties with a script due to lack of security permission and if you do it manually with something like a color map the engine doesn’t update it, although if you do everything in the repro steps it will update the map. My proposition is to ideally either make A: if no ColorMap is present it will instead of the TextureId first instead of BasePart.Color. B: Make ColorMaps changeable with scripts (although you would have to perform this glitch in order to even use it). Option A in my opinion should’ve been the default behavior since in a lot of cases you want a ColorMap/TextureId used with a SurfaceAppearance which is currently impossible to do with any of the tools provided by the engine

1 Like

The post itself explains the reproduction steps for the glitch in Option B

1 Like

“The current thread cannot write ‘ColorMap’ (lacking capability Plugin)”

while we wait, is there any different approach?

If there was I probably wouldn’t have created this bug report in the first place, I tried every single instance that could plaster an image onto a mesh but only decal overwrites surface appearance and you cant use uv maps in decals, so it didn’t work. Any other method just doesnt let a texture overwrite the colormap property. It would be great if this was a thing since for example 3D muscles with normal maps with avatar clothing could be done, you can do it without the normal map part but you would have to sacrifice tons of performance, to the point where the player would have over 100 THOUSAND triangles if its R15 and roughly 60 thousand on R6, neither of which is ideal. With the use of normal maps it drops down to roughly 7000-8000 triangles with a good looking mesh, the number depends on the mesh’s complexity and the topology.
image-48-2
(image wasnt done via avatar clothing but rather manually setting the colormap property beforehand)

i also had to force myself manually setting the colormap property while in studio just like what you did

Any movement on this? The repo steps are just create a SurfaceAppearance, change the ColorMap at runtime

I have recently encountered this myself. It is flat stated in the API documentation that those properties of SurfaceAppearance cannot be accessed by scripts. Why I don’t know. I did make a feature request about this awhile back to at least allow read access from scripts so games that use automatic asset Id aggregation programs to gather asset Ids for use in ContentProvider:PreloadAsync() can pickup those asset Ids and have the client preload them.

You can view the feature request here: Allow read access to texture properties in SurfaceAppearance and MaterialVariant

EDIT:

@neutrinostack I was looking at the documentation and it shows that those properties are now read only. But now when I tried it in a script, it throws an error. I also checked MaterialVariant and it was changed too.

So someone changed the documentation to say that this is read only by scripts now, but it wasn’t changed in the engine. Go figure.

1 Like

Is there any update regarding this? Its ridiculous that something like this hasnt been sorted out yet.

“The current thread cannot write ‘ColorMap’ (lacking capability Plugin)”

This is the bane of my existence

1 Like

@Pan_Shyrikys Your request to being able to change ColorMap from Luau looks more like a Feature Request, which should be shared in the Feature Requests category.
I’ve tried the repro steps from the initial post. Yes, manually, in the Studio you can copy-paste and set the assets IDs for the SA maps, but not from a script.

@Maelstorm_1973 Could you please create a new Bug Report and describe the issue with the mismatch between the Documentation and the Luau. That would be the easiest way for it to get reviewed and assigned to the correct team.

@neutrinostack Very well.

EDIT:

New bug report has been posted. It can be viewed here: MaterialVariant.ColorMap cannot be accessed from scripts even though the documentation says that you can

I’m not gonna lie them just fixing the API instead of changing the behavior didn’t solve the problem whatsoever sadly

They are only allowing plugins to even have access to those properties. You can’t even read the values from a script. Why I don’t know. Turns out the documentation was wrong.

Yeah but changing the API never fixed the issue we’re encountering. I don’t think that being able to change the color map during runtime should be so difficult for the engine to process. TextureId works just fine and it’s practically the same thing. TextureId doesn’t override the ColorMap property either. I can’t physically make a feature request due to not being a “Regular” and I have been trying for months to request a fix to this issue in any way because currently, I cannot change the texture on top of the mesh while it has a surface appearance on it https://gyazo.com/1d21c546175b1b8cdb6853fe126a5b90 and because neither can I change the color map (because of plugin security) nor can I use TextureId to overlap an EMPTY colormap as you saw in the gyazo gif. This leaves me with only 2 options: either scrap the whole idea and leave it as is and never add the feature into the game OR make it only work with preset clothes which comes with it’s own can of worms.

1 Like

Well, if you want to make a feature request, send a DM to @ Bug-Support (no space) in the format that they request.

FYI Bug Support doesn’t allow you to send feature requests that way anymore, you can request to join the @AllowFeatureRequests group though

They don’t? I was not aware of that.

It would be great to allow us to change the ColorMap property during runtime