File not found when import shape

Typically: "How do I... ", "How can I... " questions
Post Reply
gplminhduc147
Posts: 14
Joined: 25 May 2024, 01:58

File not found when import shape

Post by gplminhduc147 »

Hello. When I use sim.importShape in order to import a .obj file into CoppeliaSim environment, It kept return:
in sim.importShape: file not found.

I have check and make sure that my simulation file (.ttt file) and object file are in the same folder.
My capture for more detail:
https://drive.google.com/file/d/1tnmfW_ ... drive_link

My child script in python code to import object is below:

Code: Select all

def sysCall_actuation():
        inStrings = [1, "VREP/objects", "shape"]
        inFloats = [0, 0, 0, 0, 0, 0, 0, 0, 10, 0]
        def function(inFloats, inStrings):
                inMeshPath = inStrings[1]
                inShapePosition = {inFloats[1], inFloats[2], inFloats[3]}
                inShapeOrientation = {inFloats[4], inFloats[5], inFloats[6]}
                inShapeShapeColor = {inFloats[7], inFloats[8], inFloats[9]}
                shapeHandle = sim.importShape(0, inMeshPath, 0, 0, 1)
        function(inFloats, inStrings)
        pass
Thank you.
coppelia
Site Admin
Posts: 10747
Joined: 14 Dec 2012, 00:25

Re: File not found when import shape

Post by coppelia »

Hello,

what is the output if you print(inMeshPath)?
Is it an absolute or relative path?

Cheers
gplminhduc147
Posts: 14
Joined: 25 May 2024, 01:58

Re: File not found when import shape

Post by gplminhduc147 »

coppelia wrote: 17 Jun 2024, 07:39 Hello,

what is the output if you print(inMeshPath)?
Is it an absolute or relative path?

Cheers
Hi. It's me again.
I've already solved the problem. I forgot to put the full direction to the object.
For detail. I tried change the direction into "C:/...(My direction)/VREP/1.obj" and It worked !!!

Anyway, thank you for your support. You are the best, cheers
Post Reply