It always bugged me that it's not possible to fully control material layer animation, so I added some parameters that were not fully implemented yet.
We were already able to use these commands:
- Show Spoiler
- continue
- stop
- setlooping
- unsetlooping
- setbackwards
- setforewards
- togglestate
- addcallbacks
- removecallbacks
- gotobegin
- gotoend
- gotoloopbegin
- gotoloopend
- incrementforward
- incrementbackward
- runforward
- runbackward
- fastforward
These were possible because there's no parameter passed, they just "execute".
This did not give much control over the animation though, because we can basically only start or stop an animation.
But the following commands need parameters, which was not implemented; instead, mostly a value of just 0 was internally assigned, which totally broke the animation in some cases:
- setspeed
- setbegin
- setend
- setloopbegin
- setloopend
- gototime
- playtotime
Now it's possible to use these commands as well.
Here's an AlcScript example of the syntax; we set double speed of the material animation in this example:
- Code: Select all
logic:
actions:
- type: responder
tag: MatForward # Responder Name or Tag
responder:
states:
- cmds:
- type: animcmdmsg
params:
receivers:
- 0043:MaterialName-TextureName
cmds:
- setforewards
- setspeed # SetSpeed Command
- continue
speed: 2.0 # SetSpeed Value
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detecttrigger
This way, you can play material animations at different speeds from now on, or define different speeds for for(e)wards and backwards animations.
Or you can hold different sections of the animation in the IPO curve, and play only part of it when needed, by using
setbegin or
setend for example.
Below you'll find a replacement file to be put in your PyPRP directory which does the job.
It's compatible to the current version 1.61 and it does not break your age.Here's the list of value names (like "speed: 2.0" in the above example) belonging to the new commands:
speed
time
begin
end
loopbegin
loopend
speedchangerate
(The commands gotopercent and playtopercentage are still unuseable; I haven't found out where to put belonging values in the PRP.)- A more complex example: Show Spoiler
- Code: Select all
IPO-curve setup: One animation segment goes from 0.0 to 3.0 seconds (0 to 120 frames), a second segment goes from 4.0 to 8.0
ObjectWithMatAnim:
visual:
matanims:
- mat: MaterialName # (name of material)
flags:
- stopped
logic:
actions:
- type: responder
tag: MatForward # Responder Name
responder:
states:
- cmds:
- type: animcmdmsg
params:
receivers:
- 0043:MaterialName-TextureName
cmds:
- setforewards
- setspeed # SetSpeed Command
- setbegin
- setend
- gotobegin
- continue
speed: 2.0 # Double Speed if forward
begin: 0.0 # Play from beginning
end: 3.0 # to the end of segment #1
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detecttrigger
- type: responder
tag: MatReverse # Responder Name
responder:
states:
- cmds:
- type: animcmdmsg
params:
receivers:
- 0043:MaterialName-TextureName
cmds:
- setbackwards
- setspeed
- setbegin
- setend
- gotoend
- continue
speed: 1.0 # Normal Speed if reverse
begin: 0.0 # Play full segment #1
end: 3.0
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detecttrigger
- type: responder
tag: MatForwardSegment # Responder Name
responder:
states:
- cmds:
- type: animcmdmsg
params:
receivers:
- 0043:MaterialName-TextureName
cmds:
- setforewards
- setspeed # SetSpeed Command
- setbegin
- setend
- gotobegin
- continue
speed: 3.0 # Triple Speed
begin: 4.0 # Play another part (segment #2)
end: 8.0 # .. of the mat.anim
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detecttrigger
# The example code is untested, I wrote it down from memory and I assume it should work this way. But do your own experiments if needed.
~Tach