Is it possible to associate a customization script to an object using the lua API?

Typically: "How do I... ", "How can I... " questions
Post Reply
thomas_exwzd
Posts: 3
Joined: 09 Jan 2020, 03:47

Is it possible to associate a customization script to an object using the lua API?

Post by thomas_exwzd »

Hi,

I'm trying to dynamically generate scripts and associate them to scene objects, but I'm facing issues when it comes to customization scripts. Here is the kind of code I'm running

Code: Select all

local script = sim.addScript (scType)
sim.setScriptText            (script, scText)
sim.setScriptAttribute       (script, sim.scriptattribute_enabled, true)
sim.associateScriptWithObject(script, object)
Functions return no error, however, if I create a customization script, it is not associate to the object (it works with child scripts and threaded child scripts)

If I check the source code on github (file interfaces/simInternal.cpp of the repository CoppeliaSimLib), the line 5842 seems to suggest that the function should word for both customization scripts and child scripts, but lines 5855 to 5860, only the child scripts seems to be taken into account and the customization scripts seems to simply be ignored.

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

Re: Is it possible to associate a customization script to an object using the lua API?

Post by coppelia »

Hello Thomas,

yes, there is a bug that we probably introduced recently. We will fix it and you should be able to download the corrected version V4.0.0.rev4 hopefully by the end of the day.

Thanks again,
cheers

thomas_exwzd
Posts: 3
Joined: 09 Jan 2020, 03:47

Re: Is it possible to associate a customization script to an object using the lua API?

Post by thomas_exwzd »

Thanks for your answer. I'll check that.

Post Reply