You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simply, allow textures:get() to pull from a .png file in the Avatar's folder instead of needing to be embedded in a blockbench model or encoded. It's a small change on the user end, but it'd be a nice touch for my personal use case.
The text was updated successfully, but these errors were encountered:
You can tell Figura to load files in the avatar's folder with the resources key in the avatar.json metadata. This will cause the files to be uploaded with the avatar so they can be used almost like normal.
resources is a list of file globs.
{
"resources": [
"*.res.png", // Loads any file with the extension `.res.png` in the avatar root."**/icon.png", // Loads any file called `icon.png` in any subfolder of the avatar."etc."
]
}
These resources can then be loaded with the Resources API.
localbuffer=data:createBuffer()
buffer:readFromStream(resources:get("path/to/file.png")) -- File path starts at avatar's root folder.buffer:setPosition(0)
localnewTexture=textures:read("newTextureName", buffer:readBase64(buffer:getLength()))
buffer:close()
-- After this, any function can reference `newTexture` as the texture to use.
It's not exactly the most pretty thing because you have to deal with Figura's (imo annoying) file IO implementation.
Request Description
Simply, allow
textures:get()
to pull from a .png file in the Avatar's folder instead of needing to be embedded in a blockbench model or encoded. It's a small change on the user end, but it'd be a nice touch for my personal use case.The text was updated successfully, but these errors were encountered: