WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Headlight is not disabled (https://forum.worldviz.com/showthread.php?t=5485)

Samuli 08-20-2015 05:38 AM

Headlight is not disabled
 
Hi,
I've started to develop using Vizard and VizMove and I encountered a following problem:
the headlight isn't disabled using the following code:
Code:

import viz

viz.go()

showroom=viz.add('ShowroomLightmap1.osgb')



headlight=viz.MainView.getHeadLight()
headlight.disable()

Is there a solution to that problem?

Jeff 08-21-2015 10:07 AM

If the model is exported with a light map it will be lit without real-time lights. What are you trying to achieve with lighting?

Samuli 08-21-2015 02:55 PM

Thanks for your answer. For now the model is only partially light mapped because it's under development. The light mapped parts of the model were self illuminated in Vizard, but it seemed that the parts that were not light mapped got illuminated by the headlight, which is what I didn't want. I guess I can avoid the problem in the future by giving a self illuminating texture to all parts of the model. So far I'm trying to achieve a lighting without the headlight, just self illuminating textures or black unlit objects.

Jeff 08-24-2015 02:11 PM

The code you posted will disable the headlight. Do you have any other real time lights added in your script?

To prevent real time lights from affecting the model you can either
  • check the 'turn off lighting' option in the OSG exporter
  • disable lighting on the model through the script

Samuli 08-25-2015 04:14 AM

Thanks for your answer. There are no other real time lights added in the script. The osg export settings of the model were probably wrong. There were lights in the scene of the model file and they were surely exported, which might have caused the problem. Also the 'turn off lighting' option wasn't checked. How do you disable lighting (else than the headlight) of a model through the script, if there are not any lights added via script ?

Jeff 08-25-2015 09:50 AM

Use the following to disable real time lights on the model:

Code:

model.disable(viz.LIGHTING)

Samuli 08-28-2015 12:33 AM

Thanks, that code solves the problem.


All times are GMT -7. The time now is 12:14 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC