Re: [Maya-Python] MayaPy Cython Import Error

2017-11-29 Thread Marcus Ottosson
This to me looks like the Cython distributed via pip was compiled for a
different version of Python than the one shipping with Maya. I think the
reason you see the error in the terminal is because the command you ran
makes use of the compiled component of Cython, whereas the import you made
in Maya does not.

I suspect you'll need to do what any compiled library requires, which is to
compile it yourself using the mayapy.

-- 
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/CAFRtmOAhecHSbQ4Gp7O0tcxznYnHXZA31cT2XMNLYTStM2hpKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] MayaPy Cython Import Error

2017-11-29 Thread Ruchit Bhatt


On Thursday, November 30, 2017 at 10:53:44 AM UTC+5:30, Justin Israel wrote:
>
>
>
> It appears that it isn't finding cython in the PYTHONPATH when you are 
> running mayapy. Can you manually confirm the install location of cython? 
> Can you also try something like this (sorry if the syntax is wrong. I dont 
> use windows):
>
> mayapy -c "import cython; print cython"
>
> Presumably if it could find cython on your PYTHONPATH, then it should 
> compile an extension which could then be imported within Maya.
>  
>













I think it's weird  

-- 
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/9219a24d-7145-4a78-9311-649ad36abaf3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] MayaPy Cython Import Error

2017-11-29 Thread Justin Israel
On Thu, Nov 30, 2017 at 6:06 PM Ruchit Bhatt 
wrote:

> Hi,
> How to convert python module to *.pyd using cython ?
>
> I am using Maya 2017 Up 4, And in that i installed cython with below step
>
>> C:\Program Files\Autodesk\Maya2017\bin>mayapy ez_setup.py
>> C:\Program Files\Autodesk\Maya2017\bin>mayapy get-pip.py
>> C:\Program Files\Autodesk\Maya2017\Python\Scripts>pip install setuptools 
>> --upgrade
>> C:\Program Files\Autodesk\Maya2017\Python\Scripts>pip install cython
>>
>>
>
It appears that it isn't finding cython in the PYTHONPATH when you are
running mayapy. Can you manually confirm the install location of cython?
Can you also try something like this (sorry if the syntax is wrong. I dont
use windows):

mayapy -c "import cython; print cython"

Presumably if it could find cython on your PYTHONPATH, then it should
compile an extension which could then be imported within Maya.


> After that i followed this link Hello Cython in Maya
> 
>
> 
> *Setup.py*
>
>   [image: Auto Generated Inline Image 1]]
>
> *Terminal Error*
>
> [image: Auto Generated Inline Image 2]
>
>
> *But works fine in script editor*
>
> [image: Auto Generated Inline Image 3]
>
>
> So how to compile *.py to *.pyd for maya  and make a use in scriptEditor ?
>
> --
> 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/c95137c2-5202-41a1-95d2-c7c1384f9a5e%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/CAPGFgA3cCVVrcPj-73WYkPpJuZVDzq5ry_G5UpQuRQqvSNUYCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] MayaPy Cython Import Error

2017-11-29 Thread Ruchit Bhatt
Hi,
How to convert python module to *.pyd using cython ?

I am using Maya 2017 Up 4, And in that i installed cython with below step

> C:\Program Files\Autodesk\Maya2017\bin>mayapy ez_setup.py
> C:\Program Files\Autodesk\Maya2017\bin>mayapy get-pip.py
> C:\Program Files\Autodesk\Maya2017\Python\Scripts>pip install setuptools 
> --upgrade
> C:\Program Files\Autodesk\Maya2017\Python\Scripts>pip install cython
>
>
After that i followed this link Hello Cython in Maya 



*Setup.py*

  ]

*Terminal Error*



*But works fine in script editor*



So how to compile *.py to *.pyd for maya  and make a use in scriptEditor ?

-- 
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/c95137c2-5202-41a1-95d2-c7c1384f9a5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: Weta Digital hiring DevOps position on my team

2017-11-29 Thread Andres Weber
Always appreciate these, I've forwarded it to some friends.

On Wednesday, November 29, 2017 at 1:46:30 PM UTC-5, Justin Israel wrote:
>
> Hi All,
>
> Sorry to make this a second job post in such a short time but this one is 
> specifically on my own team, at Weta Digital in New Zealand. 
>
> Normally we only hire developers, but we are looking for someone with 
> strong DevOps skills. Sounds like anyone you know, that wants to live in 
> NZ? 
>
> https://careers.wetafx.co.nz/jobs/740
>
> Justin 
>
>
>

-- 
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/69de2158-ba32-483c-b71d-b7cdac515fdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] changing path to references witha callback

2017-11-29 Thread Robert White

MSceneMessage.addCheckFileCallback with kBeforeLoadReferenceCheck should 
get you what you want. 

You'll get a reference to the file object before the reference has been 
loaded, and you should be able to tweak and update the file paths from 
there. 
I've used this in the past to fix issues where some machines were replacing 
environment variables with the full path.


