YOUR ACCOUNT

Login or Register to post new topics or replies
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
We're uploading unfinished Help articles on scripting to the Filter Forge wiki. The articles are incomplete, some text, examples and pictures may be outdated -- but anyway, it's something to start with. We'll update the articles when the new content is written (and when we have time to do that.)

Here's the list of articles that are currently uploaded:
- Getting Started with Scripting
- Referencing Inputs from Scripts
- Sample-Based Architecture
  Details E-Mail
Kraellin
Kraellin

Posts: 12749
Filters: 99
Quote
Create a Map Script component (located in the Scripting category on the Component Bar).


ok, what if we have no scripting category on the component bar? "Help Components" doesnt show any such thing either. is this something upcoming or am i missing something here? and yes, this version 2, latest update.

edit: and in looking further, what happened to the options? i no longer have an "Options" in the menu system.

edit: never mind, found the options. lol. dont get old smile;) but i still cant find anything about scripting within the editor.

edit yet again: ok, seems i dont have the latest version. lol. stage 4 is out today. ok, forget i posted anything here smile:) smile:D
If wishes were horses... there'd be a whole lot of horse crap to clean up!

Craig
  Details E-Mail
Mike Blackney

Posts: 375
Filters: 57
Forget? Impossible!! smile:D


One thing that took me a while to realise is that the x and y values are still floats when you're sampling in script. I thought they would be pixels (for some reason) then checked the wiki and suddenly it made sense that x+1 was returning the same thing.

Is there any method I can call to get the input image dimensions in script? Are there methods like this exposed, or are there plans to? Sorry if asking questions like this are doubling up on wiki work.
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Quote
Mike Blackney wrote:
I thought they would be pixels (for some reason)


Thank you for reminding me to upload the article on "Filter Forge's Sample-Based Architecture" smile:)

Quote
Mike Blackney wrote:
Sorry if asking questions like this are doubling up on wiki work.


Don't worry. The help file is the #1 priority right now, and within the help file scripting is the most important chunk of work -- though I can't promise that we'll update the Wiki versions often, we're not using them for internal editing.
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Quote
Mike Blackney wrote:
Is there any method I can call to get the input image dimensions in script?


Yes. They are not documented yet, but here's the list of FF variables available in Lua scripts:

SIZE - value of the Size slider, available only to scripts that "make use of the global Size setting".

VARIATION - value of the Variation slider, available only to scripts that "make use of the global Variation setting".

OUTPUT_WIDTH, OUTPUT_HEIGHT - image width and height, pixels

SEAMLESS_REGION_WIDTH, SEAMLESS_REGION_HEIGHT - seamless region width and height, available only when the global Seamless Tiling checkbox is turned on.

SEAMLESS - state of the global Seamless Tiling checkbox, true of false.

Debugging tip: you can use the Color Inspector to display the value of a variable. Just return it in one of the RGB channels -- remember, FF is fully HDR smile:)
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
I've updated the original post with a link to a new article on sample-based architecture.
  Details E-Mail
Mike Blackney

Posts: 375
Filters: 57
Thanks Vlad, that's brilliant! smile:D
  Details E-Mail
BenBeckwith
Posts: 136
Filters: 8
Something that might help aspiring scripters (such as me) is if you provided images of how you would create the example scripts out of existing components (if possible). For example, the radial gradient script could be accompanied with the attached image. I understood the explanation, but it took me a few read throughs to match it all up and understand it. Then I confirmed it by rebuilding it with nodes. smile:)

  Details E-Mail
BenBeckwith
Posts: 136
Filters: 8
Sorry, I totally forgot something. For added clarity...

  Details E-Mail
Totte
Übernerd

Posts: 1460
Filters: 107
Brilliant Ben!
- I never expected the Spanish inquisition
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Are the wiki articles on Scripting obsolete? I'm asking because it appears that the finished versions of those articles can be found in the Help section of the website, nicely formatted and all shiny. smile;)

If they are indeed obsolete, shouldn't we replace the wiki articles with links to the Help section? That might make things less confusing as to where to look for the 'definitive' scripting help.
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
David Roberson
Artist
Posts: 404
Filters: 36
Though it's more than a decade later, I srt of had the same question:
Quote
Crapadilla wrote:
Are the wiki articles on Scripting obsolete?

