Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
@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:
(python)
Transmision Color
Show in Node Editor
@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.
And It is possiable to expose a inport without a input node? AKA : can I do this when I create node mat in 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 ?
c4d.GetActiveNodeSpaceId()
@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
@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 :
_v
token.c4d / token_v2.c4d
$root/$rprj(real prj name with out _v[version])/$vn(version name)/$rprj
token_v2.c4d > $root/token/v2/token.png
token.c4d > $root/token/token.png
token.c4d > $root/token/$vn[just the token symbol as str]/token.png
$vn
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
@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
Hi,
I want my custom render token to output a path fragment as for example root/name.
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.
$MyRenderToken/myFile.png
root/name/myFile.png
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!
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 ,
@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
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