Cinema 4D supports an environment variable that automatically connects an Asset Browser database whenever Cinema 4D, Team Render Client, or the Command Line renderer launches. This means you don't have to manually run Databases > Connect Database on each new install or on every render node.
The variable is:
g_connectdatabase=<path>
You can set it in any of the following places:
-
Cross-platform (Windows and macOS): the
config.txtfile in your Cinema 4D resource folder. - Windows only: a System Environment Variable.
- Windows only: the Target line of a desktop shortcut.
config.txt method below.Method 1: config.txt (Windows and macOS)
This is the cross-platform option and the simplest one to set up.
- Navigate to your Cinema 4D
resourcefolder. The exact path depends on your operating system (replace the asterisk with your Cinema 4D version):
Windows: Program Files > Maxon Cinema 4D * > resource
macOS: Applications > Maxon Cinema 4D * > resource - Open config.txt (not config.c4dpy.txt) with Notepad on Windows, TextEdit on macOS, or any plain text editor.
- Scroll to the bottom of the file and add a new line:
g_connectdatabase=<path> - Save the file.
Example:
g_connectdatabase="C:\Users\Username\Documents\Test Database"After saving, the next launch of Cinema 4D, Team Render Client, or the Command Line renderer will automatically connect the database.
Method 2: System Environment Variable (Windows only)
To create the environment variable on Windows 10 or 11:
- Right-click the Windows icon on the taskbar and select Settings.
- In the Settings window, search for and select Edit the system environment variables.
- The System Properties window opens. Choose the Advanced tab and click the Environment Variables button.
- Under System variables, click New. Enter g_connectdatabase as the Variable name, and your database's path as the Variable value.
- Click OK in the New System Variable window, then OK again in the Environment Variables window for the change to take effect.
After completion, the next launch of Cinema 4D, Team Render Client, or the Command Line renderer will automatically connect the database.
Method 3: Target line of a shortcut (Windows only)
This option only affects launches from that specific shortcut, which is useful when you want a database connected only for certain workflows (for example, a dedicated commandline render shortcut).
- Decide which application you want the shortcut to launch. Cinema 4D, Team Render Client, and the Command Line renderer all work with this method. The example below uses the Command Line renderer.
- Right-click the executable, hover over Send to, and choose Desktop (create shortcut).
- Right-click the new shortcut and choose Properties. The Target line shows the path to the executable.
- Move your cursor to the very end of the Target line (after the closing quote of the executable path). Press the spacebar, then enter g_connectdatabase= followed by the database path. Example:
- Click OK to save.
Launching Cinema 4D, Team Render, or the Command Line renderer from this shortcut will now automatically connect the database. Other shortcuts and Start menu entries are unaffected.
Connecting multiple databases at once
Any of the three methods above can connect multiple databases on launch. Put all the paths on the same line, separated by semicolons.
For example, if you have two databases at the root of your C drive:
C:\Database1
C:\Database2In config.txt or on a shortcut Target line, the entry looks like this:
g_connectdatabase="C:\Database1;C:\Database2"In the System Environment Variable dialog:
- Variable name: g_connectdatabase
- Variable value: C:\Database1;C:\Database2
Related articles
TL;DR
- Use the g_connectdatabase environment variable to auto-connect an Asset Browser database every time Cinema 4D, Team Render Client, or the Command Line renderer launches.
-
Cross-platform option (Windows and macOS): add
g_connectdatabase=<path>to the bottom ofconfig.txtin your Cinema 4D resource folder. - Windows-only options: set it as a System Environment Variable, or append it to the Target line of a desktop shortcut.
- macOS doesn't support user environment variables for security reasons, so the config.txt method is the only option there.
- For multiple databases, put the paths on one line separated by semicolons:
g_connectdatabase="C:\Database1;C:\Database2". - Wrap paths in straight double quotes if they contain spaces.
If you have any questions or need further assistance, please submit a support ticket, and our team will be happy to help.
Comments
0 comments
Article is closed for comments.