There are two caches used for DataModelContent - there is a cache on the server, and one on the client.
When the server completely deletes every Content that references a certain DataModelContent, that DataModelContent will be deleted from the server, and the budget will be freed up.
At that point, you might still be using that DataModelContent on a client. That’s fine, and will continue to work on the client. You’ll be taking up some room in the client’s cache. Once all Content references on the client that point to that DataModelContent are removed, the DataModelContent will be removed from the client.
Hello, AssetService::CreateDataModelContentAsync supports contents from EditableMesh and EditableImage as input. So, if your meshPart’s TextureContent is an EditableImage, you should be able to pass in that textureContent directly. Were you trying to pass in a different type of TextureContent other than an EditableImage? If so, can you share a bit more about your specific use case?
This is the code snippet i was using when i got the error
local texture = data.Part.TextureContent
local editableImage = texture.Object :: EditableImage
local _, dataModelContent = AssetService:CreateDataModelContentAsync(texture)
if editableImage then editableImage:Destroy() end
if dataModelContent then
data.Part.TextureContent = dataModelContent
end
my script creates a normal editable image and at the end of the loop and it creates it into a datamodel content, and when the function gets called again the editable image gets created from the datamodel content and thats when it errors. Basicially:
Hello! From a quick look at your snippet, it seems you are calling AssetService:CreateDataModelContentAsync(texture), where texture comes from data.Part.TextureContent. Just to clarify—is data.Part.TextureContent definitely an EditableImage at that exact point in the script?
A repro file would be great!
Hello, thanks for rblx! I notice that in the line above local texture = plane.TextureContent, plane.TextureContent is assigned to imageContent, and the imageContent is a dataModelContent. Feel free to add print(texture) and print(editableImage) after line 59 to check their types and values. To create an EditableImage from DataModelContent, you can call local ei = AssetService:CreateEditableImageAsync(texture). Let me know if this helps or if you have any other questions!
omg i am so sorry, my brain is like melted right now, and that was prob the worst repo file ever made throughout history, sorry for all that
also i got a question, will we ever be able to use DataModelContent with CreateSurfaceAppearance? Currently that requires the texture maps to be a editable image but it would be extremely helpful if we were allowed to use DataModelContent with it since were pretty limited on live budget
yeah, live budget as in the normal memory limit for editable images and unfixed editable meshes
when i say live i mean it as in being able to actively modify it
Little late, but there’s a work around for this. I simply only generate things that the player currently sees in the scrollcontainer instead of keeping all children loaded. You have to implement manual positioning, but it works great. I can potentially have hundreds of thousands of items in a container with tiny ram usage (only from how you store the data and the instances you need to fill the view), because I create instances for only what is visible.
We are excited to announce that CreateDataModelContent is now available in published experiences. With this API you can now “bake” editable mesh and image data into static Content for the lifetime of the session when you no longer need to edit them.
Please continue providing bug reports, feedback and sharing what you have made in this dev forum post.