Render all presets from fqs script

  • 3 Replies
  • 63 Views

0 Members and 1 Guest are viewing this topic.

Offline 3DickUlus

  • *
  • 3e
  • *****
  • Posts: 1140
    • Digilantism
« on: June 09, 2019, 05:50:03 AM »
So ya got this frag with a lot of presets and you want thumbs (or full sized images) of all of them, this script does that.

The first few lines are adjustable vars, width,height,multiplier,subframes and subFolder.

If you want 3840x2160 image rendered with 384x216 tiles @ 256 subframes...

Code: [Select]
// set image frame spec
var width=384;
var height=216;
var multiplier=10; // 10=10x10=100 tiles = 3840x2160
var subframes=256;

subFolder can be "" this will place thumbs in the current folder, make a thumbs folder where Fragmentarium exe lives or set...
Code: [Select]
var subFolder = "thumbs/";
Run Fragmentarium from cmdline before loading this script to see stats output.
Code: [Select]
// Fragmentarium qscript
// 3Dickulus 08/06/19

// set image frame spec
var width=360;
var height=360;
var multiplier=2; // 10=10x10=100 tiles
var subframes=256;

// set subfolder must end with "/"
var subFolder = "thumbs/";

// frame specs
function setFrameSpec(w,h,m,s) {

  // set the tile buffer size
  app.setTileWidth(w);
  app.setTileHeight(h);

  // set tile multiplier
  app.setTileMax(m);

  // how many frames to accumulate
  app.setSubFrames(s);

}

// starting point
function init(){

  // false = save images
  // true = open a preview window for EACH image (be careful)
  app.setPreview(false);

  // false = no control from frag
  // true = control from frag
  app.setAnimation(false);

  // begin
  app.setFrame(0);
  app.setStartFrame(0);
  app.setEndFrame(0);

  // size of tiled/frame to render
  setFrameSpec(width,height,multiplier,subframes);

  print("");
  print("Fragmentarium " + app.getVersion() + " script engine.");
  print("");
  // header
  print("W\tH\tN\tSubframe\tTile\t\tImage\t\tFilename");

}

function renderPreset(value) {

  // we need to adjust the filename for each preset
  app.setOutputBaseFileName(subFolder+value+".png");

  // if the user wants to stop rendering break before next image
  if(app.scriptRunning()) {

    app.applyPresetByName(value)

    // render an image
    app.tileBasedRender();
    // output stats
    print( (width)+"\t"+(height)+"\t"+(multiplier)+"\t"+((app.getTileAVG()/1000)/subframes).toFixed(9)+"\t"+(app.getTileAVG()/1000).toFixed(9)+"\t"+(app.getRenderAVG()/1000).toFixed(9) +"\t" + subFolder + value );
  }

}

// call our startup function
init();

// false = presets
// true = keyframes
var names = app.getPresetNames(false);

// make list of preset names
var list = names.split(" ");

list.forEach(renderPreset);

print("Done!" );
print("" );


Example output...
Code: [Select]
Fragmentarium 2.5.0.190419 script engine.

W       H       N       Subframe        Tile            Image           Filename
360     360     2       0.242171875     61.996000000    247.987000000   thumbs/AngelOfKos
360     360     2       0.029792969     7.627000000     30.508000000    thumbs/Burt1
360     360     2       0.053449219     13.683000000    54.736000000    thumbs/Burt2
360     360     2       0.053042969     13.579000000    54.316000000    thumbs/Burt3
360     360     2       0.087144531     22.309000000    89.239000000    thumbs/Burt4
360     360     2       0.121671875     31.148000000    124.595000000   thumbs/Burt5
360     360     2       0.074375000     19.040000000    76.162000000    thumbs/Burt6
360     360     2       0.196933594     50.415000000    201.660000000   thumbs/Burt7
360     360     2       0.184609375     47.260000000    189.042000000   thumbs/Burt8
360     360     2       0.126109375     32.284000000    129.138000000   thumbs/Burt9
360     360     2       0.226449219     57.971000000    231.885000000   thumbs/CopperSmith
360     360     2       0.291031250     74.504000000    298.016000000   thumbs/DarkRoyal
360     360     2       0.016156250     4.136000000     16.547000000    thumbs/Default
360     360     2       0.385605469     98.715000000    394.860000000   thumbs/Fox
360     360     2       0.208601563     53.402000000    213.609000000   thumbs/Mosquito
360     360     2       0.179062500     45.840000000    183.361000000   thumbs/MystMaj
360     360     2       0.244492188     62.590000000    250.363000000   thumbs/PulpFraction
Done!
« Last Edit: June 12, 2019, 05:30:35 PM by 3DickUlus »
Resistance is fertile... you will be illuminated!

https://en.wikibooks.org/wiki/Fractals/fragmentarium

Offline Sabine62

  • *
  • Moderator
  • ******
  • Posts: 619
  • It's just a jump to the left...
    • sabine62.deviantart.com
« Reply #1 on: June 11, 2019, 10:29:16 PM »
Brilliant, thanks a lot for posting this here, Dick! :thumbs:
To thine own self be true

Offline 3DickUlus

  • *
  • 3e
  • *****
  • Posts: 1140
    • Digilantism
« Reply #2 on: June 14, 2019, 10:41:48 PM »
...found a bug  :embarrass: the script debugger engages twice ( on linux will open second window after closing the first instance ) fix is in next patch update, it doesn't affect functionality just annoying.

Offline Sabine62

  • *
  • Moderator
  • ******
  • Posts: 619
  • It's just a jump to the left...
    • sabine62.deviantart.com
« Reply #3 on: June 15, 2019, 09:32:33 AM »
 ;D
Still haven't found time to test...  ::)


xx
TetraCubeOct Koch Frag w/presets

Started by M Benesi on Fragmentarium

2 Replies
277 Views
Last post December 26, 2017, 01:44:07 AM
by M Benesi
xx
Synthclipse presets import functional on 2.2.3 ?

Started by Michael_Z_Freeman on Synthclipse

2 Replies
68 Views
Last post March 15, 2019, 11:28:12 AM
by Michael_Z_Freeman
xx
programmatically get list of available presets from scripting interface?

Started by claude on Fragmentarium

1 Replies
81 Views
Last post January 02, 2019, 12:39:46 AM
by 3DickUlus
xx
slider range clamps values from presets

Started by claude on Fragmentarium

8 Replies
210 Views
Last post February 11, 2019, 02:27:20 PM
by CJR
xx
Script for stacking jittered images

Started by gerrit on Kalles Fraktaler

4 Replies
220 Views
Last post March 07, 2018, 07:41:35 PM
by gerrit