Missing command documentation and inability to install any python package

Missing command documentation and inability to install any python package

someone47456516
Explorer Explorer
415 Views
1 Reply
Message 1 of 2

Missing command documentation and inability to install any python package

someone47456516
Explorer
Explorer

I am trying to find intersections between multiple curves,
it can be done in by selecting all the curves and using intersect(curve) tool, the command returned by the console is
"intersectCrvPreset", which has no documentation and no python equivalent, and because i am using python and i need the python version since i need the return of the function.
I tried to use mc.mel.eval("....") but the return is None, not much help when i can see the intersections in the scene, but can't get the xyz positions.

 

 

Next problem i have at the same time is that i can't install any packages, if i use pip install name, it said at the beginning that pip isn't recognized, so i used ensurepip to install it, and it got me the version 7.1 or so, that wouldn't be an issue if i could install what i want, but instead i get an error

 

C:\Programy\Graphics\3d\Maya2020\bin>mayapy -m pip install --upgrade pi
p
Collecting pip
Using cached https://files.pythonhosted.org/packages/a3/50/c4d2727b99052780aad
92c7297465af5fe6eec2dbae490aa9763273ffdc1/pip-22.3.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "c:\users\2017\appdata\local\temp\pip-build-xdkuob\pip\setup.py", lin
e 7
def read(rel_path: str) -> str:
^
SyntaxError: invalid syntax

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\2017\app
data\local\temp\pip-build-xdkuob\pip
You are using pip version 7.1.2, however version 22.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

C:\Programy\Graphics\3d\Maya2020\bin>

 

If i install new pip in my standard Python, and then move from site-packages to Maya site-packages folder, and remove the old pip, it will say this

 

C:\Programy\Graphics\3d\Maya2020\Maya2020\bin>mayapy -m pip install scipy
Traceback (most recent call last):
File "C:\Programy\Graphics\3d\Maya2020\bin\python27.zip\runpy.py", li
ne 151, in _run_module_as_main
File "C:\Programy\Graphics\3d\Maya2020\bin\python27.zip\runpy.py", li
ne 109, in _get_module_details
File "C:\Programy\Graphics\3d\Maya2020\bin\python27.zip\runpy.py", li
ne 101, in _get_module_details
File "C:\Programy\Graphics\3d\Maya2020\bin\python27.zip\pkgutil.py",
line 464, in get_loader
File "C:\Programy\Graphics\3d\Maya2020\bin\python27.zip\pkgutil.py",
line 474, in find_loader
File "C:\Programy\Graphics\3d\Maya2020\bin\python27.zip\pkgutil.py",
line 430, in iter_importers
File "C:\Programy\Graphics\3d\Maya2020\Python\lib\site-packages\pip\_
_init__.py", line 6
def main(args: Optional[List[str]] = None) -> int:
^
SyntaxError: invalid syntax

C:\Programy\Graphics\3d\Maya2020\Maya2020\bin>


Either way it doesn't work, i tried to look it up for a few hours but no one knows anything, i am not wasting more time on randomness.

 

416 Views
1 Reply
Reply (1)
Message 2 of 2

RFlannery1
Collaborator
Collaborator

To get more information about an unknown command, my first step is always to use the "whatIs" command.  This command is only available in MEL.  So in this case, I would run:

whatIs intersectCrvPreset;

This gives the result:

// Result: Script found in: C:/Program Files/Autodesk/Maya2022/scripts/others/intersectCrvPreset.mel //

Then I would go find the listed file and open it in a text editor.  (Do NOT edit this file.  This is one of Maya's internal files, and editing it can break stuff.)  In the file you can see the code for the function.

Some notes about the code in this file:

  • The code is all in MEL, so if you want a Python version, you will need to translate it yourself.
  • The "intersectCrvPreset" function calls other MEL functions, like "findAllIntersections".  So you may end up needing to translate those functions to Python, too.
  • You can get away with not translating every single line of MEL code.  Often Maya's MEL function include a lot of options.  For example, the "intersectCrvPreset" function has a parameter for "$useDirection" that can have values from 0 to 6.  In the body of the code, there are some if-else blocks based on the value of that variable.  If you know you only want to use value 0, then you can skip the code for the rest of the values.

 

0 Likes