Folder Creation

Discussions related to creating NIM project structures
Post Reply
mitchell.lotierzo
Posts: 18
Joined: December 16th, 2016, 8:16 pm

Folder Creation

Post by mitchell.lotierzo »

Where exactly is the folder creation taking place (in the coding)? Would it be possible to modify that logic for specific project scenarios or to allow for more control over folder naming, etc?

Thanks!

Mitch

User avatar
andrew
Site Admin
Posts: 337
Joined: June 24th, 2014, 8:10 am

Re: Folder Creation

Post by andrew »

Hi Mitchell,

NIM reads all of the project folder names from the Project Structure Templates in combination with the Task `folders` field set in the Admin section. You can modify the Project Structure Template and Task folder setting to meet your folder name requirements. In addition for special case projects you can create multiple project templates which you can select on a per project basis.

In NIM 2.5 we are providing direct access to the folder creation process through custom scripts. The code snippet that actually creates the folders has been exposed in this version and is available to override as you see fit. NIM 2.5 will be released in the next few weeks but we can provide you with early access if you want to try out this feature. Please email support@nim-labs.com to request access to the NIM 2.5 beta.

Thanks,
Andrew

mitchell.lotierzo
Posts: 18
Joined: December 16th, 2016, 8:16 pm

Re: Folder Creation

Post by mitchell.lotierzo »

Hi Andrew,

Is there any documentation on how to customize the folder creation process now that NIM 2.5 has been released?

Thanks,
Mitchell

User avatar
andrew
Site Admin
Posts: 337
Joined: June 24th, 2014, 8:10 am

Re: Folder Creation

Post by andrew »

Hi Mitchell,

In the documentation there is a section dedicated to project structures and variables folders with an example on how to use the custom fields to organize and group assets. Here is a link:

http://nim-labs.com/docs/NIM/html/gs_ad ... structures

Let me know if you'd like some further examples on using variables in project structures.

Thanks,
Andrew

mitchell.lotierzo
Posts: 18
Joined: December 16th, 2016, 8:16 pm

Re: Folder Creation

Post by mitchell.lotierzo »

That's great, but I'm referring more to the code that handles the actual folder creation. For example, if I wanted the example "<asset type>" to create the folders with lowercase names instead; or if I need to implement some custom logic during the creation process.

User avatar
andrew
Site Admin
Posts: 337
Joined: June 24th, 2014, 8:10 am

Re: Folder Creation

Post by andrew »

Ah, ok. Sorry, I was thinking more basic structures. On the VM in /var/www/html/_custom there is an example createFolder.php script. This is an example of a script to override the folder creation process. You can choose to use this script instead of the default mechanism by going to Admin/Jobs/Options and at the bottom selecting createFolder.php from the dropdown. This dropdown will display all php files that exist in the _custom directory. Here you can inject your own code. We have some clients that use customFolder.php to compare the folders sent to the script to a known value they have defined and trigger additional events as needed.

We do not have a mechanism at this time to force lowercase folders, but it is something we could add. All case is taken directly from how it is entered in the project structure template and the name of the asset or shot, or task folder. Any changes to the folder names or path that are being made would not be reflected back in NIM as the createFolder script doesn't know what type of folder its making, just the path that needs to be created. Modifying folders names and paths here can be fine if you are not using our connectors or have developed your own. However it could potentially break things if you modified the asset or shot root folder names or paths. Most clients that I know of working with the customFolder script are using it to create additional folders, set sym-links, and set advanced permissions.

Thanks,
Andrew

mitchell.lotierzo
Posts: 18
Joined: December 16th, 2016, 8:16 pm

Re: Folder Creation

Post by mitchell.lotierzo »

So, basically, what I'm looking to do, is test against a certain asset type. Depending on what type is found, then a certain set of folders is created. For instance, our "camera" assets don't need all the folders that our typical assets would need (I.e. textures, materials, etc.)

User avatar
andrew
Site Admin
Posts: 337
Joined: June 24th, 2014, 8:10 am

Re: Folder Creation

Post by andrew »

The createFolder script would definitely be the right place to do this. It will receive the full path it is being asked to create. You can compare the folder name to a known list of names and append additional folder creation as needed.

Post Reply