Even better, since I'm not treating the data from the active and passive 
handles, I could just set the output using setMObject() with the data from 
the input handle:

for m_id in range(multi_output_length):
 multi_output_handle.jumpToLogicalElement(m_id)
 output_handle = multi_output_handle.outputValue()

 if m_id == selector_value:
 use_handle = active_handle
 else:
 use_handle = passive_handle

 output_handle.setMObject(use_handle.data())



On Tuesday, April 14, 2020 at 5:07:05 PM UTC+2, Peter Jemstedt wrote:
>
> Hello everyone!
>
> I'm trying to create my first custom MpxNode for Maya, and the node keeps 
> crashing on me.
> The node takes two inputs and has an integer attribute.
> The integer attribute selects which output should take the first input, 
> all the other outputs will take the second input. Basically, it's a node 
> that would toggle (for example visibility) on one out of many objects, 
> while off on any other.
>
> Now, I also wanted the node to be more flexible, so you could toggle other 
> types of attributes, like, one object gets a certain vector or color or 
> whatever.
> So the two inputs and the output are generic attributes.
>
> Using Api 2.0, cuz it feels right, if that could be anything.
>
> My code as it lewks right now:
> https://pastebin.ubuntu.com/p/xbCwP85dk6/
>
> With some debuggy prints, I've noticed it can parse the whole compute 
> function without crashing, it's after that it just crashes, no errors.
>
> /Peter
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/4ecdb0e9-8b2d-43c7-b655-768f0fa68eaf%40googlegroups.com.

Reply via email to