<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Add Expression Value in Render Settings Save Path]]></title><description><![CDATA[<p dir="auto">Hello,<br />
Is there a chance to add an expression result of python ( for me the mayor version from the C4D file name ) to the Render Settings Path string ? I would not use c++ custom token, because I'm not familiar in C++. <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--wink" style="height:23px;width:auto;vertical-align:middle" title="😉" alt="😉" /><br />
Thanks ! <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title="🙂" alt="🙂" /><br />
G<br />
<img src="/forum/assets/uploads/files/1727535102681-f1d6599a-bfb8-4ab8-9ba9-4041b9a7a092-image.png" alt="f1d6599a-bfb8-4ab8-9ba9-4041b9a7a092-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://developers.maxon.net/forum//topic/15733/add-expression-value-in-render-settings-save-path</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Mar 2026 06:19:58 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum//topic/15733.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 28 Sep 2024 14:52:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Add Expression Value in Render Settings Save Path on Fri, 08 Nov 2024 13:37:31 GMT]]></title><description><![CDATA[<p dir="auto">The extension is different. So the file name too.<br />
<img src="/forum/assets/uploads/files/1731073048659-06886d91-7c0a-42a3-ba9f-0304f23c8315-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://developers.maxon.net/forum//post/75285</link><guid isPermaLink="true">http://developers.maxon.net/forum//post/75285</guid><dc:creator><![CDATA[Gemini]]></dc:creator><pubDate>Fri, 08 Nov 2024 13:37:31 GMT</pubDate></item><item><title><![CDATA[Reply to Add Expression Value in Render Settings Save Path on Fri, 08 Nov 2024 11:00:14 GMT]]></title><description><![CDATA[<p dir="auto">Ups. Maybe. I'm checking..</p>
]]></description><link>http://developers.maxon.net/forum//post/75282</link><guid isPermaLink="true">http://developers.maxon.net/forum//post/75282</guid><dc:creator><![CDATA[Gemini]]></dc:creator><pubDate>Fri, 08 Nov 2024 11:00:14 GMT</pubDate></item><item><title><![CDATA[Reply to Add Expression Value in Render Settings Save Path on Thu, 07 Nov 2024 15:20:44 GMT]]></title><description><![CDATA[<p dir="auto">If i'm not mistaken, "_1" is generated by Redshift if the "Regular Image" filename and the "Multi-Pass Image" filename are the same</p>
<p dir="auto">Same filename :<br />
<img src="/forum/assets/uploads/files/1730992703269-b45f2bf6-8f7c-424b-9f58-3032533a9a44-image.png" alt="image.png" class=" img-fluid img-markdown" /><br />
<img src="/forum/assets/uploads/files/1730992728746-d0a79049-ad72-400e-8c31-6178a8865812-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Changing "-" to "_" at the end of the file :<br />
<img src="/forum/assets/uploads/files/1730992806231-cccb1c63-f3f3-41be-92c6-fcc2ad75b17a-image.png" alt="image.png" class=" img-fluid img-markdown" /><br />
<img src="/forum/assets/uploads/files/1730992838196-eb647411-aa3c-4870-9f36-245afe77310f-image.png" alt="eb647411-aa3c-4870-9f36-245afe77310f-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://developers.maxon.net/forum//post/75275</link><guid isPermaLink="true">http://developers.maxon.net/forum//post/75275</guid><dc:creator><![CDATA[shivamist]]></dc:creator><pubDate>Thu, 07 Nov 2024 15:20:44 GMT</pubDate></item><item><title><![CDATA[Reply to Add Expression Value in Render Settings Save Path on Thu, 07 Nov 2024 13:31:05 GMT]]></title><description><![CDATA[<pre><code>"""
Copyright: MAXON Computer GmbH
Author: Maxime Adam

Description:
    - Registers two Tokens plugin. One visible in the render setting the other one not.
    - A token is a string that will be replaced during the token evaluation time by a string representation.

Class/method highlighted:
    - c4d.plugins.RegisterToken
    - c4d.plugins.RegisterHiddenToken

