Xgen: Guides to Curves with Python

Xgen: Guides to Curves with Python

Anonymous
Not applicable
1,672 Views
3 Replies
Message 1 of 4

Xgen: Guides to Curves with Python

Anonymous
Not applicable

Hello there!

 

Does anyone know of a way to convert all the guide curves from a spline based description into Maya curves using script?

 

I was able to use the following code to do it, 

 

pm.mel.xgmGuidesToCurvesToolCreate()

 

but it only works when user toggles on the "Guides to Curves" in the utility tab. Otherwise it gave me an error saying:

// Error: file: C:/Program Files/Autodesk/Maya2018/plug-ins/xgen/scripts/xgmGuidesToCurvesTool.mel line 72: Object 'xgmGuidesToCurvesToolGuideStat' not found. //

 

If anyone can help me out that would be great!

 

Thanks!

0 Likes
1,673 Views
3 Replies
Replies (3)
Message 2 of 4

joshua_e_mock
Contributor
Contributor

I'm curious if you ever found a solution to this problem. I'm having the same issue.

0 Likes
Message 3 of 4

sujantuladhar1
Observer
Observer

import maya.cmds as cmds
import xgenm as xg
import xgenm.xgGlobal as xgg

if xgg.Maya:

palettes = xg.palettes()
for palette in palettes:

descriptions = xg.descriptions(palette)
for description in descriptions:
print " Description:" + description
guidesName = xg.descriptionGuides(description)
print guidesName
cmds.select(guidesName, r = True)
mel.eval('xgmCreateCurvesFromGuidesOption(0, 0, "%s")' % (description+"_Curves"))

Message 4 of 4

joshua_e_mock
Contributor
Contributor

This worked perfectly! Thanks!