Welcome, Guest. Please Login or Register
Home Help Search Login Register
Page Index Toggle Pages: 1
Send Topic Print
Max script ..first basic test (Read 1985 times)
Dschaga
Ex Member


Max script ..first basic test
10/16/03 at 12:50:16
 
[quote]
(
--
-- öffnet filedialog um sdr file in variable sdrfile einzulesen
--

SDRfile = getOpenFileName types:"Data(*.sdr)|*.sdr|"




--
-- max liest ganz bestimmte variablen aus... von einem ini file..
-- getinisetting von file "sdrfile" aus der kategorie "background" variable "BGfile"
--

BGfile = GetINISetting SDRfile "Background" "BGfile"
BGmap = GetINISetting SDRfile "Background" "BGmap"
BGu = GetINISetting SDRfile "Background" "BGu"
BGv = GetINISetting SDRfile "Background" "BGv"

Enviromentfile = GetINISetting SDRfile "Enviroment" "Enviromentfile"
Emap = GetINISetting SDRfile "Enviroment" "Emap"
Eu = GetINISetting SDRfile "Enviroment" "Eu"
Ev = GetINISetting SDRfile "Enviroment" "Ev"
Emulti = GetINISetting SDRfile "Enviroment" "Emulti"


SUNpos = GetINISetting SDRfile "Sun" "SUNpos"
SUNmulti = GetINISetting SDRfile "Sun" "SUNmulti"
SUNcolor = GetINISetting SDRfile "Sun" "SUNcolor"


--
-- filterstring schreibt werte ,getrennt durch "," in ein array
--

pp = filterstring SUNpos ","
cc = filterstring SUNcolor " "


-- jetzt wird ein licht erstellt  .."\" ist einfach ein zeilenumbruch

TargetDirectionallight rgb:(color (cc[1] as float) (cc[2] as float) (cc[3] as float)) shadowColor:(color 0 0 0) \
multiplier:(SUNmulti as float) contrast:0 softenDiffuseEdge:0 nearAttenStart:0 nearAttenEnd:40 \
farAttenStart:80 farAttenEnd:200 decayRadius:40 atmosOpacity:100 atmosColorAmt:100 \
shadowMultiplier:1 hotSpot:43 falloff:45 aspect:1 pos:[(pp[1] as float),(pp[2] as float),(pp[3] as float)]\
target:(Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]))



--
-- BACKGROUND image
-- a ist ein objectholder für das enviroment map,
-- dieses object hat zusätzliche variablen die ich über a.variable anspreche
--

a = environmentMap = Bitmaptexture filename:(BGfile )
a.coordinates.mappingtype = 1
-- 0 - Spherical; 1 - Cylindrical; 2 - Shrink-Wrap; 3 - Screen
a.coordinates.mapping = BGmap as integer


-- uv mapping schreiben
a.coordinates.U_Offset = BGu as float
a.coordinates.V_Offset = BGv as float



-- Enviroment wie oben

renderers.current.environment_gi_on = on
renderers.current.environment_gi_map_on = on
b = renderers.current.environment_gi_map = VRayHDRI()

b.HDRIMapName = (Enviromentfile )
b.maptype = 2
b.horizontalRotation = (Eu as float) + (90 as float)
b.verticalRotation = (Ev as float)
)
[/quote]


this is a basic script..without errorhandlers.
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print