cbass
03-27-2008, 06:40 AM
Hi Everyone,
I’m trying to figure out how to assign a material color to scripted objects. I got it to work in the following…
----------------------------------------------------------
for i=1 to 10 do
(
b = box()
move b [0,i*40,0]
c=standardMaterial()
c.Diffuse=color 250 (i*10) 75
b.Material=c
)
----------------------------------------------------------
However the following does not work…
----------------------------------------------------------
a = 1.0
b = 1.9
c = 1.0
d = 1.0
x = 0.1
y = 0.1
z = 0.1
for i = 1 to 220 do
(
xnew = sin(y*b)+c*sin(x*b)
ynew = sin(x*a)+d*sin(y*a)
znew = cos(x*c)+d*sin(y*c)
x = xnew*55
y = ynew*55
z = znew*55
s= Box length:(random 10 50) width:(random 10 50) height:(random 10 50)
s.lengthsegs = 5
s.widthsegs = 5
s.heightsegs = 5
addModifier s (turbosmooth iterations: 2)
move s [x,y,z]
c=standardMaterial()
c.Diffuse=color 250 (i*10) 75
s.Material=c
)
----------------------------------------------------------
I keep getting the error
-- Error occurred in i loop
-- No ""*"" function for Standardmaterial:Standard
and I'm not sure why. If I remove the last three lines, it works fine (although obviously I don't get the color I'm looking for). Why would adding the material information cause an error in the loop? I’m sure it’s a simple explanation. Its just beyond me right now.
Any suggestions?
TIA,
Carlo
I’m trying to figure out how to assign a material color to scripted objects. I got it to work in the following…
----------------------------------------------------------
for i=1 to 10 do
(
b = box()
move b [0,i*40,0]
c=standardMaterial()
c.Diffuse=color 250 (i*10) 75
b.Material=c
)
----------------------------------------------------------
However the following does not work…
----------------------------------------------------------
a = 1.0
b = 1.9
c = 1.0
d = 1.0
x = 0.1
y = 0.1
z = 0.1
for i = 1 to 220 do
(
xnew = sin(y*b)+c*sin(x*b)
ynew = sin(x*a)+d*sin(y*a)
znew = cos(x*c)+d*sin(y*c)
x = xnew*55
y = ynew*55
z = znew*55
s= Box length:(random 10 50) width:(random 10 50) height:(random 10 50)
s.lengthsegs = 5
s.widthsegs = 5
s.heightsegs = 5
addModifier s (turbosmooth iterations: 2)
move s [x,y,z]
c=standardMaterial()
c.Diffuse=color 250 (i*10) 75
s.Material=c
)
----------------------------------------------------------
I keep getting the error
-- Error occurred in i loop
-- No ""*"" function for Standardmaterial:Standard
and I'm not sure why. If I remove the last three lines, it works fine (although obviously I don't get the color I'm looking for). Why would adding the material information cause an error in the loop? I’m sure it’s a simple explanation. Its just beyond me right now.
Any suggestions?
TIA,
Carlo
