[Closed] why mentalray not work?
hey guys!
here is a script from bobo which makes lights moving with particles
I copy form here:
http://forums.cgsociety.org/showthread.php?f=98&t=743492&highlight=light+particle
on ChannelsUsed pCont do
(
pCont.useSpeed = true
pCont.usePosition = true
)
on Init pCont do
(
global theBounceLights = $BounceLight_* as array
if theBounceLights.count == 0 do
theBounceLights = for i = 1 to 8 collect
(omnilight attenDecay:2 name:(uniquename "BounceLight_"))
for o in theBounceLights do o.pos = [0,0,-100000]
)
on Proceed pCont do
(
theStep = ((pCont.getParticleSystem()).getIntegrationStep()) .frame
count = pCont.NumParticles()
minCount = amin #(count,theBounceLights.count)
for i in 1 to minCount do
(
pCont.particleIndex = i
theBounceLights[i].pos = pCont.particlePosition + pCont.particleSpeed*TicksPerFrame*theStep
)
)
the problem is when move timeslider to have a preview ,it performs correct and lights move with particles,but when use mentalray to render the whole animation —-lights can’t move with particles!
but use vray and scanline will perform right,did i something wrong or it’s a mentalray bug?
thanks for any help!
ps: I use max2010
sorry!i try times ,the scanline and vary renderer not perform absolutely right.
i not sure ,but feel particleflow can’t move light like move mesh!
Did you take a look into the Attach Light example in the sample scenes?
Because it`s working just fine with mental ray and scanline.
Well,at least here at version 2014.
on ChannelsUsed pCont do
(
pCont.usePosition = true
pcont.usetime = true
)
on Init pCont do
(
Global myLights = $omni* as array
myLights.position = [999999,99999,99999]
)
on Proceed pCont do
(
count = pCont.NumParticles()
for i = 1 to 100 do
(
pCont.particleIndex = i
myLights[i].position = pcont.particlePosition
)
)
on Release pCont do
(
)
THANKS MGernot!
maybe this bug is fixed in 2014,and I found this http://forums.cgsociety.org/showthread.php?t=429702 just now.
Are you sure you render pf animation without play timeslider before,I mean sometimes I play timeslider first and then render it, maybe will get correct result,
Oh! God save me from confusing tornado.
THANKS again!
Ok, im sorry but it doesn
t work in 2014/MentalRay either. I thought it did, but i were wrong.
You need Bobo`s trick to make it work, set a keyframe for all the lights at the first and the last frame. Then it updates correctly.
Log this as bug/limitation that needs to be fixed.
ha_ha!I tried it in my max2010 32bit,it works! thanks MGernot,it seems I can use max2010 for a while!
I use a point_help instead of box!