Texture import from plugin

Typically: "How do I... ", "How can I... " questions
Post Reply
hjeldin
Posts: 9
Joined: 17 Jan 2014, 02:47

Texture import from plugin

Post by hjeldin »

Hello,
i'm trying to import a texture from vrep_plugin, but i can't find any function in regular api that allows that.
Any suggestion?

Thanks,
Riccardo Arena.

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

Re: Texture import from plugin

Post by coppelia »

Hello Riccardo,

what exactly are you trying to achieve?
Currently, you can only import a texture if it is directly associated with a shape. You can use simImportShape, but you have to make sure to import from the OBJ fileformat, only then will the textures be preserved.

But depending on what you are trying to achieve, there might be other possibilities.

Cheers

EDIT: checking the source code, I see that the texture will be removed when using the simImportShape...

hjeldin
Posts: 9
Joined: 17 Jan 2014, 02:47

Re: Texture import from plugin

Post by hjeldin »

Hi, thanks for the fast answer.
We're trying to co-simulate the execution of our tasks on both youbot and the simulator. In order to do so, we need to be able to import markers found in the simulation arena into v-rep.
I know there's the option to use simInsertShape, but since the markers are lying on planes, we thought it could be simpler to insert a plane and apply a texture on it.

As a last resort i can extend v-rep core to expose this behaviour, but i guess it's not that simple :)

Thanks,
Riccardo.

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

Re: Texture import from plugin

Post by coppelia »

You could also prepare your textured shapes beforehand (in an invisible layer), then copy and paste them to the needed location and make them visible. For that, have a look at simCopyPasteSelectedObjects.

In next release (V3.1.1, that will be released around March 20th 2014), there will be a dedicated function for what you are trying to do: simCreateTexture.

Cheers

hjeldin
Posts: 9
Joined: 17 Jan 2014, 02:47

Re: Texture import from plugin

Post by hjeldin »

Well, thanks, will look forward for the new release!
Meanwhile, i'll try with your suggested workaround.


Thanks,
Riccardo.

hjeldin
Posts: 9
Joined: 17 Jan 2014, 02:47

Re: Texture import from plugin

Post by hjeldin »

Ok, i managed to modify the source of libv_rep.so in order to expose texture attachment functionality on both lua and remote api.
If anyone is interested, i can share the code. Speaking of which, are there any particular restrictions on public repositories? I noticed that you don't have a public repo on github.

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

Re: Texture import from plugin

Post by coppelia »

Hello Riccardo,

you are free to distribute the code of libv_rep.so which is licensed under GNU GPL.
Currently we are still working with a master code that allows to generate the various specific libraries (e.g. master --> edu, master --> player, master --> headless (future)), that's why we still don't have a public repository.

Cheers

Post Reply