Set customized texture to compound shapes programmatically

Typically: "How do I... ", "How can I... " questions
Post Reply
cxt
Posts: 16
Joined: 08 Sep 2020, 04:12

Set customized texture to compound shapes programmatically

Post by cxt »

Hi,

As in the title, I want to set customized texture to compound shapes programmatically, which I found 'sim.setShapeTexture' didn't work (it worked perfectly on single shapes). I found 'quick texture' in simulator ui can work also but didn't find corresponding api. Do you have any suggestions without changing shape structure?

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

Re: Set customized texture to compound shapes programmatically

Post by coppelia »

Hello,

I think the best you can do is to ungroup the shape, apply the texture, the group it again. Have a look at sim.ungroupShape and sim.groupShape.

Cheers

Post Reply