<?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 Re: Maya Python API Multiple Outputs Not Working in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7906266#M10064</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've looked at the &lt;A href="http://help.autodesk.com/cloudhelp/2018/ENU/Maya-SDK/cpp_ref/class_m_px_node.html#abd7d1dad4e4f0b922bf5ac4fc9c0230a" target="_blank"&gt;setDependentsDirty&lt;/A&gt;. It is different from compute. It works like affectAttribute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e.g. if plugBeingDirtied.partialName() == 'oft' :&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;</description>
    <pubDate>Wed, 04 Apr 2018 01:59:28 GMT</pubDate>
    <dc:creator>cheng_xi_li</dc:creator>
    <dc:date>2018-04-04T01:59:28Z</dc:date>
    <item>
      <title>Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7897851#M10059</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am very new to Python API.&amp;nbsp; I'm trying to create and advanced sine wave node.&amp;nbsp; The way I currently have it set up for the outputs is there is a main overall "outputs" compound attr (not an array), which branches off to several compound attrs ("output1", "output2", etc.), and each of those attributes has x,y,z.&amp;nbsp; The math all seems to be working, but it doesn't apply it to all of the outputs.&amp;nbsp; It just applies all of the values to the main "outputs" attr&amp;nbsp;which sets it to "output1".&amp;nbsp; None of the other output attrs work, but I know the math is correct using print statements.&amp;nbsp; I also have the attributeAffects running so every input affects every output down to the x,y,z.&amp;nbsp; Why is the compute() not setting values for the other outputs?&amp;nbsp; Below is an abbreviated version of the code.&amp;nbsp; I tried using the setDependentsDirty method but it wasn't working.&amp;nbsp; Any help would be greatly appreciated.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def compute(self, plug, dataBlock):&lt;BR /&gt;# sine math execution&lt;BR /&gt;&lt;BR /&gt;if ( dpPlug == sineNode.outputs or (plug.isChild() and plug.parent() == sineNode.outputs )):&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;#&amp;nbsp;math blah blah&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# dataHandle.setFloat( ctrl1X )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;# dataHandle.setFloat( ctrl1Y )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# dataHandle.setFloat( ctrl1Z )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# dataHandle.setFloat( ctrl2X )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# dataHandle.setFloat( ctrl2Y )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# dataHandle.setFloat( ctrl2Z )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;dataBlock.setClean( plug )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 21:51:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7897851#M10059</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-30T21:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7903203#M10060</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you asking that xyz are not set during the compute? You need to get the handle of each child of the plug(x,y,z) and set them separately.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 07:47:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7903203#M10060</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2018-04-03T07:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7904592#M10061</link>
      <description>&lt;P&gt;Thank you for responding!&amp;nbsp; I do have the x,y,z handles, and I have the setFloat() for each dataHandle.&amp;nbsp; The problem is it seems to take all those outputs and combine them all into one and applies it output1, when I need them to also apply to output2, output3, etc.&amp;nbsp; Here is the code I have for the dataHandles:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if ( dpPlug == sineNode.outputs or (plug.isChild() and plug.parent() == sineNode.outputs )):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# I set the inputValue() here and apply asFloat() to them&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ctrl1X = working math&lt;/P&gt;&lt;P&gt;ctrl1Y = working math&lt;/P&gt;&lt;P&gt;ctrl1Z = working math&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;outputsHandle = DataBlock.outputValue( sineNode.outputs )&lt;BR /&gt;output1Handle = outputsHandle.child( sineNode.output1 )&lt;BR /&gt;output1XHandle = output1Handle.child(sineNode.output1x)&lt;BR /&gt;output1YHandle = output1Handle.child(sineNode.output1y)&lt;BR /&gt;output1ZHandle = output1Handle.child(sineNode.output1z)&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output1XHandle.setFloat( ctrl1X )&lt;BR /&gt;output1YHandle.setFloat( ctrl1Y )&lt;BR /&gt;output1ZHandle.setFloat( ctrl1Z )&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dpDataBlock.setClean( plug )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it has something with the dirty propagation.&amp;nbsp; It seems to dirty just the main outputs attribute, but doesn't apply it to the individual output attrs and further into the x,y,z of each output.&amp;nbsp; I thought setDependentsDirty might do it, but that only activates when I manually change and input, and doesn't&amp;nbsp;activate when I hit play on the timeline like I want it to.&amp;nbsp; Thank you and please help!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:10:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7904592#M10061</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-03T15:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7904614#M10062</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Could you send me a sample for reproducing the issue? I could check if there is anything wrong with it.&lt;BR /&gt;&lt;BR /&gt;Yours,&lt;BR /&gt;Li&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:15:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7904614#M10062</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2018-04-03T15:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7904623#M10063</link>
      <description>&lt;P&gt;Also, ignore the "dpPlug" in the if statement, I&amp;nbsp;had&amp;nbsp;changed&amp;nbsp;some of the naming to post this, so that code is working.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:17:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7904623#M10063</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-03T15:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7906266#M10064</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've looked at the &lt;A href="http://help.autodesk.com/cloudhelp/2018/ENU/Maya-SDK/cpp_ref/class_m_px_node.html#abd7d1dad4e4f0b922bf5ac4fc9c0230a" target="_blank"&gt;setDependentsDirty&lt;/A&gt;. It is different from compute. It works like affectAttribute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e.g. if plugBeingDirtied.partialName() == 'oft' :&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 01:59:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7906266#M10064</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2018-04-04T01:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7908213#M10065</link>
      <description>&lt;P&gt;So I've made those changes, but the same problem still arises.&amp;nbsp; Only the first output gets&amp;nbsp;all of the values, so only the first joint rotates.&amp;nbsp; Is there anything else you can see that's missing?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 16:07:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7908213#M10065</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-04T16:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7909387#M10066</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I didn’t spot more errors right now. Would you mind upload your modified code with a sample scene?&lt;BR /&gt;&lt;BR /&gt;P.S. I will be travelling this weekend, I will get back to you next week.&lt;BR /&gt;&lt;BR /&gt;Yours,&lt;BR /&gt;Li&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Apr 2018 00:09:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7909387#M10066</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2018-04-05T00:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7917638#M10067</link>
      <description>&lt;P&gt;I sent you the code in a message, attached is the scene I use to test it.&amp;nbsp; To create the node, use pm.createNode('dpSineNode') in the script editor.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 11:47:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7917638#M10067</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-09T11:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7918001#M10068</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you should get o1,o2,o3 with outputs.child and dirty outputs too. it should look like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;			print "dirtying the other outputs"
			#thisNode = self.thisMObject()
			# o1 = thisNode.dpalSineNode( "output1")
			# o1 = MPlug(thisNode, dpalSineNode.output1)
			outs = fnThisNode.findPlug("outputs")
			o1 = outs.child(0)
			o1x = o1.child(0)
			affectedPlugs.append( o1x )
			o1y = o1.child(1)
			affectedPlugs.append( o1y )
			o1z = o1.child(2)
			affectedPlugs.append( o1z )
			affectedPlugs.append( o1 )
			# o2 = thisNode.dpalSineNode( "output2")
			o2 = outs.child(1)
			o2x = o2.child(0)
			affectedPlugs.append( o2x )
			o2y = o2.child(1)
			affectedPlugs.append( o2y )
			o2z = o2.child(2)
			affectedPlugs.append( o2z )
			affectedPlugs.append( o2 )
			# o3 = thisNode.dpalSineNode( "output3")
			o3 = outs.child(2)
			o3x = o3.child(0)
			affectedPlugs.append( o3x )
			o3y = o3.child(1)
			affectedPlugs.append( o3y )
			o3z = o3.child(2)
			affectedPlugs.append( o3z )
			affectedPlugs.append( o3 )
			affectedPlugs.append(outs)&lt;/PRE&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 13:47:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7918001#M10068</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2018-04-09T13:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Maya Python API Multiple Outputs Not Working</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7922311#M10069</link>
      <description>&lt;P&gt;So I discovered the problem.&amp;nbsp; It was a typo issue on the dataHandle.set.&amp;nbsp; it read dataHandle1.set for all of them.&amp;nbsp; A little embarrassing but it works great now.&amp;nbsp; I did make the changes you suggested for the setDependentsDirty to function better, and thanks again for all of your help!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 19:06:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/maya-python-api-multiple-outputs-not-working/m-p/7922311#M10069</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-10T19:06:41Z</dc:date>
    </item>
  </channel>
</rss>

