Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: Does ASL have commands to automate UI / menu actions, etc?  (Read 14326 times)

chuft-captain

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Does ASL have commands to automate UI / menu actions, etc?
« on: April 23, 2017, 01:29:35 am »

I'm doing some rendering tasks at the moment which require the exact viewpoint to be replicated for every single render. The rendering tasks are very tedious and repetitive, so I was hoping to write a script to automate this. Is this possible in ASL?
I haven't really done a lot of scripting in Anim8tor, but a quick look suggests that ASL is perhaps aimed at modelling and animation tasks, but I'm not sure if it's capable of scripting user actions, etc.

For example, after setting up a Custom Viewpoint, the script might need to do some or all of the following:
(pseudo code)
Initialize/specify Renderer
Perform AA Setup (set SPP, Sampling Method)
foreach <object> in <list of objects>
{
   foreach <material> in <list of materials>
   {
      -- apply material to object
      -- Render -> Render Image
         Select Antialiased
         Select Image + Alpha Channel)
      -- Save the rendered scene as a PNG to a specified Output Folder with a unique filename genarated using some convention such as:
      <obj-id><material-id>-<obj-id><material-id>-<obj-id><material-id>-<obj-id><material-id>.png
      -- Close render window
   }
}
The end result would be a folder containing a rendered PNG with alpha channel for each combination of object / material.
      eg. a couple of example filenames using this convention might be:
         01black-02white-03-green-04-blue.png
         01white-02white-03-stone-04-tartan.png

Can these sort of tasks be automated in ASL?

Cheers
CC
Logged

chuft-captain

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Does ASL have commands to automate UI / menu actions, etc?
« Reply #1 on: April 23, 2017, 03:43:48 am »

So,

In my initial investigations, I've found a few example scirpts here: http://anim8or.com/scripts/index.html
However neither of the scripts which involve rendering actually succeeds in producing any output (to the screen or anywhere else), (eg. for_3.a8s, and sphere.txt ... and the first one actually causes Anim8tor to hang/crash.

Note that I'm using the latest build 1269, so maybe there's a backwards compatibility issue with these presumedly quite old scripts.  I'll test these out with an older stable build like 0.98 and see if they work there.

Any thoughts from any scripting experts?

CC
« Last Edit: April 23, 2017, 03:48:29 am by chuft-captain »
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2126
    • View Profile
Re: Does ASL have commands to automate UI / menu actions, etc?
« Reply #2 on: April 23, 2017, 04:44:25 pm »

The ASL Render() call is basically broken. It doesn't work with the "MultiThreaded" option set in the Render menu. This option spawns a separate thread to do the rendering and uses the main thread for the user to interact with Anim8or. So if you uncheck this option it will render an image, for what that's worth.

But the real issues is that you can't do anything useful with the render since you can't save it, etc.
Logged

chuft-captain

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Re: Does ASL have commands to automate UI / menu actions, etc?
« Reply #3 on: April 24, 2017, 09:23:17 pm »

Ok,
Thanks for letting me know.
At least you've saved me from wasting any time attempting it, so thanks for that.
The scripts, and parts of scripts that DO work from those examples demonstrate how powerful a toll scripting can be, so it's a shame that it's broken as this could literally have saved days and weeks of tedious repetitive work. Oh well .. :(
FYI, those scripts also crashed 0.98 (or was it 0.95 -- I tested against one of those) so I guess it's been broken for a loooong time!
 
After using this DEV build for a week or so now, I have some observations about how some of the new(ish) functionality, such as Folders, User Views, etc. could be improved or streamlined. Mostly just trivial changes and tweaks probably, but could have a major impact on workfllows and ease of use.
Once I collect my thoughts about this, if you're interested in the feedback, I'd be glad to post my suggestions in another thread at some point, or send you a PM.

Cheers
CC
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2126
    • View Profile
Re: Does ASL have commands to automate UI / menu actions, etc?
« Reply #4 on: April 24, 2017, 11:51:19 pm »

Sure, I'm always interested in feedback. You can either post it here or send it to support@anim8or.com

As for the ASL scripting language, I plan to do a lot more with it this summer, after the v1.0 release is out. So stay tuned...
Logged