-1

Lets say I have a simple cube and a sphere, is their a way I can make the cubes mesh node match that of the sphere in python? Similar to the Modify --> Replace method. I have tried cmds.nodeCast but I dont want to switch them. Just to copy exactly from the other.

maddog95
  • 3
  • 1
  • You've stated your question in terms of hypotheticals, but it's expected that you have tried to solve the problem yourself before asking on Stack Overflow; so if you have code demonstrating what you have tried or what your current implementation looks like, please include it! It will give people an idea of how you've approached the problem and why it might not be working. Additionally, it's always helpful to include a description of what is actually happening alongside your expectations of what the code should do. – Zoey Hewll Apr 23 '20 at 01:53

1 Answers1

1

If you're ok with instances then you can select both objects and run this:

import maya.cmds as cmds

sel = cmds.ls(sl=True)
cmds.connectAttr(sel[0] + ".outMesh", sel[1] + ".inMesh", force=True)
Green Cell
  • 4,677
  • 2
  • 18
  • 49