Re: [Maya-Python] MayaPy Cython Error

2018-01-23 Thread Robert White
You'd need to build Cython for maya against the proper version of visual 
studio.
Which in 2014 I believe was VS2010. You'll also need to use that version 
when actually compiling your cython project.

On Monday, January 22, 2018 at 9:47:31 PM UTC-6, Justin Israel wrote:
>
> My guess is that the compiled aspects of Cython don't like being loaded 
> into Maya's python. Do you need to build Cython against Maya specifically?
> I use Cython-based projects inside of Maya, but my experience is on Linux. 
> Generally I can just use a standard Cython installation and build with a 
> generally compatible gcc version. 
>
> Justin
>
> On Tue, Jan 23, 2018 at 4:33 PM > wrote:
>
>> Hi Everyone!
>>  I got a issue which beset me in the past few days about how to 
>> compiling pyd file using mayapy.exe.
>>
>> I have tested on Windows10 with both maya2014 and maya2016 sp6, but got 
>> the same error like bellow:
>>
>>"Runtime Error!
>> Program: C:\Program Files\Autodesk\Maya2014\bin\mayapy.exe
>>
>> R6034
>> An application has made an attempt to load the C runtime library 
>> incorrectly.
>> Please contract the application's support team for more information."
>>
>>
>> E:\test\test>mayapy setup.py build_ext --inplace
>> Traceback (most recent call last):
>>   File "setup.py", line 2, in 
>> from Cython.Build import cythonize
>>   File "C:\Program 
>> Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Build\__init__.py", 
>> line 1, in 
>> from .Dependencies import cythonize
>>   File "C:\Program 
>> Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Build\Dependencies.py",
>>  
>> line 59, in 
>> from ..Compiler.Main import Context, CompilationOptions, 
>> default_options
>>   File "C:\Program 
>> Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Compiler\Main.py", 
>> line 28, in 
>> from .Scanning import PyrexScanner, FileSourceDescriptor
>> ImportError: DLL load failed: A dynamic link library (DLL) initialization 
>> routine failed.
>>
>>
>> 
>>
>> This is my simple hello world python script file:
>>
>> def hello():
>> print "Hello World"
>>
>> 
>>
>> This my setup.py file:
>>
>> from distutils.core import setup
>> from distutils.extension import Extension
>> from Cython.Distutils import build_ext
>>
>> setup(
>> cmdclass = {'build_ext': build_ext},
>> ext_modules = [Extension("helloworld", ["helloworld.py"])]
>> )
>>
>> --
>>
>> Btw, i used pip to install Cython under C:\Program 
>> Files\Autodesk\Maya2014\Python\Lib\site-packages.
>>
>>
>> Does anyone face the same issue like me and have any solution about it?
>> Anyone can help?
>> Great thanks for you!!
>>
>> --
>> 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+unsubscr...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/ece1c1e7-3729-4144-8a14-cbdab8d37368%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/b3c4c259-db8f-4d0d-9df1-45bd4cd263f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] compiling PyQt5 and Qt5

2018-01-23 Thread Juan Cristóbal Quesada
Anyone has a guide on how to compile Qt5 for python 3.6? im a newbie so any
helping comments on how to use cmake, etc is highly appreciated!!!

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CANOg8wV-dU4FJZfHsp36cgXhjSvnM7RcJZ255bFuA5RzcW_2mQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Renaming objects using custom name - maya python

2018-01-23 Thread yogayasahardja
Hi, thankyou for inviting me to this group. I've got helped for several 
problems. Thanks to my hero, Justin Israel who invited me. 

I got a camera named something like this (different for each shot)
Shot_Cam

and i want to rename my camera to be same like my scene name. And add my start 
and end frame numbers to my camera name. So it will be something like this : 
PRJ_SH001_SCN001_100_143_TK01 

Is there anyway to do it using maya python? (because I only understand python 
module in maya right now)
Right now I only can get my scene name using cmds.file(query=True,sn=True). And 
cmds.rename('blablabla'). 
 
Any example or clue for it will be appreciated! :) 
Please enlighten me. 

Thanks. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/02190c7e-99f2-4edc-b260-d96d45524de5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] compiling PyQt5 and Qt5

2018-01-23 Thread Marcus Ottosson
Here you go!

http://pyqt.sourceforge.net/Docs/PyQt5/installation.html#building-and-installing-from-source

Seriously though, that's all there is to it. No CMake, just Visual Studio
2015 and Python 3.6.

On 23 January 2018 at 16:18, Juan Cristóbal Quesada <
juan.cristobal...@gmail.com> wrote:

> Anyone has a guide on how to compile Qt5 for python 3.6? im a newbie so
> any helping comments on how to use cmake, etc is highly appreciated!!!
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/CANOg8wV-dU4FJZfHsp36cgXhjSvnM7RcJZ255b
> FuA5RzcW_2mQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAfHJqPu31ECRSSWHdZLyH1OSeENZs88vk5HwvwJzd-OA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Renaming objects using custom name - maya python

2018-01-23 Thread Justin Israel
On Wed, Jan 24, 2018 at 6:28 AM  wrote:

> Hi, thankyou for inviting me to this group. I've got helped for several
> problems. Thanks to my hero, Justin Israel who invited me.
>
> I got a camera named something like this (different for each shot)
> Shot_Cam
>
> and i want to rename my camera to be same like my scene name. And add my
> start and end frame numbers to my camera name. So it will be something like
> this :
> PRJ_SH001_SCN001_100_143_TK01
>
> Is there anyway to do it using maya python? (because I only understand
> python module in maya right now)
> Right now I only can get my scene name using
> cmds.file(query=True,sn=True). And cmds.rename('blablabla').
>
> Any example or clue for it will be appreciated! :)
> Please enlighten me.
>

If you know about cmds.file() and cmds.rename() then you are pretty much
there already. The rest is just string formatting.

import os

cam = 'Shot_Cam'
start = 100
end = 143

sn = cmds.file(query=True, sn=True, shortName=True)
fname = os.path.basename(sn)
name = os.path.splitext(fname)[0]

new_name = '{}_{}_{}'.format(name, start, end)
cmds.rename(cam, new_name)

​

If you start with using the shortName option, you can avoid the extra step
of needing to get the basename of the file. Then you use the os module to
split off the extension. Format your extra criteria and then call rename()


>
> Thanks.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/02190c7e-99f2-4edc-b260-d96d45524de5%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0tAfXTwODe2z9BKayBPR6tAeKhYuksDvjLszaRfnrZaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.