How to work with localDB in lua

Forums: How to work with localDB in lua
Forum for OctaneRender Lua scripting examples, discussion and support.

How to work with localDB in lua

Postby abzivid » Wed Oct 20, 2021 2:48 pm

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

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

Aleksandar
abzivid
Licensed Customer
Licensed Customer
 
Posts: 15
Joined: Thu Sep 30, 2021 9:11 am

Re: How to work with localDB in lua

Postby bepeg4d » Thu Oct 21, 2021 6:30 am

bepeg4d Thu Oct 21, 2021 6:30 am
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
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: How to work with localDB in lua

Postby abzivid » Thu Oct 21, 2021 12:41 pm

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

Re: How to work with localDB in lua

Postby bepeg4d » Fri Oct 22, 2021 7:23 am

bepeg4d Fri Oct 22, 2021 7:23 am
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
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: How to work with localDB in lua

Postby abzivid » Fri Oct 22, 2021 7:27 am

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

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

Aleksandar
abzivid
Licensed Customer
Licensed Customer
 
Posts: 15
Joined: Thu Sep 30, 2021 9:11 am

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 6 guests

Thu Mar 28, 2024 8:00 pm [ UTC ]