Matthew W
Matthew W

Reputation: 23

Maya Python polySeparate error

import maya.cmds as cmds

cmds.polyChipOff(ltz=0.1, kft=False)
cmds.polySeparate()

When running the polySeparate command, I get the error "polySeparate needs exactly 1 polygonal obkect or polygonal faces from one object" despite having a face duplicated and selected.

Total noob here, wondering why this is the case?

Upvotes: 2

Views: 517

Answers (1)

Green Cell
Green Cell

Reputation: 4777

Looks like you need to pass an object to the polySeparate function.

Since you already have a face selected you can use cmds.ls to get the selected object:

import maya.cmds as cmds

cmds.polyChipOff(ltz=0.1, kft=False)
cmds.polySeparate(cmds.ls(sl=True, objectsOnly=True)[0])

Works as expected when testing with new objects.

Upvotes: 2

Related Questions