Notifications
Clear all
[Closed] control the opacity of many splines
Jul 28, 2014 11:34 am
I have line object which contains a few hundred splines and I want to make each of this splines visible at a different time. How can i do that using maxscript?
The only way i know is to apply a checker map in the opacity slot, adding an unwrap_uvw and animate the vertexpositions in the unwrap_editor. It looks like this:
“sp” is the line object and “alines” is used to get the time when a spline should bekome visible
uvw = unwrap_uvw()
addmodifier sp uvw
select sp
vcount = getnumverts sp
vps = vcount/alines.count
animate on
(
for r=1 to vcount do
(
sn = (r-1)/vps+1
vvist = (alines[sn][1].keys[2].time as string) as integer
uvw.setvertexposition (vvist-1) r [0.1,0.9,0.5]
uvw.setvertexposition vvist r [0.9,0.9,0.5]
)
)
mat = standard()
mat.opacitymap = checker()
sp.material = mat
The problem is, for a few hundred or a few thousand splines this is really slow.
Is there a more efficient way?