<?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[Move Tag Position in the Stack?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">How do I move the tag position in stack? For instance, moving the python tag into the farther right.<br />
You can check an illustration of the problem here:<br />
<a href="https://www.dropbox.com/s/k9apte4whn7cqvh/c4d211_move_tag_position.jpg?dl=0" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.dropbox.com/s/k9apte4whn7cqvh/c4d211_move_tag_position.jpg?dl=0</a></p>
<p dir="auto">Thank you</p>
]]></description><link>http://developers.maxon.net/forum/topic/12216/move-tag-position-in-the-stack</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 17:08:25 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/12216.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Jan 2020 13:39:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Move Tag Position in the Stack? on Tue, 28 Jan 2020 14:19:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/r_gigante">@<bdi>r_gigante</bdi></a></p>
<p dir="auto">Gotcha. Thanks for the warning.</p>
]]></description><link>http://developers.maxon.net/forum/post/61289</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/61289</guid><dc:creator><![CDATA[bentraje]]></dc:creator><pubDate>Tue, 28 Jan 2020 14:19:37 GMT</pubDate></item><item><title><![CDATA[Reply to Move Tag Position in the Stack? on Tue, 28 Jan 2020 12:42:24 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/bentraje">@<bdi>bentraje</bdi></a>, thanks for reaching out us.</p>
<p dir="auto">With regard to the solutions offered by <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/lasselauch">@<bdi>lasselauch</bdi></a>  - kudos Lasse - I have to remind that you're both benefiting of a automatism found in the Python implementation of the <a href="https://developers.maxon.net/docs/py/2023_2/modules/c4d/C4DAtom/GeListNode/BaseList2D/BaseObject/index.html?highlight=inserttag#BaseObject.InsertTag" target="_blank" rel="noopener noreferrer nofollow ugc"><code>BaseObject::InsertTag()</code></a>: when the method is called in Python, before inserting the tag, it first gets removed from the previous owner and then is inserted in the new one.<br />
This is very convenient and delivered for free in the Python implementation,  in C++ this is not and this should be took in consideration.</p>
<p dir="auto">Finally, one note about the code design: it could lead to unpredictable results, especially on more complex scenarios, re-ordering a list while iterating on the same list. I would rather suggest iterating on list and operate the reorder on a copy of such list.</p>
<p dir="auto">Cheers, R</p>
]]></description><link>http://developers.maxon.net/forum/post/61288</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/61288</guid><dc:creator><![CDATA[r_gigante]]></dc:creator><pubDate>Tue, 28 Jan 2020 12:42:24 GMT</pubDate></item><item><title><![CDATA[Reply to Move Tag Position in the Stack? on Mon, 27 Jan 2020 17:18:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/lasselauch">@<bdi>lasselauch</bdi></a></p>
<p dir="auto">Thanks for the response. Gave me an idea what code to use.<br />
Here is my working code:</p>
<pre><code>import c4d
from c4d import gui

# Select an object. 
# Hit Execute
# Sets python tag in the right most place

def main():
    tag_list = op.GetTags()
    for tag in tag_list:
        if tag.GetType() == c4d.Tpython: 
            op.InsertTag(tag, tag_list[-1])
            


    c4d.EventAdd()
main()
</code></pre>
]]></description><link>http://developers.maxon.net/forum/post/61271</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/61271</guid><dc:creator><![CDATA[bentraje]]></dc:creator><pubDate>Mon, 27 Jan 2020 17:18:19 GMT</pubDate></item><item><title><![CDATA[Reply to Move Tag Position in the Stack? on Mon, 27 Jan 2020 15:00:47 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/bentraje">@<bdi>bentraje</bdi></a>,</p>
<p dir="auto">I came across this problem some time ago.<br />
Have a look at: <a href="https://www.lasselauch.com/c4d-quicktip-shift-tags/" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.lasselauch.com/c4d-quicktip-shift-tags/</a></p>
<p dir="auto"><img src="https://developers.maxon.net/forum/assets/uploads/files/1580137245009-2018-07-12_11-55-22.gif" alt="2018-07-12_11-55-22.gif" class=" img-fluid img-markdown" /></p>
<pre><code>import c4d
 
def main():
    doc.StartUndo()
    sel = doc.GetActiveTags()
 
    for tag in sel:
        obj = tag.GetMain()
        taglist = obj.GetTags()
 
        for i, t in enumerate(taglist):
            if t in sel:
                index = i+1
                if index == len(taglist):
                    return
                #print """Tag: %s || Index: %s""" % (t.GetName(), i)
                doc.AddUndo(c4d.UNDOTYPE_CHANGE, obj)
                obj.InsertTag(t, taglist[index])
 
    doc.EndUndo()
    c4d.EventAdd()
 
if __name__=='__main__':
    main()
</code></pre>
<p dir="auto">This was essentially my approach, it’s not bulletproof but it works if you want to send multiple tags from one index to the next.</p>
<p dir="auto">Cheers,<br />
Lasse</p>
]]></description><link>http://developers.maxon.net/forum/post/61269</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/61269</guid><dc:creator><![CDATA[lasselauch]]></dc:creator><pubDate>Mon, 27 Jan 2020 15:00:47 GMT</pubDate></item></channel></rss>