Hi guys!
What’s up?
I have a major problem, depicting camera mapping of animated texture onto particles!
The scene: I have a PFlow setup with a script operator (with which I pick a diffuse map from a plane and map it onto the particles, script is on franticfilms.com) and a Krakatoa options OP with activated vector colors. On the plane I have applied is an animated sequence (.ifl file). Unfortunatelly Krakatoa renders ONLY the frame when the script seems to has been initiated (mostly 1st frame). Is there any possibility of “reactivating” the script to render and map on every frame the next frame of the footage?
Thanks in advance!!!
Greets
Emil
Hi Emil,
Try adding
at time (pCont.getTimeEnd())
(
)
around the code in the Script Operator. This will tell all operations to consider the current evaluation time of the operator when getting data, including the bitmap reading code and the camera TM calculation code.
I have not tested it yet (will do tomorrow when I get to the office), but it should solve the IFL update problem…
In other words, the code would look like
on Proceed pCont do
(
at time (pCont.getTimeEnd())
(
local count = pCont.NumParticles()
local theTM = inverse $Camera01.transform
local theTan = tan ($Camera01.fov/2)
local theBmp = $Plane01.material.diffusemap.bitmap
for i in 1 to count do
(
pCont.particleIndex = i
if pCont.particleAge == 0 do pCont.particleMatrix = pCont.particleTM
local thePos = (pCont.particleMatrix.row4 * theTM)
local theIPos = [1.0 + thePos.x / -thePos.z / theTan , <br>
1.0 + thePos.y / -thePos.z / theTan * 1.3333 , 0] / 2
pCont.particleVector = ((getPixels theBmp [theIPos.x*(theBmp.width-1), <br>
(1.0-theIPos.y) * (theBmp.height-1)] 1)[1] as point3)/255.0
)
theBmp = undefined
)–end at time
)–end on proceed
Thanks for the quick answer, Bobo! I’ll try the script!
Best regards
Emil
P.S.: Hm, the script isn’t quite working. I maybe should mention, that the Position Object OP is for a skinned character with “Subframe sampling” and “Animated Shape” turned on.
Besides, I encounter another problem: Since I have also a Find Target OP in my Flow, I try to export the whole particle animation. Unfortunatelly, the PRTs do not match the particle reslut itself
Thanks
Emil
ok, I am still fighting with mapping animated textures in Karkatoa Particles. Bobo, it seems the script fragment I had to add, doesn’t quite work… Heeelp
Greets
Emil
Just a note for anyone following this thread that the solution to the problem was to get the file name of the bitmap texture, open the bitmap as a MAXScript value, set the .frame property to the current time (+/- Offset if desired) and read the pixels from there.
We will update the online tutorial with the correct animation code soon.
Regards,
Borislav “Bobo” Petrov
Technical Director VFX
Frantic Films Winnipeg