Navigation

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

    Best posts made by Dunhou

    RE: Get the Name of the Node?

    @bentraje

    I think name atttribute is not easy as old c4d SDK to use . It cann't print in console .

    I use this to get Name , and Set Name .
    some codes in python sdk didn't work and return None .Maxon SDK has a example to get info form node retrieve_information_r26.py

        # 获取名称 : 
        def GetNodeName(self, node, display=False):
            """
            Retrieve the displayed name of a node.
            
            Parameters
            ----------        
            Args:
                node: (maxon.GraphNode): The node to retrieve the name from.
                display: print info when display is True
            Returns:
                Optional[str]: The node name, or None if the Node name can't be retrieved.
            """
            if node is None:
                return None
    
            nodeName = node.GetValue(maxon.NODE.BASE.NAME)
    
            if nodeName is None:
                nodeName = node.GetValue(maxon.EffectiveName)
    
            if nodeName is None:
                nodeName = str(node)
            if display ==True :
                print(nodeName)
            return nodeName   
    
    posted in Cinema 4D SDK •
    RE: Can I download a Tex in Asset Browser and add into select RS node mat?

    @ferdinand Maybe the broblem in not the code but the Cinema Application, Some friends also told me when they load Aseets(especially at a large Asset data like 20G in disk) , It always take a long time or even not load unless restart C4D.

    You are right, I should call WaitForDatabaseLoading() function for safe. That's my stupid , I didn't notice the loading failed in state bar😧

    I do check the Python examples in GitHub , but I think maybe it is a dcc of my config problem, some friends also said assets broswer is a little slower . (perhaps due to china a internet far away from maxon server) .hope it will be fix in uncoming C4D

    posted in Cinema 4D SDK •
    RE: Change the ColorSpace of Redshift Texture Node?

    @bentraje
    A little set for this , hope it can help something 😊
    Set color space

    posted in Cinema 4D SDK •
    RE: Change the ColorSpace of Redshift Texture Node?

    @bentraje
    I just drag and drop the item and return the str ,
    I also didn't found any str define in cinema folder

    posted in Cinema 4D SDK •
    RE: Can a Render Token contain Special Characters?

    @ferdinand

    A little update for this topic , my final solution for this problem is reg some tokens , and reg a plugin to analysis the project name and set token string depend on project name structure .

    like a project name has a version sign like _v , than the output path set a $v for render . All the tokens can set by the analysis plugin . It is a bit stupid way but work well for a quickly set render path just one click.

    Cheers🥂

    posted in Cinema 4D SDK •
    RE: How to set a Shader for Roughness ????

    @bentraje
    Reflection layer symbols can't drag to console to get , maybe you can check Materials document , And GitHub Example for this.

    And Shout out to @ferdinand ,this is my topic for this .

    Here is a little code I used to set textures for BaseMaterials :

    import c4d
    
    def main():
        # Creates a standard C4D Material
        mat = c4d.Material()
        if mat is None:
            raise RuntimeError("Failed to create a new default material.")
    
        # Removes the default specular layer
        mat.RemoveReflectionLayerIndex(0)
    
        # Adds a layer
        layer = mat.AddReflectionLayer()
        if layer is None:
            raise RuntimeError("Failed to create a new reflection layer.")
    
        # Sets the Layer to Blinn mode
        mat[layer.GetDataID() + c4d.REFLECTION_LAYER_MAIN_DISTRIBUTION] = c4d.REFLECTION_DISTRIBUTION_SPECULAR_BLINN
        
        # Sets the shader for width
        colormap = "filename"
        shacolor = c4d.BaseList2D(c4d.Xbitmap)
        shacolor[c4d.BITMAPSHADER_FILENAME] = colormap
        mat.InsertShader(shacolor)    
        
        # Defines the Roughness float value
        mat[layer.GetDataID() + c4d.REFLECTION_LAYER_MAIN_SHADER_ROUGHNESS] = shacolor
    
        # Inserts a material in the active doc
        doc.InsertMaterial(mat)
    
        # Pushes an update event to Cinema 4D
        c4d.EventAdd()
    
    if __name__ == '__main__':
        main()
    
    posted in Cinema 4D SDK •
    RE: Ability to set DLG_TYPE_ASYNC Width & Height

    @m_adam
    Thanks for you reply , and there is nothing worry about the time, you are much busier than me😊

    I already try the defaultX and nothing changed, the dialog is always bigger than I set , it seems the dialog is considering teh hiden element size or something , the code is bit long for the forum ( maybe we should add a folding option to the code block in the forum ), and I sent an copy to ferdinand , and newest version has nothing changed for the UI part, Is that convenient for you to get a copy from ferdinand or post your email I can send you emails to,

    Cheers~

    posted in Cinema 4D SDK •