Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. Dunhou
    D

    Dunhou

    @Dunhou

    0
    Reputation
    10
    Posts
    6
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    Dunhou Follow

    Best posts made by Dunhou

    This user hasn't posted anything yet.

    Latest posts made by Dunhou

    RE: How to Show Nodes API Nodes in the Node Editor?

    @ferdinand
    I want to create a Node mat with some pre-exposed ports(python)(It's painful to search so many daily port) ,like this picture said:

    1. By default , there is no Transmision Color port on the material, I want to expose some ports I always used without connect with a node input.
    2. It's like 2 and 3 in the picture, can I do this Show in Node Editor command function when I create my custom materials?
      b34251ca-8ecc-4bd4-9bc9-38422b8b01b0-image.png
    posted in Cinema 4D SDK •
    RE: How to Set Node Spcace use python?

    @ferdinand

    First of all, Sorry for the wrong forum rules, and my poor English.

    It is work well. I try to set node space to support my tools with muti-engine materials, but I notice in the code, change the renderer will also change node space. It could be better to check active render engine or set renderer first.

    posted in Cinema 4D SDK •
    How to Show Nodes API Nodes in the Node Editor?

    And It is possiable to expose a inport without a input node?
    AKA : can I do this when I create node mat in python?
    416e097b-e450-42d8-9c1a-7f13385c6f9a-image.png

    posted in Cinema 4D SDK •
    How to Set Node Spcace use python?

    I got a c4d.GetActiveNodeSpaceId() in SDK , but it seems no SetActiveNodeSpaceId() like in SDK.
    So how can I Create a Redshift or a Arnold Node Material ?

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

    @ferdinand
    It's so sad , I'll try a script to define some output path token presets.
    Hope it can work as expect.
    Thanks for your answer

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

    @ferdinand
    I try to return a empty string when project name don't have a delimiter like
    _vstring , but in output path doesn't work anymore. This token just as a string in output:
    C4D File name : token.c4d / token_v2.c4d
    MyToken : $root/$rprj(real prj name with out _v[version])/$vn(version name)/$rprj
    expect path A :token_v2.c4d > $root/token/v2/token.png
    expect path Btoken.c4d > $root/token/token.png
    but when there is no version in prj name[B], It's output like this:
    token.c4d > $root/token/$vn[just the token symbol as str]/token.png
    And this is the $vnpart code :

    import os
    import c4d
    import re
    delimiter = "_v"
    # Get version number
    def GetVersion(filePath):
        versionList = re.findall(delimiter+"\d+",filePath)
        if len(versionList) == 0: # If no versions found
            return None, None
        rawVersion = re.compile(delimiter).split(versionList[len(versionList)-1])[1] # [string]
        version = int(rawVersion) #  [integer]
        return version, rawVersion
    
    # Thoken : Project Version Name with _v  ($vn)
    def GetProjectVersionName(data): # _v2 
        prjName = data[0].GetDocumentName()
        ver = GetVersion(prjName)[1] # rawVersion [string]     
        if ver == None: # if prj name have no delimiter component
            verStr = ""
            return verStr    # null string 
        else:
            verStr = delimiter + ver
            return verStr  # _v2
    
    if __name__=="__main__":
        for registeredToken in c4d.modules.tokensystem.GetAllTokenEntries():
            if registeredToken.get("_token") in ["root", "rprj", "vn"]:
                exit() 
            c4d.plugins.RegisterToken("vn", "DH Project Version Name", "v001", GetProjectVersionName) 
    
    

    Is there something wrong,please help me out.
    Thank you

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

    @ferdinand
    Thanks for your repley. My personal solution is also use multiple custom tokens, but it is a bit painful QAQ.

    I have to reg multiple tokens and define a string include token symol by a command buttom script. A little annoying problem-.- but better than input by hand😢

    Thanks for your help

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

    Hi,

    I want my custom render token to output a path fragment as for example root/name.

    So, when I have the render path $MyRenderToken/myFile.png, I want it to be resolved to root/name/myFile.png. All my attempts resulted in the path delimters being replaced with the underscore character, resulting in a directory root_name instead of a pair of nested directories root/name.

    Thanks!

    [edited by @ferdinand]: This is an interesting question which might be relevant for more users, so I took the liberty to make this posting more accesible.

    Original posting by @Dunhou:

    I want custom my render token,just like this folder structure

    _[root/prj name/version/cam/prj name.png]

    the function is done

    but it seems token can only generate a file name?

    Is there any possible to define a folder structure with a short word?

    $RNDR = root/prj name/version/cam/prj name.png

    but not : root_prj name_versio_cam_prj name.png

    PS : I know I can save a new.c4d file to do this, but Still need a esay way to difine this ,

    Thanks!

    posted in Cinema 4D SDK •
    RE: Packed Automatic UVs Command in S22?

    @ferdinand Thanks for your example,I do select a op in the OM.Last time I try it ,it did not work ,but this time it works well,I think last time I use S26 preset python text, and Optional is not import probly, anyway It's work well right now . Great thanks for you

    posted in Cinema 4D SDK •
    RE: Packed Automatic UVs Command in S22?

    This script did not work in S26.013(win),but work in R25. Is there any change between 26 and 25?
    SDK seems not update UV mod
    Please Help

    posted in Cinema 4D SDK •