17/05/2019 at 08:06 #14435
Does vc support light source addition to component?what can i do if i want add a blinking light source in a component.In some scenerio, it is quite useful.
Thanks a lot.
You need to login in order to like this post: click here17/05/2019 at 08:20 #14439
You can do that using the python API. The light sources can’t be attached to a component but you can modify the position of the light in a script in the OnSimulationUpdate event to keep the light ‘attached’ to a component.
This snippet shows the basics.Python12345678910from vcScript import *import vcVectorapp = getApplication()L = app.findLight('MyLight')if not L:L = app.createLight('MyLight')p = vcVector.new(1000,1000,300)L.Position = pL.Type = VC_LIGHT_POINT
Then you can make it blink like this:Python123456...delay(1)L.Enabled = Truedelay(1)L.Enabled = False...
You need to login in order to like this post: click here20/05/2019 at 07:57 #14473
Thanks so much for your reply，but it seem do not work as you told.I did not see any light in VC 3D world,I have tried to scirpt both in componet and plugin form .Did you test it in your VC, I am not sure where went wrong.
You need to login in order to like this post: click here20/05/2019 at 10:10 #14487
You could try to increase the intensity of the light to see the effect more clearly.
L.Intensity = 1000.0
That value is quite large but you should see if it works.
You need to login in order to like this post: click here20/05/2019 at 16:46 #14499
Also notice that the location 1000,1000,1000 in the example script is world coordinates. You could use e.g. app.OnRender event to update the location of the light dynamically.
Also the light acts a little differently in the Shaded mode than in the RealisticShaded mode. I’ll try to add some example light components in the online ecat.
You need to login in order to like this post: click here21/05/2019 at 08:22 #14502
I got another question troubling me for some time, does VC have a mouse click event Python api when clicking a component or i have to use the netCommand to do it(which one), I would like to script it inside the component.Please enlighten me,thank you.
You need to login in order to like this post: click here21/05/2019 at 10:51 #14517
Please use more suitable thread. If you can’t find one, please create a new one.
This thread is for “Light Source”
You need to login in order to like this post: click here28/05/2019 at 03:43 #14706
You must be logged in to reply to this topic.