Page 2 of 2

Re: cfg and scn paths

Posted: Tue Mar 26, 2019 7:20 pm
by nigec
I've tried the path every way I can think of, the script works with "scenes/cornell/cornell.cfg, I've tried 3 different scripts, tried re ordering how the script is read
I can't find a python example so I'm clutching straws

Re: cfg and scn paths

Posted: Tue Mar 26, 2019 7:26 pm
by B.Y.O.B.
Here's how Dade uses it in luxcoreui: https://github.com/LuxCoreRender/LuxCor ... p.cpp#L249

Code: Select all

	// Clear the file name resolver list
	luxcore::ClearFileNameResolverPaths();
	// Add the current directory to the list of place where to look for files
	luxcore::AddFileNameResolverPath(".");
	// Add the .cfg directory to the list of place where to look for files
	boost::filesystem::path path(fileName);
	luxcore::AddFileNameResolverPath(path.parent_path().generic_string());

Re: cfg and scn paths

Posted: Tue Mar 26, 2019 7:34 pm
by nigec
yeah that's what I worked off
I've moved the py file to C:\Temp and it still fails
I've posted a simple example , I could be on this for 4 hours and I have no idea what to try next

Re: cfg and scn paths

Posted: Tue Mar 26, 2019 7:59 pm
by Dade
The script is working fine here, just change 'props = pyluxcore.Properties("cornell.cfg")' in 'props = pyluxcore.Properties("scenes/cornell/cornell.cfg")'.

If you use this:

Code: Select all

pyluxcore.AddFileNameResolverPath("scenes/cornell")
Than I assume your current directory is where "scenes/cornell" is so you must use

Code: Select all

props = pyluxcore.Properties("scenes/cornell/cornell.cfg")

Re: cfg and scn paths

Posted: Tue Mar 26, 2019 8:08 pm
by nigec
oh man I feel so stupid... Got it, talk about setting myself up to fail :oops:
Thank you for your help Dade
And thanks B.Y.O.B.