YOUR ACCOUNT

Login or Register to post new topics or replies
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I was going to continue work on a large script filter (mandelbulb renderer) in the newest filter forge release - now I get a new error I've never seen before:

Lua Critical Exception: Attempt to unpersist an external Lua function

My script used to work - was something changed recently related to loading external script files?
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I tried to look up the error on Google, but it seems to be Filter Forge specific - what does it mean?
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Anyone? I can't seem to make any of my script filters with external references work due to this error smile:cry:
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Ok - the error is not related to the initial include call:

in Map Script script I tried:
Code
dofile("C:\\Users\\Sphinx\\test.lua");


where "test.lua" contains:
Code

function prepare()
   -- This function is called once,
   -- before the rendering begins.
   -- Use it for querying non-mapped
   -- inputs and precalculation.
end;

function get_sample(x, y)
   -- Image generation code goes here.
   local r = x
   local g = y
   local b = (x + y) / 2
   local a = 1
   return r, g, b, a
end;



This works just fine. I guess the error is related to actual script code in my external files. However the scripts used to work, so I need to know what that (new?) error message is about..
  Details E-Mail
GMM
Moderator
Filter Forge, Inc
Posts: 3491
So, the above script works? Please attach the one that doesn't work.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I can't do that as the whole "application" use several lua libraries .. to much to set up for a simple test case.

I just want to know what triggers that error message in general (and what it means.. "unpersist" is not very clear to me). Then I can debug the actual problem myself...
  Details E-Mail
GMM
Moderator
Filter Forge, Inc
Posts: 3491
Quote
Sphinx. wrote:
in the newest filter forge release


Could you let me know the exact FF build which started to show issues? (there have been different builds of 2.009 on the website).

Now, a story about unpersisting. As you know rendering in Filter Forge is performed in separate passes. When you call prepare(), the Lua subsytem needs to save its results for future passes — for instance, if an unsafe script queries system time it should be consistent for all passes. We employ a third-party lib for that. In Lua jargon saving the result of a function is called persisting, and restoring the saved result is called unpersisting.

I understand all of the above is of little help to debug your problem, but if you could set up a test base our developers promise to look into it smile:)
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Alright I located the problem - it is related to a change in global variable visibility..

The testcase is rather simple:

1. Create a new lua file, test.lua, with the following content:
Code

function prepare()
   t = 1
end;

function get_sample(x, y)
   --t = 0.5
   return t,t,0,1
end;


2. Create a new filter and drop a new Map Script, enter:
Code
dofile("C:\\test.lua")

Or the path to where you put the test.lua file (remember "\\" as directory delimiter format, e.g. "C:\\Users\\GMM\\test.lua"

FF will now complain because global variable t is not registered properly (this used to work earlier).

Comment out t assignment in prepare and enable t assignment in get_sample - now it works.


The unpersist error is just a more complex version of this problem. I can send you a testcase for the unpersist error (I can't attach here due to file attachment restrictions), where should I send to?
  Details E-Mail
GMM
Moderator
Filter Forge, Inc
Posts: 3491
Thanks for the info, we'll look into it.

Quote
Sphinx. wrote:
where should I send to


Please send to info@filterforge
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
You should have a complete example in your inbox now smile:)
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I'm still unpersisting my *** off here smile;) Any news on the issue?
  Details E-Mail
GMM
Moderator
Filter Forge, Inc
Posts: 3491
The developers are still unpersisting your test case smile:) We'll try to fix this by the release of the 3.0 beta.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Just tested in FF3B1 .. bug is still there smile:-(
  Details E-Mail
GMM
Moderator
Filter Forge, Inc
Posts: 3491
Should be fixed in 5.011 – please check.
  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,531 Posts
+36 new in 30 days!

15,347 Topics
+72 new in year!

Create an Account

Online Users Last minute:

16 unregistered users.