Hello! I am trying to display all of a user’s limited items, but I am having trouble adjusting the viewport frame to get a good view of the limited. Also, I am using Module3D V6.
That was a result of trying to use :GetExtentsSize(). Doesn’t really work
Anyone ever done this before, or have any idea what I should do? I tried searching but no luck.
Edit: Realized that GetExtentsSize doesn’t really work because some accessories have a really weird model size for no apparent reason.
Hopefully this can help you figure out what you need to do to your viewport frame’s camera.
You first need to get the model size, get the axis with the highest number so it will all fit, then multiply that number (which basically changes the distance that should stay consistent) until it all fits nicely, and then set your CFrame of your camera to what I did.
local Model = workspace.Model
local PrimaryPart = Model.PrimaryPart
local Camera = workspace.Camera -- Path to your camera
local Size = Model:GetExtentsSize() -- Get the extents size of the model
local LongestAxisSize = math.max(Size.X, Size.Y, Size.Z) -- Get the largest number whether it be the X, Y, or Z number.
local Distance = LongestAxisSize * 2 -- The higher the second number, the farther away the camera will be from the part.
-- Set the CFrame of the camera (Position, lookAt).
-- Position is a Vector3 value that decides where your camera will be at. I first set the base position then add the offset in the front direction of the primary part, then I multiply it by however much is needed.
-- lookAt is a Vector3 value that has your camera look at the Vector3 position.
Camera.CFrame = CFrame.new(PrimaryPart.Position + (PrimaryPart.CFrame.LookVector * LongestAxisSize * 2), PrimaryPart.Position)
I ran into this issue awhile back too but I’m not really sure what you could do unless if anyone else can come up with something better.
Perhaps you could create some kind of script to automate the process and run it in studio to collect all of the limiteds published by Roblox and then save it in ServerStorage and then change the size of every part to what you want it to be (or output if it works to replace them to MeshParts) then copy them to the client as needed?
This api page should work fine: https://catalog.roblox.com/v1/search/items/details?Category=2&CreatorName=Roblox
It is limited to pages meaning you cannot view all the data at once. After getting the data from each page you can iterate to the next page from the ‘nextPageCursor’ at the beginning of the table.
Example: This would give you page two: https://catalog.roblox.com/v1/search/items/details?Category=2&CreatorName=Roblox&Cursor=2_1_ef67c9fe430910dac158519e724efcd7
You would also need to use a proxy to access Roblox’s API from studio, rprxy.xyz is a good one.
You can just replace ---.roblox.com to ---.rprxy.xyz
Example:
local HttpService = game:GetService("HttpService")
local Total = {} -- Fill this table in with the page information (should be under Page.data)
local NextCursor
while true do
local Page = HttpService:JSONEncode(HttpService:GetAsync("http://catalog.rprxy.xyz/v1/search/items/details?Category=2&CreatorName=Roblox&Cursor=" .. NextCursor))
-- Break the loop if there's no more pages to go through. If there is more pages, set NextCursor so we can read through that page next iteration.
if not Page.nextPageCursor then
break
else
NextCursor = Page.nextPageCursor
end
wait(0.25) -- Can't spam too many web requests at once.
end
Seems like quite the task, but why not. Will reply how it goes.
How would I change the cursor? Changing Cursor=2… to Cursor=1… or any other number gives an error
Edit: Nevermind, the next page link is contained within the info you get from the table it returns.
Edit 2: began writing a script in studio to try and automate this process, I don’t know why. Doesn’t change the fact that scripts can’t access MeshId for some reason. Not sure how else to do this. Going through and changing every mesh in the properties window just won’t work.
You don’t need to use a proxy or HttpService for grabbing asset thumbnails.
The reason it is returning that symbol is because you’re attempting to grab an image but you can’t display images that are outside of Roblox’s domain in-game so the function below should work better.