CINEMA 4D – Fix Missing Textures

22 March 2017

Often times you are moving Cinema 4D projects around. This can be between different Hard-Drives or from PC to MAC, or you are working on projects with a Team and keep moving your c4d Files back and forth.

Cinema 4D reports missing Textures when it can’t find the Texture file in your Materials, or can’t find linked Xrefs. There are many reasons why this can happen. Here are some of them:

  • The Image Textures have been deleted or renamed
  • The Textures have moved to a different location
  • Your Colleague does not have the Texture on his Computer
  • The Texture paths have been setup as Absolute, meaning Cinema 4D is looking in a specific folder such as c:\Project\MyGreatTextures\ and the Texture is no longer in this folder

What you should do to prevent missing textures from the start, especially when working on projects in a team, is set up your Cinema 4D Texture environment optimally:

  • When working locally: Save your textures in the Project\tex\ folder and link textures relatively. When sharing your project with somebody else be sure to also share your tex folder. Cinema 4D has an own menu command for this that is called: “Save Project with Assets”, you can find it in the “File” Menu.
  • When working on a network drive with a team: have a dedicated Texture Folder set up on the Network Drive everyone has access to and configure this Folder Path in the Cinema 4D Settings

Here is a handy little script that converts all absolute linked Textures to relatively linked Textures, meaning they can instantly be found in either the \tex path of your project folder or your configurated dedicated Texture Path.

import c4d, os
from c4d import gui

def shadertree(shader):
    # Loop through the BaseList
    while(shader):
         
        # This is where you do stuff
        print shader.GetName()
        # If it's a bitmap, we'll look at the filename
        if shader.GetType() == c4d.Xbitmap:
            filename = shader[c4d.BITMAPSHADER_FILENAME]
            print filename
            # for instance we can set the filename to just the file part
            filename = os.path.basename(filename)
            shader[c4d.BITMAPSHADER_FILENAME] = filename
         
        # Check for child shaders & recurse
        if shader.GetDown(): shadertree(shader.GetDown())
        # Get the Next Shader
        shader = shader.GetNext()
         
def main():
    # Get the first material
    mat = doc.GetFirstMaterial()
    # Loop through materials
    while(mat):
        # Get the first shader
        # Note - this is a 4D list - you've gotta GetDown
        shd = mat.GetFirstShader()
        # Use our recursive function to parse the shader tree
        shadertree(shd)
        # Get the Next material
        mat = mat.GetNext()
 
if __name__=='__main__':
    main()

 

How do you fix Missing Textures and what is your best practice when setting up Cinema 4D for a Team over a network? Share your thoughts in the comments!

Alex - post author

Hi, I am Alex, a passionate Director and 3D Generalist currently working in an Animation Studio.

Leave a Reply

Notify of
avatar
wpDiscuz