Enhanced material animation for PyPRP

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.
User avatar
tachzusamm
Posts: 575
Joined: Thu May 29, 2008 2:03 am
MOULa KI#: 0
Location: Germany

Enhanced material animation for PyPRP

Post by tachzusamm »

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
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.)

prp_Messages_py.zip
(11.71 KiB) Downloaded 593 times


A more complex example: Show Spoiler


~Tach
Tsar Hoikas
Councilor of Technical Direction
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
MOULa KI#: 23335
Location: South Georgia
Contact:

Re: Enhanced material animation for PyPRP

Post by Tsar Hoikas »

It would be better to open a pull request against H-uru/PyPRP.
Image
User avatar
tachzusamm
Posts: 575
Joined: Thu May 29, 2008 2:03 am
MOULa KI#: 0
Location: Germany

Re: Enhanced material animation for PyPRP

Post by tachzusamm »

I tried to accomplish this, following Lyrositors short description here:
viewtopic.php?p=63903#p63903

but I'm stuck where it comes to point 5:
5. Then type "git commit -a" and enter a message when prompted.


The editor "VIM" opens. I can enter a message in the top line, but I don't get how to confirm it. Typing ":quit!" always returns with a message "Aborting commit due to empty commit message.".

What am I doing wrong? What's the "yes take my edits, confirm" command?
Christian Walther
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
MOULa KI#: 0
Location: Switzerland

Re: Enhanced material animation for PyPRP

Post by Christian Walther »

Either:
  • Set your editor to something more human-usable than vim (nano is a simple self-explaining console text editor that comes with the usual unixes, on Mac OS I use edit -w which launches TextWrangler) by setting one of the respective environment variables or configuration settings as specified by git help commit:
    ENVIRONMENT AND CONFIGURATION VARIABLES
    The editor used to edit the commit log message will be chosen from the GIT_EDITOR environment variable, the core.editor configuration variable, the VISUAL environment variable, or the EDITOR environment variable (in that order). See git-var(1) for details.
  • Use git commit -a -m "This is my message" to specify the message on the command line and prevent Git from launching an editor.
  • Learn how to use Vim. I can’t help you with that, as I myself find myself locked in with no way of figuring out how to get out whenever I accidentally use Vi(m) or Emacs. :)
Hope that helps. If you need more detail, just ask. IRC may be quicker than forum.

Edit:
  • Instead of (or in addition to) using Git on the command line, use a GUI like SourceTree.
Tsar Hoikas
Councilor of Technical Direction
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
MOULa KI#: 23335
Location: South Georgia
Contact:

Re: Enhanced material animation for PyPRP

Post by Tsar Hoikas »

:quit! means, "quit, and throw all my changes away." You'll want to use :wq -- "save my changes, then quit." ;)
Image
User avatar
Deledrius
Gehn Shard Admin
Posts: 1377
Joined: Mon Oct 01, 2007 1:21 pm
MOULa KI#: 23298

Re: Enhanced material animation for PyPRP

Post by Deledrius »

Tsar Hoikas wrote::quit! means, "quit, and throw all my changes away." You'll want to use :wq -- "save my changes, then quit." ;)

Obviously! :twisted:

I'm perfectly happy with the discoverability of nano. It may not have the power of vim/emacs, but I'll trade that for the ability to save and quit without needing a manual.
User avatar
tachzusamm
Posts: 575
Joined: Thu May 29, 2008 2:03 am
MOULa KI#: 0
Location: Germany

Re: Enhanced material animation for PyPRP

Post by tachzusamm »

Thank you all, I got it now. I used git commit -a -m "This is my message" finally.

A new pull request is now on GitHUB (or how you would say that).
It includes the 3 updates I already published here spreaded over the forums during the past months, separated by theme.

Deledrius wrote:Obviously! :twisted:

Yeah, obviously :D

It was just the only command I found somewhere documented (Wikipedia). My hope was it would ask "do you want to save before quitting". Wrong guess, lol.
Tsar Hoikas
Councilor of Technical Direction
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
MOULa KI#: 23335
Location: South Georgia
Contact:

Re: Enhanced material animation for PyPRP

Post by Tsar Hoikas »

Excellent! I suppose that I should finish up the performance work I was doing, and we can think about beta'ing a 1.7 release. New features (and all the speed refactoring) warrant a minor version bump in my book.
Image
User avatar
tachzusamm
Posts: 575
Joined: Thu May 29, 2008 2:03 am
MOULa KI#: 0
Location: Germany

Re: Enhanced material animation for PyPRP

Post by tachzusamm »

Tsar Hoikas wrote:I suppose that I should finish up the performance work I was doing, and we can think about beta'ing a 1.7 release.

That would be great!
Bringing a compile-time of about 90-120 s down to something more speedy would be of great help in a continued age development process where you have to do exports about 100 times or more (which I did in the last weeks; Relativity scripting is getting really complex currently) to try this and that and retry again.
Tsar Hoikas
Councilor of Technical Direction
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
MOULa KI#: 23335
Location: South Georgia
Contact:

Re: Enhanced material animation for PyPRP

Post by Tsar Hoikas »

Woah. I don't have a test case that takes that long, unfortunately. My work has mostly focused on optimizing texture processing and compression. It's the slowest part of the plugin but is one of the less frequently used codepaths if you're just tweaking things. I think I had a few last things I wanted to do there, then we can start thinking about ways to improve logic performance. I guess this means I need to reinstall old blender :P
Image
Post Reply

Return to “Plasma Development”