I've been doing a lot of scripting as I strive to teach myself how to make better scripts. I've finally hit the point where I need more debugging info than the console errors. So, I started looking for the Filter Forge x64.log (for v.9) and found my way to a few forum posts and the wiki, but the instructions to look in "%APPDATA%\Local\Temp\..." didn't turn up the log. I had a fiter editor session going, so I expected it to be there.

Assuming the leads I followed are just out of date, I'm wondering where I should look for the log. I'd appreciate the help!
  Details E-Mail
GMM
Moderator
Filter Forge, Inc
Posts: 3491
Quote
David Roberson wrote:
but the instructions to look in "%APPDATA%\Local\Temp\..." didn't turn up the log.


The wiki is correct: if you have a 'print' function in your script, it will log the output to c:\Users\your_username\AppData\Local\Temp\Filter Forge x64.log
  Details E-Mail
David Roberson
Artist
Posts: 404
Filters: 36
Great! So... What is the location of "Filter Forge x64.log" for Filter Forge 9 on Windows 10?

I've done a bit of poking around trying to track down the location of the "Filter Forge x64.log" for Filter Forge 9 on Windows 10. I've checked in:

C:\Users\<username>\AppData\Local\Temp\Filter Forge 9\ and C:\Users\<username>\AppData\Roaming\Filter Forge 9\

Since I'm asking, I obviously didn't find it at either of those places. Weird. The Temp location was mentioned in a post about using the log file, and I remember something about the log file only existing while Filter Forge is running (and the Filter Editor is open). After a bit more searching, I followed someone's advice to look for (or create) a Logs folder in the Roaming location, and restarted Filter Forge. Then, in the Filter Editor, I loaded a filter with a Map Script with known errors and selected it. I confirmed that errors were written to the console and then checked the Logs folder I created; it did not turn up in it or the respective Filter Forge 9 folders I could find.

I also looked for settings in Filter Forge Options > Logging to make sure I didn't need to enable log files to ensure one is created when Map Scripts are running. Logging does not show up in the Options, and it wasn't included in any of the available tabs, like Scripting. Also, only the internal Message Log is mentioned in the Filter Forge Help tool. If it isn't the case that the log file is only created when an error occurs while running a Map Script, it seemed the only option remaining was to contact Filter Forge Support to see if they can provide any additional information on how to enable the creation of log files.

If the log file has been eliminated, that really makes debugging script difficult. One line error messages in the Message Log of the Filter Editor isn't enough to debug whole arrays with indexing problems. Please tell me I've just been looking in the wrong places!

Hope you can give me good news,

David Roberson
  Details E-Mail
GMM
Moderator
Filter Forge, Inc
Posts: 3491
Quote
David Roberson wrote:
So... What is the location of "Filter Forge x64.log" for Filter Forge 9 on Windows 10?


The log file is still at c:\Users\your_username\AppData\Local\Temp\Filter Forge x64.log

Quote
David Roberson wrote:
I've checked in:

C:\Users\<username>\AppData\Local\Temp\Filter Forge 9\ and C:\Users\<username>\AppData\Roaming\Filter Forge 9\

Since I'm asking, I obviously didn't find it at either of those places.


You can't look in random locations and complain it is not at those places. The log can only be found at c:\Users\your_username\AppData\Local\Temp\Filter Forge x64.log

Quote
David Roberson wrote:
the log file is only created when an error occurs while running a Map Script


The log file is created when Filter Forge crashes, or when a script (Map or Curve) generates an error.
  Details E-Mail
David Roberson
Artist
Posts: 404
Filters: 36
Quote
GMM wrote:
The log file is still at c:\Users\your_username\AppData\Local\Temp\Filter Forge x64.log

Great! As you could tell, I improvised when I did not find a log. Since I have different versions of Filter Forge, I thought it might make a difference on where the log might be.

Quote
GMM wrote:
The log file is created when Filter Forge crashes, or when a script (Map or Curve) generates an error.

Thanks for that clarification.
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,711 Registered Users
+18 new in 30 days!

153,533 Posts
+38 new in 30 days!

15,348 Topics
+73 new in year!

Create an Account

Online Users Last minute:

10 unregistered users.