Deadalus
05-16-2006, 01:57 AM
hello all,
i need he;p for this one. im trying to do a tool to change light propertie in a massive ways so they are ALL the same. (not very useful its mainly to learn)
so anyways i'm trying to add a drop downlist for the shadowtype.
it work ie. not error message but the shadow doesnt change. So here the script for those who dare.
BTW its not the main point of the thread but if some of you found better way to build script or optimisation trick, i'll be more than happy to heard from .
--modificateur de proprieter massive du meme type d'object
-- par exemple change les multiplier des lumieres
-- creer par David "Daedalus" Bordeleau
--premier script qui marche (sans jambe)
--========================================================
--creation des omni de test
--for i = 1 to 19 do omnilight()
--for i in $omni* do i.pos = random [-500,-500,-500] [500,500,500]
FN SelectIsLight =
(
select (for o in lights where hasproperty o "multiplier" collect o )
)
utility test "light test"
(
button SelectL "EnWouye Batard!"
group"light Properties"
(
checkbox LghtOnOff "use Light"
colorpicker lghtCLR "light Color" color:[0,0,0]
--checkbox ShadowOnOff "Shadow On/Off"
dropdownlist ShadowType "ShadowType" items:#("Shadow map","raytraced","area Light")
)
Group "multiplicateur"
(
spinner multiplier "multiplier" range:[-100.0,100.0,1.0] type:#float
)
group "NEAR ATTENUATION"
(
Checkbox UseNearAtt "use near Attenuation ??"
Checkbox ShowNearAtt "Show Near Attenuation ??" align:#Left
-- choisit d'utiliser le nearAttenuation
spinner nearAttenStart "Near Att Start" range:[-1000.0,1000.0,1.0] type:#float
spinner nearAttenEnd "Near Att End" range:[-1000.0,1000.0,1.0] type:#float
)
Group "FAR ATTENUATION"
(
Checkbox UseFarAtt "use far Attenuation ??" align:#Left
Checkbox ShowFarAtt "Show far Attenuation ??" align:#Left
-- choisit d'utiliser le FarAttenuation
spinner FarAttenStart "Far Att Start" range:[-1000.0,1000.0,1.0] type:#float
spinner FarAttenEnd "Far Att End" range:[-1000.0,1000.0,1.0] type:#float
)
--=========================================
-- setting des controleur /bouton / etc
--=========================================
on SelectL pressed do SelectIsLight() -- choisit toute les lumiere
on LghtOnOff changed state do $.enabled = state
-- ShadowOnOff chaged state do $. = state
on multiplier changed val do $.multiplier = val -- modifie le multiplpicateur
on shadowtype.selection changed state do
(
if shadowtype.state == 1 then $.shadowgenerator = shadowmap()
if shadowtype.state == 2 then $.shadowgenerator = raytrace_shadow()
if shadowtype.state == 3 then $.shadowgenerator = area_shadow()
)
on lghtCLR changed val do $.color = val
--near attenuation control
on UseNearAtt changed state do $.useNearAtten = state
on ShowNearAtt changed state do $.ShowNearAtten = state
on nearAttenStart changed val do $.nearAttenstart = val
on nearAttenEnd changed val do $.nearAttenEnd = val
--Far attenuation control
on UseFarAtt changed state do $.useFarAtten = state
on ShowFarAtt changed state do $.ShowFarAtten = state
on farAttenstart changed val do $.FarAttenStart = val
on farAttenEnd changed val do $.FarAttenEnd = val
)
i need he;p for this one. im trying to do a tool to change light propertie in a massive ways so they are ALL the same. (not very useful its mainly to learn)
so anyways i'm trying to add a drop downlist for the shadowtype.
it work ie. not error message but the shadow doesnt change. So here the script for those who dare.
BTW its not the main point of the thread but if some of you found better way to build script or optimisation trick, i'll be more than happy to heard from .
--modificateur de proprieter massive du meme type d'object
-- par exemple change les multiplier des lumieres
-- creer par David "Daedalus" Bordeleau
--premier script qui marche (sans jambe)
--========================================================
--creation des omni de test
--for i = 1 to 19 do omnilight()
--for i in $omni* do i.pos = random [-500,-500,-500] [500,500,500]
FN SelectIsLight =
(
select (for o in lights where hasproperty o "multiplier" collect o )
)
utility test "light test"
(
button SelectL "EnWouye Batard!"
group"light Properties"
(
checkbox LghtOnOff "use Light"
colorpicker lghtCLR "light Color" color:[0,0,0]
--checkbox ShadowOnOff "Shadow On/Off"
dropdownlist ShadowType "ShadowType" items:#("Shadow map","raytraced","area Light")
)
Group "multiplicateur"
(
spinner multiplier "multiplier" range:[-100.0,100.0,1.0] type:#float
)
group "NEAR ATTENUATION"
(
Checkbox UseNearAtt "use near Attenuation ??"
Checkbox ShowNearAtt "Show Near Attenuation ??" align:#Left
-- choisit d'utiliser le nearAttenuation
spinner nearAttenStart "Near Att Start" range:[-1000.0,1000.0,1.0] type:#float
spinner nearAttenEnd "Near Att End" range:[-1000.0,1000.0,1.0] type:#float
)
Group "FAR ATTENUATION"
(
Checkbox UseFarAtt "use far Attenuation ??" align:#Left
Checkbox ShowFarAtt "Show far Attenuation ??" align:#Left
-- choisit d'utiliser le FarAttenuation
spinner FarAttenStart "Far Att Start" range:[-1000.0,1000.0,1.0] type:#float
spinner FarAttenEnd "Far Att End" range:[-1000.0,1000.0,1.0] type:#float
)
--=========================================
-- setting des controleur /bouton / etc
--=========================================
on SelectL pressed do SelectIsLight() -- choisit toute les lumiere
on LghtOnOff changed state do $.enabled = state
-- ShadowOnOff chaged state do $. = state
on multiplier changed val do $.multiplier = val -- modifie le multiplpicateur
on shadowtype.selection changed state do
(
if shadowtype.state == 1 then $.shadowgenerator = shadowmap()
if shadowtype.state == 2 then $.shadowgenerator = raytrace_shadow()
if shadowtype.state == 3 then $.shadowgenerator = area_shadow()
)
on lghtCLR changed val do $.color = val
--near attenuation control
on UseNearAtt changed state do $.useNearAtten = state
on ShowNearAtt changed state do $.ShowNearAtten = state
on nearAttenStart changed val do $.nearAttenstart = val
on nearAttenEnd changed val do $.nearAttenEnd = val
--Far attenuation control
on UseFarAtt changed state do $.useFarAtten = state
on ShowFarAtt changed state do $.ShowFarAtten = state
on farAttenstart changed val do $.FarAttenStart = val
on farAttenEnd changed val do $.FarAttenEnd = val
)
