Discussion:
[Maya-Python] pymel.core.nodetypes.Locator class giving a ValueError when instantiated
b***@gmail.com
2018-11-02 22:41:32 UTC
Permalink
I can't seem to find anything about this particular problem on the web.
Basically, If I create a locator in any other way or if I instantiate any other pymel.core.nodetype.* class ( I haven't tried them all obviously ) I incur in no unexpected behavior.
If I, instead, try to create an instance of the pymel.core.nodetypes.Locator class, I incur in the following error :


# Error: line 1: ValueError: file C:\Program Files\Autodesk\Maya2017\Python\lib\site-packages\pymel\core\general.py line 2273: unexpect result locator1 returned by spaceLocator #

Looking at general.py this seems to happen in the node creation when the newly created Maya node can't be correctly found or is not of the correct type.
I'm not sure what is the reason behind this error, but, considering that it only happens when I try to instantiate this particular class ( the product of which works perfectly if created in any other way ), I'm thinking this may actually be a bug.

Does anyone know what exactly may be the reason behind this behavior? Am I doing something wrong and this is to be expected ?
--
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 python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5ce566d7-f511-4d63-aae3-54d4838b92f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert White
2018-11-03 03:00:08 UTC
Permalink
So what seems to be happening is that pymel.core.general.spaceLocator has
been altered to return just a Locator and not a list.
pymel.core.nodetypes.Locator uses pymel.core.general.spaceLocator to
generate the object, and then because it isn't a list (which is what the
generic pymel machinery expects) it throws that error.

So this is definitely a bug.
Post by b***@gmail.com
I can't seem to find anything about this particular problem on the web.
Basically, If I create a locator in any other way or if I instantiate any
other pymel.core.nodetype.* class ( I haven't tried them all obviously ) I
incur in no unexpected behavior.
If I, instead, try to create an instance of the
# Error: line 1: ValueError: file C:\Program
Files\Autodesk\Maya2017\Python\lib\site-packages\pymel\core\general.py line
2273: unexpect result locator1 returned by spaceLocator #
Looking at general.py this seems to happen in the node creation when the
newly created Maya node can't be correctly found or is not of the correct
type.
I'm not sure what is the reason behind this error, but, considering that
it only happens when I try to instantiate this particular class ( the
product of which works perfectly if created in any other way ), I'm
thinking this may actually be a bug.
Does anyone know what exactly may be the reason behind this behavior? Am I
doing something wrong and this is to be expected ?
--
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 python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/47b08964-2700-4b3f-aee7-d72f44e9d042%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert White
2018-11-03 03:02:28 UTC
Permalink
Also, the secondary check, where it tries to see if the nodetype matches
the newly created node also fails, because spaceLocator has created a
transform, and the secondary check is looking for a locator.
Post by Robert White
So what seems to be happening is that pymel.core.general.spaceLocator has
been altered to return just a Locator and not a list.
pymel.core.nodetypes.Locator uses pymel.core.general.spaceLocator to
generate the object, and then because it isn't a list (which is what the
generic pymel machinery expects) it throws that error.
So this is definitely a bug.
Post by b***@gmail.com
I can't seem to find anything about this particular problem on the web.
Basically, If I create a locator in any other way or if I instantiate any
other pymel.core.nodetype.* class ( I haven't tried them all obviously ) I
incur in no unexpected behavior.
If I, instead, try to create an instance of the
# Error: line 1: ValueError: file C:\Program
Files\Autodesk\Maya2017\Python\lib\site-packages\pymel\core\general.py line
2273: unexpect result locator1 returned by spaceLocator #
Looking at general.py this seems to happen in the node creation when the
newly created Maya node can't be correctly found or is not of the correct
type.
I'm not sure what is the reason behind this error, but, considering that
it only happens when I try to instantiate this particular class ( the
product of which works perfectly if created in any other way ), I'm
thinking this may actually be a bug.
Does anyone know what exactly may be the reason behind this behavior? Am
I doing something wrong and this is to be expected ?
--
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 python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/e377be73-1608-497a-bc5b-17f8e3f926a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert White
2018-11-03 03:26:04 UTC
Permalink
Opened a PR for a fix https://github.com/LumaPictures/pymel/pull/415, may
or may not get accepted.
But simple enough if you want to patch it locally.
Post by Robert White
Also, the secondary check, where it tries to see if the nodetype matches
the newly created node also fails, because spaceLocator has created a
transform, and the secondary check is looking for a locator.
Post by Robert White
So what seems to be happening is that pymel.core.general.spaceLocator has
been altered to return just a Locator and not a list.
pymel.core.nodetypes.Locator uses pymel.core.general.spaceLocator to
generate the object, and then because it isn't a list (which is what the
generic pymel machinery expects) it throws that error.
So this is definitely a bug.
Post by b***@gmail.com
I can't seem to find anything about this particular problem on the web.
Basically, If I create a locator in any other way or if I instantiate
any other pymel.core.nodetype.* class ( I haven't tried them all obviously
) I incur in no unexpected behavior.
If I, instead, try to create an instance of the
# Error: line 1: ValueError: file C:\Program
Files\Autodesk\Maya2017\Python\lib\site-packages\pymel\core\general.py line
2273: unexpect result locator1 returned by spaceLocator #
Looking at general.py this seems to happen in the node creation when the
newly created Maya node can't be correctly found or is not of the correct
type.
I'm not sure what is the reason behind this error, but, considering that
it only happens when I try to instantiate this particular class ( the
product of which works perfectly if created in any other way ), I'm
thinking this may actually be a bug.
Does anyone know what exactly may be the reason behind this behavior? Am
I doing something wrong and this is to be expected ?
--
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 python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5e415435-6345-4b2e-977c-6117edc0bce5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
b***@gmail.com
2018-11-03 11:36:18 UTC
Permalink
Thanks a lot for taking the time to check this and notifying the bug.

I will probably try and patch it locally as I will need this functionality working in a few days for the project I'm working on.
--
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 python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c6d2b0f9-c764-4ac2-b82b-c25ee8f74675%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...