Hi I am newbie  and I cannot figure out how to avoid Empty Projection Curve 
results from being created:

----- [CODE ON]

import maya.cmds as cm

def my_import():
    returnedNodes = cm.file('C:/.../iPOD021.obj', i = True, type = "OBJ", 
rnn=True, ignoreVersion = True, loadReferenceDepth  = "all")
    
    return returnedNodes


def projectSec(srfs):
    section_curves=[]
    
    #create a set of lines to project
    for i in range(1,12):
        line = mc.curve(p=[(-10,i,0),(10,i,0)], d=1)

        #projects this line onto every surface in the imported file
        for srf in srfs:
            section_curves.append(mc.projectCurve(crv, srf, d=[0,0,1]))
            print section_curves[-1]
        

nodes = my_import()
projectSec(nodes)

----- [CODE OFF]

in the console I receive similar messages:

[u'surface12->projectionCurve7', u'projectCurve7']
# Warning: You have an empty result since history is on. You may want to undo 
the last command. # 
[u'surface13->projectionCurve8', u'projectCurve8']
# Warning: You have an empty result since history is on. You may want to undo 
the last command. # 
[u'surface13->projectionCurve9', u'projectCurve9']
[u'surface14->projectionCurve10', u'projectCurve10']
[u'surface14->projectionCurve11', u'projectCurve11']
[u'surface15->projectionCurve12', u'projectCurve12']


How can i avoid the curves that receive a warning (because the surface was not 
meeting any curve projection) to go in section_curve[]?


Many Thanks in advance!

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/f2662ab3-b253-4a64-81c3-67dd9976ca52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to