Maximum threshold of objects that can be uploaded

Typically: "How do I... ", "How can I... " questions
Post Reply
cca
Posts: 2
Joined: 09 Aug 2021, 05:27

Maximum threshold of objects that can be uploaded

Post by cca »

I am currently trying to learn V-rep. For some reason the interface has significantly slowed down.
Is there a maximum threshold of objects that can be uploaded? I have simplified most responable and collidable objects in my scene. Or is there a way to know the overall mesh count of the mentioned objects so at least the user can have an idea how much mesh count is optimal?

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Maximum threshold of objects that can be uploaded

Post by coppelia »

Hello,

your scene shouldn't contain much more than 2000 objects, otherwise you are doing something wrong. If you need to create a lot of individual shapes, then you probably can group some of them to a single entity via sim.groupShapes.

With <ctrl-a> you can select all objects in the scene and immediately see how many there are (displayed at the top of the 3D part). You can also specifically check how many shapes you have in the scene by typing:

Code: Select all

sim.getObjectsInTree(sim.handle_scene,sim.object_shape_type)
If a given shape contains a large amount of triangles, then you could also see some slowdowns. Typically, try to create models with 5'000-10'000 triangles. Your whole scene shouldn't contain more than 200'000 to 500'000 triangles. You can check this with following code:

Code: Select all

function sysCall_init()
    local l=sim.getObjectsInTree(sim.handle_scene,sim.object_shape_type)
    local mmax=0
    local tot=0
    for i=1,#l,1 do
        local vert,ind=sim.getShapeMesh(l[i])
        tot=tot+#ind/3
        if #ind/3>mmax then
            mmax=#ind/3
        end
    end
    print(string.format("The scene contains a total of %i triangles. The largest shape contains %i triangles",tot,mmax))
end
Cheers

Post Reply