Page 1 of 1

How to work with localDB in lua

PostPosted: Wed Oct 20, 2021 2:48 pm
by abzivid
Hi,

How can one get and work with liveDB from lua scripts?
Seems that octane.importLocalDB is not available.

Aleksandar

Re: How to work with localDB in lua

PostPosted: Thu Oct 21, 2021 6:30 am
by bepeg4d
Hi,
here you can find a lua script for finding all materials IDs from LiveDB, and to download the desired material based on ID:
viewtopic.php?f=23&t=54623&hilit=.lua#p278441

I have just tried them with Standalone 2020.2.5, and they seem to work as expected.

ciao
Beppe

Re: How to work with localDB in lua

PostPosted: Thu Oct 21, 2021 12:41 pm
by abzivid
Hi beppe,

I appreciate the answer and I'll use liveDB at some point.

However, I want to use localDB programmatically.
Could not find API support for the local one.

Aleksandar

Re: How to work with localDB in lua

PostPosted: Fri Oct 22, 2021 7:23 am
by bepeg4d
Oops, sorry,I have answered at the first question only.

About LocalDB, it is just a path with a series of .orbx files saved in it.
So you can use octane.project.getPreferences to read the NT_LOCAL_APP_PREFS node, and get the LocalDB path with A_LOCALDB_DIR.

If not changed in Preferences, by default it is set to C:\Users\UserName\AppData\Roaming\OctaneRender\localDb.

ciao
Beppe

Re: How to work with localDB in lua

PostPosted: Fri Oct 22, 2021 7:27 am
by abzivid
Many thanks. Will try it today.

Pity that getting localDB using API is not more direct and intuitive :(

Aleksandar