Getting the image ID of a model in code?

How do I get the image of a model in code? Im making a cell system which references its parent which is a model and I have a picture inside the model that I wanna set to the model image. I checked the wiki and it had no information that I could find on the topic.

1 Like

https://devforum.roblox.com/t/how-do-i-get-the-thumbnail-of-a-model-in-game/12003/2?u=xaxa

http://www.roblox.com/thumbs/asset.ashx?width=110&height=110&assetId=<MODEL ID HERE>

Replace the assetId at the end with your model’s ID.

4 Likes

But how do I get the model id in code? is it like model.ImageId?

Like… A model that’s already in-game? Then there’s really no way to do that. Use a ViewportFrame.

1 Like

If you’re contemplating about using ViewportFrame, read above(which also includes the points of Blender for preview images and compares between both). If you need further information, search through the DevForum.

For the model ID, re-use the ID after insertion or if you have specific models, use an array of them. A sample of a line below here:
local modelThumbnail = "http://www.roblox.com/thumbs/asset.ashx?width=110&height=110&assetId=" .. modelId

1 Like

@Operatik Same thing(s) that XAXA posted, which seems not to be the answer to the issue.

You can only get the image ID of a model uploaded to the site. Otherwise, you can’t get an image of a model from in-game without ViewportFrames (not an image either, just an alternate display method).

Don’t know what the thread is asking otherwise, really.

2 Likes

jeez u can just do this:
http://www.roblox.com/Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&aid=IDHERE

Thank you for the post - please read up carefully before bumping a thread that’s years old with info that’s already been posted. Endpoints to get the thumbnail of a model have already been posted twice which seem not to have answered OP’s question. The question was leaning more towards getting a thumbnail for a model that has not been uploaded to the site, to which no such method exists.

If OP wants a model thumbnail they have to upload it to the site first before a thumbnail can be generated for website asset information pages. If they do not upload the model then no thumbnail will exist for the model and they will have to opt for options like ViewportFrames.

2 Likes