ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
So I have a file containing a list of frames to animate a texture and reading that file is no problem, buthow to add that animation frames to a textureß
My fault, have not really good specified what I want. I have an array of frames:
frames=#()
and every element of that array look like this:
frame=#(time, uOffset, vOffset, wRotation)
Now I want to add all the frames from that array to the map. That stuff about animate on I know and I need a for loop to go through the array and to do something like:
at time frames[i][1]...
but thats all I know.
Don´t really know any other maps than bitamaps, so for me it´s more or les the same. So thanks, it looks like exactly what I need. However have some questions:
1. Would it worck with a custom bitmap? I mean own plugin having bitmap as superklass.
2. Is the way to write the frames later back to the array also as simple?
1. It depends. But it will work for any map that has Coords property that is StandardUVGen class.
2. Example below assumes that all of the properties has equal keys count and are animated at same time.
animate on (
at time 66 (
bmap.coords.U_offset = 0.66
bmap.coords.V_offset = 0.33
bmap.coords.W_Angle = 42
))
keysCount = bmap.coords.U_offset.keys.count
writeFrames = for i=1 to keysCount collect (
#( bmap.coords.U_offset.keys[i].time,
bmap.coords.U_offset.keys[i].value,
bmap.coords.V_offset.keys[i].value,
bmap.coords.W_Angle.keys[i].value
))
Thanks again. At least for the stuff imported with your previous script properties should always have equal keys count, or am I wrong? Is there really cases, when properties don´t have equal keys count?
Yes, in your case all the properties will have equal keys count. But in general there could be any arbitrary or zero keys for for the property you may wish to export.
Comments
.
.
With animate on
You can use
with animate on
(
at time frame expression
)
for eg:
meditmaterials[1]=noise()
with animate on
(
at time 1 meditmaterials[1].phase=0
at time 100 meditmaterials[1].phase=50
)
Hope that helps
My fault, have not really
My fault, have not really good specified what I want. I have an array of frames:
frames=#()
and every element of that array look like this:
frame=#(time, uOffset, vOffset, wRotation)
Now I want to add all the frames from that array to the map. That stuff about animate on I know and I need a for loop to go through the array and to do something like:
at time frames[i][1]...
but thats all I know.
.
here's the bitmaptexture example since you didn't specify what type of map you try to animate
Don´t really know any other
Don´t really know any other maps than bitamaps, so for me it´s more or les the same. So thanks, it looks like exactly what I need. However have some questions:
1. Would it worck with a custom bitmap? I mean own plugin having bitmap as superklass.
2. Is the way to write the frames later back to the array also as simple?
.
1. It depends. But it will work for any map that has Coords property that is StandardUVGen class.
2. Example below assumes that all of the properties has equal keys count and are animated at same time.
Thanks again. At least for
Thanks again. At least for the stuff imported with your previous script properties should always have equal keys count, or am I wrong? Is there really cases, when properties don´t have equal keys count?
.
Yes, in your case all the properties will have equal keys count. But in general there could be any arbitrary or zero keys for for the property you may wish to export.
What you mean with zero keys?
What you mean with zero keys? Values of 0 or just undefined?