Heavy curve - lots of curve shapes (takes an age to select and edit)


#1

Hi all,

Anyone work with heavy detailed curves much in maya? I need a bit of advice.

I’ve been given a floor layout as a curve from another piece of software (see image below), when i go to select it, it takes about 40 seconds to actually select the curve.
The attribute editor has a large amount of curve shapes.

I was hoping to render the curve with Arnold but would be a bit tedious to go through each shape in the attribute editor and assign a flat curve shader to it. Anyone have any ideas on a better approach? Thanks :slight_smile:


#2

You can assign materials with the script. Try Curve Editor of Asset Manager for that task.
Or select curve shapes and run Python script:


import pymel.core as pm
# Asign SHADER to CURVES
# select curves, SHIFT select shader, run
def shaderAsign():
    sel = pm.ls( sl=1 )
    mat = sel.pop( -1 ) 
    for i in sel:
        if i.nodeType() == 'transform':
            i = i.getShape()
        mat.outColor >> i.aiCurveShader
        
shaderAsign()


#3

Hi kiryha, thanks for the suggestion, I can’t seem to get the script to work, I get this error returned:

shaderAsign()

Error: NameError: file <maya console> line 4: global name ‘pm’ is not defined

–//

Maybe there is another solution, as you can see in my example below, I have too many curve shapes under this one curve. I’ve tried using the Curves>> attach tool but I end up with too many edges getting bridged across the original shape.

Maybe i’ll just have to re-trace over all the curve shapes with a simpler design. Another thing I could do is to just render a matte and adjust a flat colour in after effects afterwards… hmm.


#4

Try to add this line of code on very top of the script:


import pymel.core as pm

if above doesn’t work then:


import maya.cmds as pm

I am not sure if he used Pymel of Python and what is exact difference but one of those should work with the code i think.


#5

Pymel, the first one is correct.


#6

Thanks all :slight_smile: