Home Artists Posts Import Register

Content

Some more update news on the Filmmaker side of things!

Animation System

I've been making good progress on the new animation system. The new system allows animating arbitrary properties and is easily extensible (via Lua), which means it can be made to animate pretty much anything:

https://wiki.pragma-engine.com/play_video.php?src=patreon%2F21-09-13%2Fpfm_animated_attributes.mp4&autoplay=1&max_width=1280&height=auto 


It's still somewhat experimental, but it should be usable with PFM v0.4.3.

I've also added support for custom Lua-based actor components for PFM, which effectively allows you to create custom actor types (aside from the standard camera, light, prop, etc. types), with custom animatable properties. More information on that on the wiki.


The new animation system also comes with two new sub-systems:

  • Math expressions and
  • Animation drivers

Both of which act as PFM's version of SFM's Expression Operator system and Blender's driver system.


They're not available for use in the PFM interface yet, but they can be used with Lua already. Here's a short summary of what they entail:

Math expressions

Any property you want to animate can be modified with a math formula. This can be something simple, like "sin(time *pi *2) *value" to animate the light intensity of a light source as a sine wave over time, or something more complex. This is similar to SFM's Expression Operator system, with a few key differences:

  • Support for conditions (if/ternary/etc.)
  • Loops (for/while/etc.)
  • Support for vector and quaternion operations

It's based on the high-performance math expression library "exprtk", which also has a bunch of other features included. You can see a full list with examples on their website: http://www.partow.net/programming/exprtk/ 


Example

Math expressions can't be used in in the PFM interface yet, so for now here's a Lua example:


In essence, instead of having to animate something by hand, you can define a formula to generate the animation instead. This isn't always useful, but it can be a significant time saver in some cases.

The system has one important limitation: Contrary to SFM's expression operators, you cannot create dependencies to external properties. If you want to, for instance, link the fov of a camera to the intensity of a light source, you cannot do so with math expressions, but it is possible with another new system:

Animation drivers

Animation drivers are similar to math expressions, but much more powerful (but also more expensive in terms of performance); if you've used Blender, you may already be familiar with the concept: https://docs.blender.org/manual/en/latest/animation/drivers/introduction.html 

Simply put, an animation driver allows you to animate a property programmatically. Animation drivers in PFM use Lua expressions, which means you have the entire Lua API available, giving you practically limitless options. The primary purpose of an animation driver is to create a dependency between properties. Here are two examples:

Examples

Changing the color of a light source depending on its distance to an actor:


Making an actor always face the camera:


The Lua code may seem a little daunting at first, but once the systems are fully integrated into the PFM interface, they will be much easier to use.


You can find more information on both of these systems on the wiki.


Animation Retarget Export

By request I've added an option to the asset export tool, which allows you to export retargeted models (i.e. export a model with the animations of another model) in the glTF format:


There's not really much more to this one. If you want to use it for something, you can find more information about it on the wiki.


Lua API Documentation

I've already mentioned it previously, but I've been working on a new Lua API documentation, which is now finally public: https://wiki.pragma-engine.com/api/docs 

I've written a program to generate the documentation automatically, which will ensure that it will always be up-to-date from now on. This also includes the ZeroBrane auto-complete script, and the in-engine documentation. I don't have time to write extensive descriptions for all of the >5k functions and hundreds of libraries/classes, but as a substitute every function has a direct link to the location in the GitHub repository in which it is defined:


I've also updated the Lua introduction article with more information on how to get started with scripting for Pragma / PFM / Prelewd.




That's all for now! I will be focusing on Prelewd for a few weeks, so the next update post will be mostly related to Prelewd again.

Comments

No comments found for this post.