Navigation

    • Register
    • Login
    • Search
    1. Home
    2. visualride
    3. Posts
    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups

    Posts made by visualride

    RE: How to change bitmap in layered shader?

    Perfect! Thank you so much!

    posted in Cinema 4D SDK •
    How to change bitmap in layered shader?

    I'm writing a plugin to change the bitmaps within layered shaders. I've found here some great examples on how to change parameters in LayerShaderLayer but have yet to figure out exactly how to change and update a bitmap in the layered shader.

    Here's my latest attempt. I know that I probably don't have to update all elements, but to be sure, I updated a few.

    mat = doc.GetFirstMaterial()
        shd = mat.GetFirstShader()
        if shd.GetName() == "Layer":
            layShd = mat[c4d.MATERIAL_COLOR_SHADER]
            layShdFirst = layShd.GetFirstLayer()
            print layShdFirst.GetParameter(c4d.LAYER_S_PARAM_SHADER_LINK)
            theBitmap = c4d.BaseList2D(c4d.Xbitmap)  #create a bitmap baseshader
            theBitmap[c4d.BITMAPSHADER_FILENAME] = "/Woven_Black_Carpet_Flat.jpg"
            theBitmap.InsertUnder(layShd)
            #layShdFirst.SetParameter(c4d.LAYER_S_PARAM_ALL_ACTIVE, True)
            
            #print layShdFirst.GetBitmap()
            layShdFirst.SetParameter(c4d.LAYER_S_PARAM_SHADER_LINK, theBitmap)
            layShd.Message(c4d.MSG_UPDATE)#update
            shd.Message(c4d.MSG_UPDATE)#update
            mat.Update(True, True)
            print layShdFirst.GetParameter(c4d.LAYER_S_PARAM_SHADER_LINK)
    
    posted in Cinema 4D SDK •
    RE: How to close a dialog box by event

    That should work. Thanks for the clarification and pointer to the example!

    posted in Cinema 4D SDK •
    How to close a dialog box by event

    I want to display what the document name that I am currently processing with my plugin. Can I use a gui.MessageDialog, or is there a better way? If I do use a gui.MessageDialog, how do I close it automatically when I move on to process the next document?

    posted in Cinema 4D SDK •
    RE: How to cancel FileLoad error message.

    Thanks for the reply! I'll try that, though I thought that SCENEFILTER_IGNOREXREFS would keep xrefs from being loaded, and since my plugin edits the xref path/name, this would not work. But then again, perhaps I assumed wrong. I appreciate the help! By the way, the idea of classification by tags appears to be a good way to escape the messy folding out tree of classification system that we are all used to. I'll use it next time.

    posted in Cinema 4D SDK •
    How to cancel FileLoad error message.

    I have a plugin that I need to use c4d.documents.LoadFile(). I get a pop up question if I load a file with a New XRef that is missing a reference, asking a Yes or No question. Can I answer yes or no in code, or cancel the load if I get an error? I tried using c4d.documents.LoadDocument() but this is causing another xref issue. My Legacy XRefs aren't always keeping their options set and often times all display and on/off options (under the XRef O tab) all turn on. The plugin replaces text in an xref path/filename.

    posted in Cinema 4D SDK •