<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Renaming a node with Python in Bifrost Forum</title>
    <link>https://forums.autodesk.com/t5/bifrost-forum/renaming-a-node-with-python/m-p/9638417#M6416</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm testing out if we can fit Bifrost in certain parts of our pipeline and got into scripting a graph. I did run into a problem when trying to rename a node though. It looks like Bifrost acts like Maya, in the sense that if you try to name a node to something that already has the same name, it will automatically increment the name by 1. This is fine and I'm very used to it in cmds, but in cmds it returns the result, while it looks like Bifrost's cmds.vnnCompound(renameNode) returns nothing at all. This is an issue because if the node I'm trying to rename has a conflict I'll suddenly lose reference to the node!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there some workaround to get its real name in case of a conflict? Ideally cmds.vnnCompound would also have a name parameter that you can set right off the bat, just like cmds.createNode.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jul 2020 07:48:42 GMT</pubDate>
    <dc:creator>labbejason</dc:creator>
    <dc:date>2020-07-16T07:48:42Z</dc:date>
    <item>
      <title>Renaming a node with Python</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/renaming-a-node-with-python/m-p/9638417#M6416</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm testing out if we can fit Bifrost in certain parts of our pipeline and got into scripting a graph. I did run into a problem when trying to rename a node though. It looks like Bifrost acts like Maya, in the sense that if you try to name a node to something that already has the same name, it will automatically increment the name by 1. This is fine and I'm very used to it in cmds, but in cmds it returns the result, while it looks like Bifrost's cmds.vnnCompound(renameNode) returns nothing at all. This is an issue because if the node I'm trying to rename has a conflict I'll suddenly lose reference to the node!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there some workaround to get its real name in case of a conflict? Ideally cmds.vnnCompound would also have a name parameter that you can set right off the bat, just like cmds.createNode.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 07:48:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/renaming-a-node-with-python/m-p/9638417#M6416</guid>
      <dc:creator>labbejason</dc:creator>
      <dc:date>2020-07-16T07:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a node with Python</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/renaming-a-node-with-python/m-p/9638458#M6417</link>
      <description>&lt;P&gt;This is the best I have so far, but quite the overkill &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Would love to hear if there's a better solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;node = cmds.vnnCompound(graph, "/", addIONode=True)[0]  # Create node.
graph_nodes = cmds.vnnCompound(graph, "/", listNodes=True)  # List all nodes in graph.
graph_nodes.pop(graph_nodes.index(node))  # Remove new node from the list.
cmds.vnnCompound(graph, "/", renameNode=(a, "NEW"))  # Rename it.
new_graph_nodes = cmds.vnnCompound(graph, "/", listNodes=True)  # Re-list all nodes in graph.
node = next(iter(set(new_graph_nodes).difference(graph_nodes)))  # Re-assign value to the one new node.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 08:07:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/renaming-a-node-with-python/m-p/9638458#M6417</guid>
      <dc:creator>labbejason</dc:creator>
      <dc:date>2020-07-16T08:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a node with Python</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/renaming-a-node-with-python/m-p/9639116#M6418</link>
      <description>&lt;P&gt;Hi Jason,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's indeed a known issue and it's logged as&amp;nbsp;BIFROST-1648 so you can look out for it in future release notes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your solution looks like the kind of workaround I'd suggest except your Python is nicer. (I like that last line, readable and compact).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 14:04:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/renaming-a-node-with-python/m-p/9639116#M6418</guid>
      <dc:creator>jonah.friedman</dc:creator>
      <dc:date>2020-07-16T14:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming a node with Python</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/renaming-a-node-with-python/m-p/9639531#M6419</link>
      <description>&lt;P&gt;Gotcha, thanks Jonah, I'll keep on eye out on the release notes for future updates!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 16:35:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/renaming-a-node-with-python/m-p/9639531#M6419</guid>
      <dc:creator>labbejason</dc:creator>
      <dc:date>2020-07-16T16:35:42Z</dc:date>
    </item>
  </channel>
</rss>

