Skip to content

Project File Structure

Benjamin Nelson DeMann edited this page Aug 24, 2017 · 4 revisions

Project File Structure

Saved Data

All of the data is saved in hidden files that are scattered throughout the project.

After you have created the project you will find in the $BYU_PROJECT_DIR a file called .project. This file has some project level information stored as a JSON object. We have things like the path to the asset, shot, hda, users, and tools directories; the name of the project; and the email address and password used to communicate to the users about publishes.

The next level down is in the $BYU_PROJECT_DIR/production. Here are all of the directories:

  • First we have the assets directory. Here there is a folder for each asset in the project. Each asset directory is going to have a .body file inside which will describe the parts of the body. Inside the asset directory is also a number of folders that represent the elements for that asset (i.e. assembly, model, rig, etc). Each of these directories as a .element file associated with is that has all of the information about the element, such as it's name, it's version, the users that have checked it out and more.

  • Next we have the otls (or hda) folder. This folder doesn't really have any actually data in it. When an asset assembly or a tool hda is published it creates a link to the hda file and stores it in this folder. The actual asset lives in the $BYU_PROJECT_DIR/production/assets/ASSET_NAME/assembly/ELEMENT_NAME/ directory. But having all of the HDAs linked into the otl (hda) folder we can tell Houdini to look in just this folder for HDA libraries that it should add.

  • Finally are shots and tool directories. They has the same structure as the the asset folder but with shots or tool bodies and their respective elements instead.

Additionally there are some files in the $BYU_PROJECT_DIR/users directories. When a user checks out a body from the pipeline it will create a folder for them in the users directory. Inside of this folder will be a .user file that will keep track of their username, email, and name.

Each time a user checkouts a file if it will update the .checkout file that is located in $BYU_PROJECT_DIR/users/USERNAME/ELEMENT_NAME/ directory. This file will have all the information about the checkout. When it happened, which element was being checked out, who checked it out etc.

Renaming Assets

If you want to rename anything you need to make sure that all of these files have been updated appropriately. Things you will have to change:

  • .element file -> parent
  • .body -> name
  • body's directory in $BYU_PROJECT_DIR/production/BODY_TYPE/
  • Technically the .checkout -> body_name would have to change but finding every checkout file that uses that body might be difficult. I think it would be best to leave them alone and let the pipeline create a new checkout file when the user checks out the asset again. Therefore you might want to avoid relying on the checkout file for the body_name unless you just barely created it.

Accessing the Data

Each of these saved files have a corresponding class that allows you to access their information.

And each of these classes have a static method called create create_new_dict() that will create the dictionary that will be stored in JSON.

Future Optimizations

All of this persistent data is stored in text files throughout the $BYU_PROJECT_DIR and so it's not the fastest thing in the world. It's fast enough for most of our purposes but for a future Element Browser we may want to switch to a database of some sort to increase speed.