AWS Thinkbox Discussion Forums

Submit Cinema4D scene job with Textures included to Deadline

Hi!

Pardon my ignorance, but I’ve been researching everywhere for this with no avail.

Currently we have a render farm with Deadline and Cinema4D, and we are having issues with textures not rendering properly on the farm. Designers are using the C4D feature of ‘save the project with assets’ which outputs the C4D scene file and a tex folder filled with textures.

However, we can’t submit the tex folder by default in Deadline, causing issues in the render.

When I SSH’ed into the VM that was running the job, I noticed the texture wasn’t there, and it was just the c4d file. When I manually added the textures it worked perfectly. Is there a way to copy the textures to the render nodes as well as the C4D file in Deadline?

It’s a bit complicated/not-ideal for us right now to set up an asset server, but I’m open to what anyone thinks!

A central location for assets would simplify this a great deal, but you already know that.

But as a plan B you could automate what you’ve done manually by effectively rolling your own asset transfer system.

Assuming you or someone on your team has some Python chops here’s the high-level plan. At least as I’d do it.

  1. OnJobSubmitted event plugin
    1.1. Adds the path to the created tex folder to a JobExtraInfo entry. Make sure it’s a path that the render node can access.
    1.2. Add a pre-task script so make sure the tex file is in place on the render node.
    1.2.1. Set it with this Job property
    1.2.2. What’s a task script?
    1.3. Add a post-task script to copy the output out to wherever it needs to go.
  2. Task script to copy the tex folder from wherever it’s made to the render node, and vice-versa
    2.1. This is what’ll be added to the job in the event plugin
    2.2. This also assumes that wherever the tex folder is coming from is online whenever rendering is going to happen.
    2.3. If that’s not the case, you’ll want to add a Job Dependency of some kind to have the job wait till the source is online. Those are run by the RCS or the Worker so make sure the path is accessible that that machine.

Getting oriented with scripting in Deadline: Scripting Overview — Deadline 10.3.1.4 documentation

That’s a bunch to drop on you, so let us know what you think!

1 Like

Thank you, I’m going to take this approach then.

Just a quick second question, I was going through the python scripts (Specifically Cinema4DSubmission.py) to make UI modifications. Is there a way to test it? I noticed that when I updated the file in the repoository the UI doesn’t get updated. I tried clearing cache + ‘re-syncing’ with repository. Not sure if that’s the best way of approaching it or if I’m doing something wrong.

If you have any tips on the debugging aspect of making modifications to the submission UI let me know!

But thanks so much for the detailed reply, I’ll start taking this approach. And maybe an asset server might be necessary too. I think I’m going to plan on supporting both.

That’s the way to do it - the synchronize button at the end of the Tools menu in the Monitor will re-set the cache. Or restarting the Monitor, but that’s typically a longer process.

Funnily enough since the integrated submitters don’t cache the script they don’t need a re-set for each change.

Just be sure to copy your custom script into DeadlineRepository10\custom\scripts\Submission so your custom version doesn’t get blown away when you upgrade.

1 Like

Thank you!!!

So for anyone who checks up on this thread. I updated the Cinema4DSubmission.py and added this to the end of the script:

if( len( sceneFiles ) == 1 ):
            # Extract the directory of the scene file
            scene_dir = os.path.dirname(sceneFile)

            # Path to the 'tex' folder within the same directory as the scene file
            tex_dir = os.path.join(scene_dir, 'tex')

            # Check if the 'tex' folder exists
            if os.path.exists(tex_dir) and os.path.isdir(tex_dir):
                print(f"'tex' folder found at: {tex_dir}")
                for file in os.listdir(tex_dir):
                    if not file.startswith('.'):
                        full_path = os.path.join(tex_dir, file)
                        arguments.Add(full_path);
            else:
                print("No 'tex' folder found in the scene directory.")
           
            print("executing command: %s" % " ".join(arguments))

            results = ClientUtils.ExecuteCommandAndGetOutput( arguments )
            scriptDialog.ShowMessageBox( results, "Submission Results" )

I check for a ‘tex’ folder and then upload all the files from the ‘tex’ folder onto the deadline.

@Justin let me know if you see any issues with this approach. The only overhead I see is copying the files multiple times to the render nodes, but that shouldn’t be too bad for now. I assume once a node picks up the next task in the same job, it doesn’t need to re-copy the job data, correct?

Another concern was from a different thread that the command could be too long so I probably should put the args in a .txt, eh? (C4D Auxfiles strategy).

Privacy | Site terms | Cookie preferences