Viewpoint Forums
Viewpoint Forums
JavaScript
Change Lightmap from Javascript|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Member |
I need to change the lightmap of an object from javascript by specifying the new lightmaps file name. I found a post which had a link to an example but the page could not be displayed.
|
||
|
|
Member |
Shawn,
Could you point me to the post and maybe I can figure out where the example is on our servers. |
|||
|
|
Member |
|
|||
|
|
Member |
Shawn, you would do this in much the same way as you are trying to do in the other post with diffuse texture:
function myFunc(){ vmp.SetProperty('MTSTimeElem.myLoaderElem','Path','mylightmap.jpg','mts_str'); vmp.SetProperty('MTSScene','nerd',1,'mts_int'); } Whenever you do something to swap textures in the scene from javascript, it is sometimes necessary to re-render the scene to see the change. Just a note on what the last line is for. |
|||
|
|
Member |
I am trying to get this working but it is not updating the light map here is my code
<MTSInstance Name="truck_bottom" > <Transform> <Scale x="0.0024" y="0.0024" z="0.0019" /> <Rotate x="0" y="0" z="90" /> <Position x="0.0276" y="-0.0943" z="0.0117" /> </Transform> <MTSGeometry Name="truck_bottom_GEOM" BackFaceDir="-1" /> <MTSMaterial Name="truck_material" ID="0"> <MTSTextureMap Type="Light" Name="truck_texture"/> </MTSMaterial> </MTSInstance> <MTSTimeElem Type="MTSImageStream" Path="resources/lightmaps/chrome05.jpg" Name="truck_texture_control" Comp="0"> <Target Name="MTSTexture.truck_texture" /> </MTSTimeElem> |
|||
|
|
Member |
|
|||
|
| Powered by Eve Community |
| Please Wait. Your request is being processed... |
|
Viewpoint Forums
Viewpoint Forums
JavaScript
Change Lightmap from Javascript
