code-google-com / pymel

Automatically exported from code.google.com/p/pymel
0 stars 0 forks source link

pymel.core.rendering.spotLight() returns a shape node, instead of a transform and a shape #315

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Describe the problem.
Most pymel commands that create Maya nodes return a transform node and a shape 
node. The lights, for example spotLight(), only return the shape node, even 
though the transform is created as usual.

What Version of Maya are you using?
2015

On what operating system? (be as specific as possible and include service
packs, 64bit vs 32bit, etc)
Windows 7 SP1, 64-bit

What Version of PyMEL are you using?
1.0.6

What is the expected output? What do you see instead?
I expected all the creation commands commands to work in a similar way, unless 
there was a reason not to. I expected to be able to create a light and then 
move it using returned transform node.

If possible, provide a few lines of code to reproduce the problem. It helps
us if your code will reproduce the problem from a new scene.
    import pymel.core as pm
    # This doesn't work:
    n = pm.spotLight() # Normally I would put [0] on the end of this line.
    n.coneAngle.set(15)
    n.translateZ.set(3) # AttributeError
    # This is a workaround
    n = pm.spotLight().firstParent2()
    n.coneAngle.set(15)
    n.translateZ.set(3)

Does maya.cmds exhibit the same problem?
Yes, exactly the same. MEL is the same too.

Please provide any additional information below.
All the light commands are like this (spotLight, pointLight, directionalLight 
and ambientLight). I guess it was a conscious decision when someone was 
implementing the commands in MEL but I can't understand why. At this point it 
looks like a bug.

Original issue reported on code.google.com by boons...@gmail.com on 12 Aug 2014 at 7:00

GoogleCodeExporter commented 9 years ago
While pymel does attempt to provide some standardization  to maya cmds, trying 
to correct all inconsistencies of mel / maya.cmds is beyond the scope of the 
project; since the command works, is consistent with the maya.cmds version, and 
would break backwards compatibility, we're going to leave this one as is.

Original comment by elron...@gmail.com on 13 Aug 2014 at 4:06