Notifications
Clear all

[Closed] material editor slots -urgent

Guys,

I want to access more than 24 slots using scripting. i have a material library , instead of loading them in the first 24 slots, i want to load them in the next 24 slots? is there any way we can achieve it using script?

Thanks

rajv

2 Replies

if any question , contect me . msn : ehblan@hotmail.com ,always online , but in china time .
teach me oral english for the payment , if u like .

use this script to create 88 box for test :

 for i=1 to 88 do 
(
seed i 
local bbox = box pos:[i*5,0,0]
bbox.material = \
standard diffuse:(random red blue)
) 

below is the script for turn over page to page , after the last page . will be the first one .

 -------------------------------------------
--note: if u add materials to scene .press "collectMats"
--	 to refresh the array . 
-------------------------------------------
-- hblan , shanghai ,china . 
-- msn : ehblan@hotmail.com 
-------------------------------------------
rollout MatRoll "Mat Roll"
(
local theMatArray = #()
local theLoop = 1
----------------------------------
fn caculatePages theInput = 
(
local CC = (theInput as float) / 24 -- integer . 
local theCN = if (cc-(cc as integer)) == 0.0 \
then (cc as integer) 
else ((cc as integer)+1)
return theCN 
)
-----------------------------------
button collectMats "CollectMats" width:120
button turnOver "turn Pages" width:120
------------------------------------
on CollectMats pressed do 
(
local thePageC =caculatePages (scenematerials.count)
theMatArray = #() 
if thePageC != 0 do 
(
for i=1 to thePageC do 
(
theMatArray[i] = for j=(i-1)*24+1 to i*24 collect sceneMaterials[j] 
 
) -- end for.
)-- end if .
) -- end on button pressed . 
-------------------------------------
on turnOver pressed do 
(
local theC = theMatArray.count
if theLoop > theC do theLoop =1 
if theC != 0 do 
(
for i=1 to 24 do -- 1 to 24 .theMatArray[theLoop].count
(
-- some of the items in the last array item will be undefined . 
-- cause the count of all material cant be 24x all the time . 
try( meditMaterials[i] = theMatArray[theLoop][i] )catch() 
) -- end for. 
theLoop += 1 
) -- end if.
) -- end on button pressed. 
-------------------------------------
) createdialog MatRoll 

thanks for the reply…just a few queries?

the script collects the scene materials but it doesnt load the next page?

my question is if i get the extra 24 slots, i want to load my saved library…in to that slots?

any suggestions?

Rajv