How do I automatically connect an Asset Browser database to Cinema 4D, Team Render, and Command line?

Ron
Ron
  • Updated

We've added an environment variable that will automatically connect your Asset Browser database upon the launch of Cinema 4D, Team Render, and the Command Line.

 

The environment variable is:

g_connectdatabase=<path>

 

You can add the variable in a few places:

  1. Config.txt file (Mac and Windows)
  2. Environment Variables (Windows Only)
    environment variables cannot officially be used under macOS for security reasons
  3. Target line of a shortcut (Windows Only)

I've included explanations below on how to set this up for each option as well as set up for multiple databases.

 

1. Environment Variables:

To create or modify environment variables on Windows 10:

    1. On the Windows taskbar, right-click the Windows icon and select Settings.

    2. In the Settings window, search and select "Edit the system environment variables."
      .png

    3. This will open the System Properties window. Choose the Advanced Tab in the System Properties window and click the Environment Variables button.
      Window_3.png

    4. Click New under System Variables and enter g_connectdatabase to the "Variable name" line item and your database's path under the "Variable value" line item.
      Enter_Envrioment_Variables.png

    5. After creating the environment variable, click OK on the "New System Variable" window and click OK on the "Environment Variables" window for the change to take effect.

After completion, when you launch Cinema 4D, Team Render Client, or the Command Line, the Asset Browser database you've created will be automatically connected.

 

2. The Config.txt file:

  1. Navigate to your Maxon Cinema 4D * > resource folder. (* represents the version number)
    Windows: Program Files > Maxon Cinema 4D * > resource
    Mac: Applications > Maxon Cinema 4D * > resource
  2. Open the config.txt (not the config.c4dpy.txt) with Notepad (Windows), TextEdit (Mac), or your preferred plain text editor.
  3. Scroll to the bottom of the text file and enter the following:
    g_connectdatabase=<path>
  4. Save the config.txt

Here is an example of what it might look like in the Config.txt file:

g_connectdatabase="C:\Users\Username\Documents\Test Database"

 

After completion, when you launch Cinema 4D, Team Render Client, or the Command Line, the Asset Browser database you've created will be automatically connected.

 

3. Target Line of a Shortcut:

  1. Create a shortcut for which item you wish to connect to the database. I will use the command line as an example.
  2. Right-click on the appropriate executable, hover over "Send To," and choose "Desktop (create shortcut)
    Export_Shortcut.png
  3. Right-click on the newly created shortcut and choose "Properties."
    Under the shortcut properties window, you will see a "Target" line.
    This line represents the location of where the app is.

  4. On the Target line, move the cursor to the end of the app location, where you will see an end quote.
    Hit the spacebar and enter the g_connectdatabase= variable followed by the path.

    Here is an example of what it should look like:

    Target_Line.png
  5. Finally, hit OK to save the changes.

After completion, when you launch from this newly created shortcut, the Asset Browser database you've created will be automatically connected.

 

Setup for multiple databases:

The following can be implemented on any of the three options above.

 

For the sake of simplicity, let's say you have two databases on the root of your C drive:

C:\Database1 and C:\Database2

 

When adding multiple databases, they must be on the same line, start and end with quotes, and be separated by semi-colons.

 

Using our example, here is what it should look like in the config.txt file and the target line of a shortcut:

g_connectdatabase="C:\Database1;C:\Database2"

 

In the environment variable settings, it will be:

Variable name:
g_connectdatabase

Variable value:
C:\Database1;C:\Database2

Was this article helpful?

/

Comments

0 comments

Article is closed for comments.