On Wednesday, November 29, 2017 at 11:23:25 AM UTC-6, Michał Frątczak wrote:
>
> Yeah, dirmap is better. If only I could remember how I did it last time :)
> Will use dirmap() from now on, thanks !
>
>
> W dniu 29.11.2017 o 18:12, Mahendra Gangaiwar pisze:
>
> I think better approach here would be make use of "dirmap" command, so you 
> could map Linux to Windows and vice versa.. 
>
> Something like this:
>
> dirmap("//server", "/server");
> dirmap("/server", "//server");
>
> Try running above command, and open file, all references and texture paths 
> should remapped automatically by Maya.
>
> On Wed 29 Nov, 2017, 9:34 PM Michał Frątczak,  > wrote:
>
>> Hi
>>
>> We move maya scenes between linux and windows machines.
>> When linux references a file it uses UNC paths like: 
>> /server/project/file.ext
>> whereas windows needs double slash in front: //server/project/file.ext
>>
>> I have a MSceneMessage.kBeforeSave callback that fixes paths on texture 
>> nodes (ensures leading //).
>> I remember having done similar thing with references too, but I lost the 
>> script and can't recall details... any hints how to change path to 
>> reference ?
>>
>> Here is my texture fixing code:
>>
>> def addFirstSlash(i_str):
>> if i_str[0] == '/' and i_str[1] != '/':
>> return '/' + i_str
>> return i_str
>>
>> def mf_MSceneMessage_BeforeSave_CB(*args, **kwargs):
>> for f in mc.ls(type='file'):
>> mc.setAttr(f + '.ftn', addFirstSlash(mc.getAttr(f + '.ftn')), 
>> type='string')
>>
>> om.MSceneMessage.addCallback(om.MSceneMessage.kBeforeSave, 
>> mf_MSceneMessage_BeforeSave_CB)
>>
>>
>>
>>
>>
>> -- 
>> 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/d2c24e10-41f8-4b90-a05e-38369c42b8f5%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Best, 
>
> -M
> -- 
> 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/CA%2B7MZWtvrU3JSdZQ3v9PJTGu7QE27K9RCD2n1CwTYhK%2BZchL6A%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/fe883a81-17dd-465f-8023-3294641fb230%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] changing path to references witha callback

2017-11-29 Thread Mahendra Gangaiwar
I think better approach here would be make use of "dirmap" command, so you
could map Linux to Windows and vice versa..

Something like this:

dirmap("//server", "/server");
dirmap("/server", "//server");

Try running above command, and open file, all references and texture paths
should remapped automatically by Maya.

On Wed 29 Nov, 2017, 9:34 PM Michał Frątczak,  wrote:

> Hi
>
> We move maya scenes between linux and windows machines.
> When linux references a file it uses UNC paths like:
> /server/project/file.ext
> whereas windows needs double slash in front: //server/project/file.ext
>
> I have a MSceneMessage.kBeforeSave callback that fixes paths on texture
> nodes (ensures leading //).
> I remember having done similar thing with references too, but I lost the
> script and can't recall details... any hints how to change path to
> reference ?
>
> Here is my texture fixing code:
>
> def addFirstSlash(i_str):
> if i_str[0] == '/' and i_str[1] != '/':
> return '/' + i_str
> return i_str
>
> def mf_MSceneMessage_BeforeSave_CB(*args, **kwargs):
> for f in mc.ls(type='file'):
> mc.setAttr(f + '.ftn', addFirstSlash(mc.getAttr(f + '.ftn')), type
> ='string')
>
> om.MSceneMessage.addCallback(om.MSceneMessage.kBeforeSave,
> mf_MSceneMessage_BeforeSave_CB)
>
>
>
>
>
> --
> 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/d2c24e10-41f8-4b90-a05e-38369c42b8f5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Best,

-M

-- 
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/CA%2B7MZWtvrU3JSdZQ3v9PJTGu7QE27K9RCD2n1CwTYhK%2BZchL6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] changing path to references witha callback

2017-11-29 Thread Michał Frątczak
Hi

We move maya scenes between linux and windows machines.
When linux references a file it uses UNC paths like: 
/server/project/file.ext
whereas windows needs double slash in front: //server/project/file.ext

I have a MSceneMessage.kBeforeSave callback that fixes paths on texture 
nodes (ensures leading //).
I remember having done similar thing with references too, but I lost the 
script and can't recall details... any hints how to change path to 
reference ?

Here is my texture fixing code:

def addFirstSlash(i_str):
if i_str[0] == '/' and i_str[1] != '/':
return '/' + i_str
return i_str

def mf_MSceneMessage_BeforeSave_CB(*args, **kwargs):
for f in mc.ls(type='file'):
mc.setAttr(f + '.ftn', addFirstSlash(mc.getAttr(f + '.ftn')), type=
'string')

om.MSceneMessage.addCallback(om.MSceneMessage.kBeforeSave, 
mf_MSceneMessage_BeforeSave_CB)





-- 
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/d2c24e10-41f8-4b90-a05e-38369c42b8f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.