cfg and scn paths

Discussion related to the LuxCore functionality, implementations and API.
User avatar
nigec
Posts: 141
Joined: Mon Mar 11, 2019 8:50 am

Re: cfg and scn paths

Post 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
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: cfg and scn paths

Post 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());
User avatar
nigec
Posts: 141
Joined: Mon Mar 11, 2019 8:50 am

Re: cfg and scn paths

Post 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
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: cfg and scn paths

Post 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")
Support LuxCoreRender project with salts and bounties
User avatar
nigec
Posts: 141
Joined: Mon Mar 11, 2019 8:50 am

Re: cfg and scn paths

Post 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.
Post Reply