How to work with localDB in lua

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
abzivid
Licensed Customer
Posts: 15
Joined: Thu Sep 30, 2021 9:11 am

Hi,

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

Aleksandar
User avatar
bepeg4d
Octane Guru
Posts: 10323
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

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
abzivid
Licensed Customer
Posts: 15
Joined: Thu Sep 30, 2021 9:11 am

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
User avatar
bepeg4d
Octane Guru
Posts: 10323
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

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
abzivid
Licensed Customer
Posts: 15
Joined: Thu Sep 30, 2021 9:11 am

Many thanks. Will try it today.

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

Aleksandar
Post Reply

Return to “Lua Scripting”