"""
import c4d
import re
from c4d import documents

def majorVersionToken(data):
    """The function that will be called to return the string representation of a token.

    Args:

    Returns:
        str: The string that will replace the token
    """
    doc = documents.GetActiveDocument()
    # Get the file path of the current document
    file_name = doc.GetDocumentName()
    match = re.search(r'v\d{0,10}', file_name)
    version = 'v001'
    if match:
        version = 'v' + match.group().replace('v','').zfill(3)
    else:
        # print("No match found")
        pass
    return str(version)

def minorVersionToken(data):
    """The function that will be called to return the string representation of a token.

    Args:

    Returns:
        str: The string that will replace the token
    """
    doc = documents.GetActiveDocument()
    # Get the file path of the current document
    # file_path = doc.GetDocumentPath()
    file_name = doc.GetDocumentName()
    match = re.search(r'_\d{0,10}', file_name)
    version = '001'
    if match:
        version = match.group().replace('_','')
        if len( version) &lt;= 3:
            version = version.zfill(3)
    else:
        pass
    return str(version)

def shortProjectNameToken(data):
    """The function that will be called to return the string representation of a token.

    Args:

    Returns:
        str: The string that will replace the token
    """
    # Get the file path of the current document
    file_name = documents.GetActiveDocument().GetDocumentName()
    match = re.search(r'v\d{0,3}', file_name)
    token = file_name.split( match.group())[0].rstrip('_')
    return str(token)


def PythonHiddenToken(data):
    """The function that will be called to return the string representation of a token.

    Args:

    Returns:
        str: The string that will replace the token
    """

    # Returns the frame number as a string. So this will replace the token by the frame number.
    return str(data[4])


if __name__ == "__main__":
    # First it's important to check if the token is not already registered
    for registeredToken in c4d.modules.tokensystem.GetAllTokenEntries():
        # Checks if the token name is already used, if it's the case exit.
        if registeredToken.get("_token") in ["majorVersionToken", "PythonHiddenToken"]:
            exit()

    # Registers the token "PythonToken" that will be visible in te render setting.
    c4d.plugins.RegisterToken("mver", "_Project Mayor Version", "v002", majorVersionToken)
    c4d.plugins.RegisterToken("nver", "_Project Minor Version", "002", minorVersionToken)
    c4d.plugins.RegisterToken("shortproject", "_Project Short Name", "scene", shortProjectNameToken)

    # Registers the token "PythonHiddenToken" it will not be visible in te render setting.
    c4d.plugins.RegisterHiddenToken("PythonHiddenToken", "This is a Hidden Python Token", "001", PythonHiddenToken)
</code></pre>
]]></description><link>http://developers.maxon.net/forum//post/75274</link><guid isPermaLink="true">http://developers.maxon.net/forum//post/75274</guid><dc:creator><![CDATA[Gemini]]></dc:creator><pubDate>Thu, 07 Nov 2024 13:31:05 GMT</pubDate></item><item><title><![CDATA[Reply to Add Expression Value in Render Settings Save Path on Thu, 07 Nov 2024 11:55:27 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your answer.<br />
Tokens are working well but I have a strange issue with them  at the multi pass files, if I end the file with a string ( here 'XXX') the file works well but If not it adds '<em>1</em>' to it. Do I miss something in the process ? I think my python token string could not generate that end string there.</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1730980337642-820b4db4-62fb-4d53-ac82-108d1a446d6a-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://developers.maxon.net/forum//post/75273</link><guid isPermaLink="true">http://developers.maxon.net/forum//post/75273</guid><dc:creator><![CDATA[Gemini]]></dc:creator><pubDate>Thu, 07 Nov 2024 11:55:27 GMT</pubDate></item><item><title><![CDATA[Reply to Add Expression Value in Render Settings Save Path on Tue, 01 Oct 2024 13:26:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/gemini">@<bdi>Gemini</bdi></a>,</p>
<p dir="auto">Welcome to the Maxon developers forum and its community, it is great to have you with us!</p>
<h4>Getting Started</h4>
<p dir="auto">Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.</p>
<ul>
<li><a href="/forum/topic/15242/">Forum Overview</a>: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.</li>
<li><a href="/forum/topic/15244/">Support Procedures</a>: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.</li>
<li><a href="/forum/topic/15243/">Forum Features</a>: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.</li>
</ul>
<p dir="auto">It is <strong>strongly</strong> recommended to read the first two topics carefully, especially the section <a href="/forum/topic/15244/">Support Procedures: Asking Questions</a>.</p>
<h4>About your First Question</h4>
<p dir="auto">There's no built-in token for this, so you would need to manually parse the document file path for the necessary information (e.g. using regular expressions) and adjust the render settings correspondingly.</p>
<p dir="auto">Depending on the desired behavior you'd like to achieve, the implementation can be slightly different.</p>
<p dir="auto">If you'd like to create custom token, which contains your extracted information, please check the posting from Dunhou (thanks for taking an active role in the community!).</p>
<p dir="auto">In case you'd like to have a script that asjusts the filepath, please have a look at the <a href="https://github.com/PluginCafe/cinema4d_py_sdk_extended/blob/7692ecd3a6f29ba36b614d9b471bb9230b2b0a83/scripts/04_3d_concepts/rendering/render_settings_double_size_r13.py" target="_blank" rel="noopener noreferrer nofollow ugc">render settings example</a>. For the "File" field you'd need to use <a href="https://developers.maxon.net/docs/py/2025_0_0/cinema_resource/base_list/drendersettings.html" target="_blank" rel="noopener noreferrer nofollow ugc">c4d.RDATA_PATH</a> token.</p>
<p dir="auto">Cheers,<br />
Ilia</p>
]]></description><link>http://developers.maxon.net/forum//post/75032</link><guid isPermaLink="true">http://developers.maxon.net/forum//post/75032</guid><dc:creator><![CDATA[i_mazlov]]></dc:creator><pubDate>Tue, 01 Oct 2024 13:26:43 GMT</pubDate></item><item><title><![CDATA[Reply to Add Expression Value in Render Settings Save Path on Mon, 30 Sep 2024 05:42:52 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/gemini">@<bdi>Gemini</bdi></a> ,</p>
<p dir="auto">You should take a look at <a href="https://github.com/PluginCafe/cinema4d_py_sdk_extended/blob/master/plugins/py-render_token_r21/py-render_token_r21.pyp" target="_blank" rel="noopener noreferrer nofollow ugc">py-render-token example</a>,  and filter the version number of your project like <code>re.findall("v"+"\d+",filePath)</code> if I understand not wrong.</p>
<p dir="auto">Cheers~<br />
DunHou</p>
]]></description><link>http://developers.maxon.net/forum//post/75022</link><guid isPermaLink="true">http://developers.maxon.net/forum//post/75022</guid><dc:creator><![CDATA[Dunhou]]></dc:creator><pubDate>Mon, 30 Sep 2024 05:42:52 GMT</pubDate></item></channel></rss>