Page 1 of 1

Texture import from plugin

Posted: 07 Mar 2014, 18:21
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.

Re: Texture import from plugin

Posted: 07 Mar 2014, 19:45
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...

Re: Texture import from plugin

Posted: 09 Mar 2014, 15:23
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.

Re: Texture import from plugin

Posted: 10 Mar 2014, 11:28
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

Re: Texture import from plugin

Posted: 10 Mar 2014, 12:16
by hjeldin
Well, thanks, will look forward for the new release!
Meanwhile, i'll try with your suggested workaround.


Thanks,
Riccardo.

Re: Texture import from plugin

Posted: 12 Mar 2014, 14:14
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.

Re: Texture import from plugin

Posted: 13 Mar 2014, 10:52
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