Re: [Maya-Python] with open() fails if the path is passed as argument, but works if I passed as variable

2023-06-09 Thread Rudi Hammad
ahhh , yes. That 's it. 
Thanks Marcus. At some point in my code I was storing data using the path 
using json.dumps(thePath), when I stored directly thePath everything went 
okey.
Cheers
El viernes, 9 de junio de 2023 a las 16:57:49 UTC+2, Marcus Ottosson 
escribió:

> Also copy/pasted the question into ChatGPT out of curiosity and got a 
> similar response.
> --
>
> The issue you are encountering seems to be related to the formatting of 
> the file path string. It appears that the filePath parameter you are 
> passing to the saveTreeDataToFile function includes double quotes (“) 
> around the path, resulting in the error you’re experiencing.
>
> The error message you provided, OSError: [Errno 22] Invalid argument: 
> ‘“D:/CHIMERA STUDIO/CHIMERA CGI/workspace/cfg_data.json”‘, indicates that 
> the path is being treated as an invalid argument due to the presence of the 
> double quotes.
>
> To resolve this issue, you should pass the file path without the double 
> quotes. If you are calling the saveTreeDataToFile function with the 
> filePath parameter in quotes like this:
>
> saveTreeDataToFile('"D:/CHIMERA STUDIO/CHIMERA CGI/workspace/cfg_data.json"', 
> treeWidget)
>
> You can modify the function call to remove the quotes:
>
> saveTreeDataToFile("D:/CHIMERA STUDIO/CHIMERA CGI/workspace/cfg_data.json", 
> treeWidget)
>
> By removing the double quotes, the file path should be passed correctly, 
> and the function should work as expected.
>
> On Fri, 9 Jun 2023 at 15:54, Marcus Ottosson  wrote:
>
>> Possibly unicode related, try print(repr(filePath)) and 
>> print(type(filePath)). Strings coming out of Qt is often unicode.
>>
>> Second possible cause is that there are “ included in the path, notice 
>> the triple ‘ on the invalid argument warning.
>>
>> On Fri, 9 Jun 2023 at 15:41, Rudi Hammad  wrote:
>>
>>> hi, 
>>> okey let me explain with an example which will be faster. It is a small 
>>> code so I'll just past it here. I have the function:
>>>
>>> def saveTreeDataToFile(filePath, treeWidget):
>>> treeData = json.loads(serializeTree(treeWidget))
>>> print(filePath) # Result: "D:/CHIMERA STUDIO/CHIMERA 
>>> CGI/workspace/cfg_data.json"
>>> 
>>> with open(filePath, mode="w") as f:
>>> json.dump(treeData, f, indent=4)
>>>
>>> I printed the file path just to check which is "D:/CHIMERA 
>>> STUDIO/CHIMERA CGI/workspace/cfg_data.json". So there is no back slash 
>>> issue or anything. I get the following error:
>>>
>>> # OSError: [Errno 22] Invalid argument: '"D:/CHIMERA STUDIO/CHIMERA 
>>> CGI/workspace/cfg_data.json"'
>>>
>>>
>>> however, if override manually filePath with the result that what was 
>>> printed like so:
>>>
>>> def saveTreeDataToFile(filePath, treeWidget):
>>> treeData = json.loads(serializeTree(treeWidget))
>>> filePath = "D:/CHIMERA STUDIO/CHIMERA CGI/workspace/cfg_data.json"
>>> with open(filePath, mode="w") as f:
>>> json.dump(treeData, f, indent=4)
>>>
>>> ...everything works fine. How is this possible? If it is a formatting 
>>> issue I don't see it. 
>>> Any idea what is happening ?
>>>
>>> thanks,
>>> R
>>>
>>> -- 
>>> 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_m...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/4eae1d5e-791d-4afc-bea0-489ec135b057n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/python_inside_maya/4eae1d5e-791d-4afc-bea0-489ec135b057n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/eb8e2700-a9da-4db2-92dd-c8cc04be98c8n%40googlegroups.com.


[Maya-Python] with open() fails if the path is passed as argument, but works if I passed as variable

2023-06-09 Thread Rudi Hammad
hi, 
okey let me explain with an example which will be faster. It is a small 
code so I'll just past it here. I have the function:

def saveTreeDataToFile(filePath, treeWidget):
treeData = json.loads(serializeTree(treeWidget))
print(filePath) # Result: "D:/CHIMERA STUDIO/CHIMERA 
CGI/workspace/cfg_data.json"

with open(filePath, mode="w") as f:
json.dump(treeData, f, indent=4)

I printed the file path just to check which is "D:/CHIMERA STUDIO/CHIMERA 
CGI/workspace/cfg_data.json". So there is no back slash issue or anything. 
I get the following error:

# OSError: [Errno 22] Invalid argument: '"D:/CHIMERA STUDIO/CHIMERA 
CGI/workspace/cfg_data.json"'


however, if override manually filePath with the result that what was 
printed like so:

def saveTreeDataToFile(filePath, treeWidget):
treeData = json.loads(serializeTree(treeWidget))
filePath = "D:/CHIMERA STUDIO/CHIMERA CGI/workspace/cfg_data.json"
with open(filePath, mode="w") as f:
json.dump(treeData, f, indent=4)

...everything works fine. How is this possible? If it is a formatting issue 
I don't see it. 
Any idea what is happening ?

thanks,
R

-- 
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/4eae1d5e-791d-4afc-bea0-489ec135b057n%40googlegroups.com.


[Maya-Python] best way to check you plugin speed

2023-05-18 Thread Rudi Hammad
Hello,

using maya's profiler is good to check the nodes speed but I was wondering 
which method you use to check the speed within your plugins.
I was thinking about using std::chrono to time the timelaps between the 
beginning and the end of the compute method. Or Python's timing libraries 
if you are in python.
Is this correct or is there a more "profesional way"?

thanks,
R

-- 
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/2c51fbb0-e2f5-4351-8863-1ffbb650b03dn%40googlegroups.com.


Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2023-05-05 Thread Rudi Hammad
jesus yep, that was itI definitely need new glasses.  Thanks.
The plugin compiled alright.

So now I guess I will have to install a virtual machine on windows to 
emulate mac and run this same code to compile for that platform.


El viernes, 5 de mayo de 2023 a las 13:02:44 UTC+2, Justin Israel escribió:

> I just noticed something from your first email. Your screenshot shows that 
> your directory is named "cgmake" but you are setting your module path as if 
> it were called "cgcmake" (like Chad's original repo). Is that the cause of 
> this whole problem? If so, then you should fix the dir name (or the module 
> path you are setting) and go back to using
> find_package(Maya REQUIRED) 
> It should discover FindMaya.cmake if your module path matches what really 
> exists on disk. 
>
> On Fri, 5 May 2023, 10:50 pm Rudi Hammad,  wrote:
>
>> I switched because apparently I can't read properly...my bad. Now I am 
>> using this:
>> set(CMAKE_FIND_DEBUG_MODE TRUE)
>> find_package("Maya")
>> set(CMAKE_FIND_DEBUG_MODE FALSE)
>>
>>  The output is https://pastebin.com/5gc1q8Jr
>>
>> ( I was checking again Chad videos again and if I understood properly, 
>> when CMake runs find_package("Maya")  what it does is looking for the word 
>> "Find" + the input in between () , so Maya + .cmake.
>> That a bit weird, why not just ind_package("FindMaya")? )
>>
>>
>> I also tried this find_path() (I  think I am using it right):
>> set(CMAKE_FIND_DEBUG_MODE TRUE)
>> find_path(cache "FindMaya.cmake" ${CMAKE_MODULE_PATH})
>> set(CMAKE_FIND_DEBUG_MODE FALSE)
>>
>> The output is https://pastebin.com/nxHyd8dr
>> El viernes, 5 de mayo de 2023 a las 9:08:09 UTC+2, Justin Israel escribió:
>>
>>>
>>>
>>> On Fri, 5 May 2023, 6:46 pm Rudi Hammad,  wrote:
>>>
>>>> This is is my src/CMakeLists.txt
>>>> https://pastebin.com/EFvNdt9z
>>>> here is the entire output
>>>> https://pastebin.com/WEmMFGr0
>>>>
>>>
>>>
>>> I'm still wondering why you switched from find_package to find_program. 
>>> My cmake skills are not strong but I thought the latter was for finding the 
>>> full path to an executable? 
>>>
>>>
>>>>
>>>>
>>>> El viernes, 5 de mayo de 2023 a las 8:02:25 UTC+2, Justin Israel 
>>>> escribió:
>>>>
>>>>>
>>>>>
>>>>> On Fri, 5 May 2023, 5:05 pm Rudi Hammad,  wrote:
>>>>>
>>>>>> Not sure If I am using  find_program  right.
>>>>>
>>>>>
>>>>> I thought you were previously trying to test the behavior of 
>>>>> find_package. Did that not seem like the right thing to discover 
>>>>> FindMaya.cmake? What was the outcome of the debug output? 
>>>>>
>>>>> The signature says find_program ( name1 [path1 path2 ...]) . 
>>>>>> This what I added 
>>>>>> set(CMAKE_FIND_DEBUG_MODE TRUE)
>>>>>> find_program(cache "FindMaya.cmake" ${CMAKE_MODULE_PATH})
>>>>>> set(CMAKE_FIND_DEBUG_MODE FALSE)
>>>>>>
>>>>>> The console prints out a bunch of paths. The ones at the end are:
>>>>>> C:/Users/rudi hammad/Desktop/testCMake/testingCMake/cgcmake/modules/
>>>>>> FindMaya.cmake.com
>>>>>> C:/Users/rudi 
>>>>>> hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake.exe
>>>>>> C:/Users/rudi 
>>>>>> hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake
>>>>>>
>>>>>>
>>>>>> El jueves, 4 de mayo de 2023 a las 21:50:59 UTC+2, Justin Israel 
>>>>>> escribió:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Fri, 5 May 2023, 5:44 am Rudi Hammad,  wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>> since I have time now  I wanted to revive this topic because I have 
>>>>>>>> to make it work for future project.
>>>>>>>> I am trying to track the error, so I added this the code below 
>>>>>>>> before the error happening with  find_package(Maya REQUIRED) 
>>>>>>>> message ("---")
>>>>>>>> mes

Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2023-05-05 Thread Rudi Hammad
I switched because apparently I can't read properly...my bad. Now I am 
using this:
set(CMAKE_FIND_DEBUG_MODE TRUE)
find_package("Maya")
set(CMAKE_FIND_DEBUG_MODE FALSE)

 The output is https://pastebin.com/5gc1q8Jr

( I was checking again Chad videos again and if I understood properly, when 
CMake runs find_package("Maya")  what it does is looking for the word 
"Find" + the input in between () , so Maya + .cmake.
That a bit weird, why not just ind_package("FindMaya")? )


I also tried this find_path() (I  think I am using it right):
set(CMAKE_FIND_DEBUG_MODE TRUE)
find_path(cache "FindMaya.cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_FIND_DEBUG_MODE FALSE)

The output is https://pastebin.com/nxHyd8dr
El viernes, 5 de mayo de 2023 a las 9:08:09 UTC+2, Justin Israel escribió:

>
>
> On Fri, 5 May 2023, 6:46 pm Rudi Hammad,  wrote:
>
>> This is is my src/CMakeLists.txt
>> https://pastebin.com/EFvNdt9z
>> here is the entire output
>> https://pastebin.com/WEmMFGr0
>>
>
>
> I'm still wondering why you switched from find_package to find_program. My 
> cmake skills are not strong but I thought the latter was for finding the 
> full path to an executable? 
>
>
>>
>>
>> El viernes, 5 de mayo de 2023 a las 8:02:25 UTC+2, Justin Israel escribió:
>>
>>>
>>>
>>> On Fri, 5 May 2023, 5:05 pm Rudi Hammad,  wrote:
>>>
>>>> Not sure If I am using  find_program  right.
>>>
>>>
>>> I thought you were previously trying to test the behavior of 
>>> find_package. Did that not seem like the right thing to discover 
>>> FindMaya.cmake? What was the outcome of the debug output? 
>>>
>>> The signature says find_program ( name1 [path1 path2 ...]) . This 
>>>> what I added 
>>>> set(CMAKE_FIND_DEBUG_MODE TRUE)
>>>> find_program(cache "FindMaya.cmake" ${CMAKE_MODULE_PATH})
>>>> set(CMAKE_FIND_DEBUG_MODE FALSE)
>>>>
>>>> The console prints out a bunch of paths. The ones at the end are:
>>>> C:/Users/rudi hammad/Desktop/testCMake/testingCMake/cgcmake/modules/
>>>> FindMaya.cmake.com
>>>> C:/Users/rudi 
>>>> hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake.exe
>>>> C:/Users/rudi 
>>>> hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake
>>>>
>>>>
>>>> El jueves, 4 de mayo de 2023 a las 21:50:59 UTC+2, Justin Israel 
>>>> escribió:
>>>>
>>>>>
>>>>>
>>>>> On Fri, 5 May 2023, 5:44 am Rudi Hammad,  wrote:
>>>>>
>>>>>>
>>>>>> Hello,
>>>>>> since I have time now  I wanted to revive this topic because I have 
>>>>>> to make it work for future project.
>>>>>> I am trying to track the error, so I added this the code below before 
>>>>>> the error happening with  find_package(Maya REQUIRED) 
>>>>>> message ("---")
>>>>>> message (${CMAKE_MODULE_PATH})
>>>>>> message ("---")
>>>>>> So  I wanted to make sure CMAKE_MODULE_PATH is right. As you can see 
>>>>>> in the image the path is correct and it contains FinMaya.cmake. And 
>>>>>> still, 
>>>>>> it says I am not providing it. I am really stuck because all looks okey 
>>>>>> doesn't it?
>>>>>>
>>>>>
>>>>> Could you try this, to debug the module search path? 
>>>>> https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_DEBUG_MODE.html
>>>>>
>>>>>
>>>>> [image: Capture.JPG]
>>>>>> El sábado, 1 de enero de 2022 a las 20:59:55 UTC+1, Justin Israel 
>>>>>> escribió:
>>>>>>
>>>>>>> On Sun, Jan 2, 2022 at 7:10 AM Rudi Hammad  
>>>>>>> wrote:
>>>>>>>
>>>>>>>> So I followed Chad Vernom's cmake tutorials on youtube. First I 
>>>>>>>> wrote a everything as he did, and when it came do the build from the 
>>>>>>>> command promp I got an error related to maya path or something, so I 
>>>>>>>> thought
>>>>>>>> F###k that, I'll just copy his repo from github, since I barely 
>>>>>>>> understand CMake syntax and I might have done plenty of e

Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2023-05-04 Thread Rudi Hammad
This is is my src/CMakeLists.txt
https://pastebin.com/EFvNdt9z
here is the entire output
https://pastebin.com/WEmMFGr0


El viernes, 5 de mayo de 2023 a las 8:02:25 UTC+2, Justin Israel escribió:

>
>
> On Fri, 5 May 2023, 5:05 pm Rudi Hammad,  wrote:
>
>> Not sure If I am using  find_program  right.
>
>
> I thought you were previously trying to test the behavior of find_package. 
> Did that not seem like the right thing to discover FindMaya.cmake? What was 
> the outcome of the debug output? 
>
> The signature says find_program ( name1 [path1 path2 ...]) . This 
>> what I added 
>> set(CMAKE_FIND_DEBUG_MODE TRUE)
>> find_program(cache "FindMaya.cmake" ${CMAKE_MODULE_PATH})
>> set(CMAKE_FIND_DEBUG_MODE FALSE)
>>
>> The console prints out a bunch of paths. The ones at the end are:
>> C:/Users/rudi hammad/Desktop/testCMake/testingCMake/cgcmake/modules/
>> FindMaya.cmake.com
>> C:/Users/rudi 
>> hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake.exe
>> C:/Users/rudi 
>> hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake
>>
>>
>> El jueves, 4 de mayo de 2023 a las 21:50:59 UTC+2, Justin Israel escribió:
>>
>>>
>>>
>>> On Fri, 5 May 2023, 5:44 am Rudi Hammad,  wrote:
>>>
>>>>
>>>> Hello,
>>>> since I have time now  I wanted to revive this topic because I have to 
>>>> make it work for future project.
>>>> I am trying to track the error, so I added this the code below before 
>>>> the error happening with  find_package(Maya REQUIRED) 
>>>> message ("---")
>>>> message (${CMAKE_MODULE_PATH})
>>>> message ("---")
>>>> So  I wanted to make sure CMAKE_MODULE_PATH is right. As you can see in 
>>>> the image the path is correct and it contains FinMaya.cmake. And still, it 
>>>> says I am not providing it. I am really stuck because all looks okey 
>>>> doesn't it?
>>>>
>>>
>>> Could you try this, to debug the module search path? 
>>> https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_DEBUG_MODE.html
>>>
>>>
>>> [image: Capture.JPG]
>>>> El sábado, 1 de enero de 2022 a las 20:59:55 UTC+1, Justin Israel 
>>>> escribió:
>>>>
>>>>> On Sun, Jan 2, 2022 at 7:10 AM Rudi Hammad  wrote:
>>>>>
>>>>>> So I followed Chad Vernom's cmake tutorials on youtube. First I wrote 
>>>>>> a everything as he did, and when it came do the build from the command 
>>>>>> promp I got an error related to maya path or something, so I thought
>>>>>> F###k that, I'll just copy his repo from github, since I barely 
>>>>>> understand CMake syntax and I might have done plenty of errors.
>>>>>> Anyway, after copying his repo and rebuilding I get the error
>>>>>>
>>>>>> -
>>>>>>  
>>>>>>
>>>>>> Could not find a package configuration file provided by "Maya" with 
>>>>>> any of
>>>>>>   the following names:
>>>>>>
>>>>>> MayaConfig.cmake
>>>>>> maya-config.cmake
>>>>>>
>>>>>>   Add the installation prefix of "Maya" to CMAKE_PREFIX_PATH or set
>>>>>>   "Maya_DIR" to a directory containing one of the above files.  If 
>>>>>> "Maya"
>>>>>>   provides a separate development package or SDK, be sure it has been
>>>>>>   installed.
>>>>>>
>>>>>> -
>>>>>>
>>>>>> Since I am not familiar at all with CMake I have no idea what to do 
>>>>>> with this. According to the error it says " If "Maya"  provides a 
>>>>>> separate 
>>>>>> development package or SDK, be sure it has been installed. "
>>>>>> So should I install maya's devkit separetly or somehing? I so, how to 
>>>>>> "install it"? Should I copy paste all folder of "dekitBase" in maya? Do 
>>>>>> I 
>>>>>> even nee

Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2023-05-04 Thread Rudi Hammad
hey Chad,
Just tried what you suggesteed. In CmakeLists.txt (the one in the root) I 
changed
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cgcmake/modules)
to
set(CMAKE_MODULE_PATH "C:/Users/rudi 
hammad/Desktop/testCMake/testingCMake/cgcmake/modules") 

Same result.
The thing that confuses me is that the path out put to the folder 
containing FindMaya is correct, but the message says otherwise. I am sure I 
must be doing something stupid, but I can't see it.


El viernes, 5 de mayo de 2023 a las 7:10:42 UTC+2, Chad Vernon escribió:

> Maybe it has something to do with the space in your user name? Might need 
> to put quotes around your path when you set the CMAKE_MODULE_PATH
>
> On Thu, May 4, 2023 at 10:05 PM Rudi Hammad  wrote:
>
>> Not sure If I am using  find_program  right. The signature says find_program 
>> ( name1 [path1 path2 ...]) . This what I added 
>> set(CMAKE_FIND_DEBUG_MODE TRUE)
>> find_program(cache "FindMaya.cmake" ${CMAKE_MODULE_PATH})
>> set(CMAKE_FIND_DEBUG_MODE FALSE)
>>
>> The console prints out a bunch of paths. The ones at the end are:
>> C:/Users/rudi hammad/Desktop/testCMake/testingCMake/cgcmake/modules/
>> FindMaya.cmake.com
>> C:/Users/rudi 
>> hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake.exe
>> C:/Users/rudi 
>> hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake
>>
>>
>> El jueves, 4 de mayo de 2023 a las 21:50:59 UTC+2, Justin Israel escribió:
>>
>>>
>>>
>>> On Fri, 5 May 2023, 5:44 am Rudi Hammad,  wrote:
>>>
>>>>
>>>> Hello,
>>>> since I have time now  I wanted to revive this topic because I have to 
>>>> make it work for future project.
>>>> I am trying to track the error, so I added this the code below before 
>>>> the error happening with  find_package(Maya REQUIRED) 
>>>> message ("---")
>>>> message (${CMAKE_MODULE_PATH})
>>>> message ("---")
>>>> So  I wanted to make sure CMAKE_MODULE_PATH is right. As you can see in 
>>>> the image the path is correct and it contains FinMaya.cmake. And still, it 
>>>> says I am not providing it. I am really stuck because all looks okey 
>>>> doesn't it?
>>>>
>>>
>>> Could you try this, to debug the module search path? 
>>> https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_DEBUG_MODE.html
>>>
>>>
>>> [image: Capture.JPG]
>>>> El sábado, 1 de enero de 2022 a las 20:59:55 UTC+1, Justin Israel 
>>>> escribió:
>>>>
>>>>> On Sun, Jan 2, 2022 at 7:10 AM Rudi Hammad  wrote:
>>>>>
>>>>>> So I followed Chad Vernom's cmake tutorials on youtube. First I wrote 
>>>>>> a everything as he did, and when it came do the build from the command 
>>>>>> promp I got an error related to maya path or something, so I thought
>>>>>> F###k that, I'll just copy his repo from github, since I barely 
>>>>>> understand CMake syntax and I might have done plenty of errors.
>>>>>> Anyway, after copying his repo and rebuilding I get the error
>>>>>>
>>>>>> -
>>>>>>  
>>>>>>
>>>>>> Could not find a package configuration file provided by "Maya" with 
>>>>>> any of
>>>>>>   the following names:
>>>>>>
>>>>>> MayaConfig.cmake
>>>>>> maya-config.cmake
>>>>>>
>>>>>>   Add the installation prefix of "Maya" to CMAKE_PREFIX_PATH or set
>>>>>>   "Maya_DIR" to a directory containing one of the above files.  If 
>>>>>> "Maya"
>>>>>>   provides a separate development package or SDK, be sure it has been
>>>>>>   installed.
>>>>>>
>>>>>> -
>>>>>>
>>>>>> Since I am not familiar at all with CMake I have no idea what to do 
>>>>>> with this. According to the error it says " If "Maya"  provides a 
>>>>>> separate 
>>>>>> development package or SDK, be sure it has been install

Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2023-05-04 Thread Rudi Hammad
Not sure If I am using  find_program  right. The signature says find_program 
( name1 [path1 path2 ...]) . This what I added 
set(CMAKE_FIND_DEBUG_MODE TRUE)
find_program(cache "FindMaya.cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_FIND_DEBUG_MODE FALSE)

The console prints out a bunch of paths. The ones at the end are:
C:/Users/rudi 
hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake.com
C:/Users/rudi 
hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake.exe
C:/Users/rudi 
hammad/Desktop/testCMake/testingCMake/cgcmake/modules/FindMaya.cmake


El jueves, 4 de mayo de 2023 a las 21:50:59 UTC+2, Justin Israel escribió:

>
>
> On Fri, 5 May 2023, 5:44 am Rudi Hammad,  wrote:
>
>>
>> Hello,
>> since I have time now  I wanted to revive this topic because I have to 
>> make it work for future project.
>> I am trying to track the error, so I added this the code below before the 
>> error happening with  find_package(Maya REQUIRED) 
>> message ("---")
>> message (${CMAKE_MODULE_PATH})
>> message ("---")
>> So  I wanted to make sure CMAKE_MODULE_PATH is right. As you can see in 
>> the image the path is correct and it contains FinMaya.cmake. And still, it 
>> says I am not providing it. I am really stuck because all looks okey 
>> doesn't it?
>>
>
> Could you try this, to debug the module search path? 
> https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_DEBUG_MODE.html
>
>
> [image: Capture.JPG]
>> El sábado, 1 de enero de 2022 a las 20:59:55 UTC+1, Justin Israel 
>> escribió:
>>
>>> On Sun, Jan 2, 2022 at 7:10 AM Rudi Hammad  wrote:
>>>
>>>> So I followed Chad Vernom's cmake tutorials on youtube. First I wrote a 
>>>> everything as he did, and when it came do the build from the command promp 
>>>> I got an error related to maya path or something, so I thought
>>>> F###k that, I'll just copy his repo from github, since I barely 
>>>> understand CMake syntax and I might have done plenty of errors.
>>>> Anyway, after copying his repo and rebuilding I get the error
>>>>
>>>> -
>>>>  
>>>>
>>>> Could not find a package configuration file provided by "Maya" with any 
>>>> of
>>>>   the following names:
>>>>
>>>> MayaConfig.cmake
>>>> maya-config.cmake
>>>>
>>>>   Add the installation prefix of "Maya" to CMAKE_PREFIX_PATH or set
>>>>   "Maya_DIR" to a directory containing one of the above files.  If 
>>>> "Maya"
>>>>   provides a separate development package or SDK, be sure it has been
>>>>   installed.
>>>>
>>>> -
>>>>
>>>> Since I am not familiar at all with CMake I have no idea what to do 
>>>> with this. According to the error it says " If "Maya"  provides a separate 
>>>> development package or SDK, be sure it has been installed. "
>>>> So should I install maya's devkit separetly or somehing? I so, how to 
>>>> "install it"? Should I copy paste all folder of "dekitBase" in maya? Do I 
>>>> even need the SDK?
>>>>
>>>
>>> Hey Rudi, Since I don't have a WIndows Maya development environment, I 
>>> can only try and guess at the solutions. But it might help you in the 
>>> meantime, until another Windows user chimes in.
>>>
>>> This error looks like it is failing to find the FineMaya.cmake extension 
>>> module that was provided by Chad's repo. The idea here with cmake is that 
>>> it is a build system generator, which supports extension modules to do 
>>> reusable custom tasks, and in this case, to find Maya's development env. 
>>> The README in Chad's project is suggesting a way to structure your own 
>>> project and the contents of the CMakeLists files, and to ensure that you 
>>> have the FindMaya.cmake file in the right spot. 
>>>
>>> https://github.com/chadmv/cgcmake/blob/master/README.md?plain=1#L34
>>> These lines in the root CMakeLists are setting the tools dir to be 
>>> relative to the current source directory processed by cmake 
>>> (./cgcmake/modules),

[Maya-Python] Re: using MySql in c++ plugins

2023-05-02 Thread Rudi Hammad
I king of solved the error by usng *mysqlcppconn.lib*  instead of 
*mysqlcppconn-static.lib 
*.
With this the plugin compiled OK, but when l load it in maya a get a 
Dynamic load error.
Anyways, I ended up using MySql in python which is a lot easier, but it 
would be cool to trying to run mysql directly in C++ in a maya plugin.

Cheers

El lunes, 1 de mayo de 2023 a las 12:11:52 UTC+2, Rudi Hammad escribió:

> hello,
> first of all, let me know if this is out the scope of this forum to post 
> it somewhere else.
> I post it here because it is related to maya anyways and might also be 
> valid for the python api.
>
> Anyways, I want to connect my maya plugins to my data base. I did that 
> already creating an empty windows projects and everything work as expected. 
> The connection was successful.
> Here is the working code:
> https://pastebin.com/UFEn99v7
> (of course set the sensible data as "x")
>
> For this to work I set visual studio as follows:
> *- C/C++ | General | addition include directories -> C:\Program 
> Files\MySQL\Connector C++ 8.0\include\jdbc* 
>
> *- C/C++ | prepocessor | preprocessor Definitions add STATIC_CONCPP *
> *- C/C++ | Code Generatin| Runtime library -> Multi-threaded DLL (/MD)* 
> *- Linker | General | additional library directories -> add C:\Program 
> Files\MySQL\Connector C++ 8.0\lib64\vs14* 
> *- Linker | Input | additional dependencies -> add mysqlcppconn-static.lib*
>
>
> So then I went to a working Maya Plugin I wrote and tried to add that 
> same code, adding to the existing visual studio setup the paths above. And 
> I gave me an error when it runs: get_driver_instance(); 
> Here  is the error
>
> 1>mysqlcppconn-static.lib(my_init.obj) : error LNK2001: unresolved 
> external symbol __imp_RegCloseKey
> 1>mysqlcppconn-static.lib(my_init.obj) : error LNK2001: unresolved 
> external symbol __imp_RegEnumValueA
> 1>mysqlcppconn-static.lib(my_init.obj) : error LNK2001: unresolved 
> external symbol __imp_RegOpenKeyExA
> 1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
> symbol __imp_EqualSid
> 1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
> symbol __imp_GetTokenInformation
> 1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
> symbol __imp_IsValidSid
> 1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
> symbol __imp_LookupAccountNameW
>
> I have been googling to solve this, but linking errors are a bit advanced 
> for me to know exactly what is wrong. I looked into this forum about mysql 
> topics but didn't find an answer to setup maya and mysql. And I only found 
> in the maya docs this :
>
>
> https://help.autodesk.com/view/MAYAUL/2023/ENU/?caas=caas/sfdcarticles/sfdcarticles/Installing-and-configuring-the-MySQL-Client-on-Windows-s.html
>
> My guess is that it must be some specific version that works with maya 
> (the doc mentions MySQL 5.0.27) but I think it must be more complicated 
> that.
> So before breaking my visual studio setup I prefered to ask here, even 
> though I am aware it might be a bit of an advanced topic.
>
> Anyway, please let me know what you think.
> Thx,
>
> R
>
>

-- 
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/f0468dcd-f4d0-4e9f-bfab-a3c38d5db992n%40googlegroups.com.


[Maya-Python] using MySql in c++ plugins

2023-05-01 Thread Rudi Hammad
hello,
first of all, let me know if this is out the scope of this forum to post it 
somewhere else.
I post it here because it is related to maya anyways and might also be 
valid for the python api.

Anyways, I want to connect my maya plugins to my data base. I did that 
already creating an empty windows projects and everything work as expected. 
The connection was successful.
Here is the working code:
https://pastebin.com/UFEn99v7
(of course set the sensible data as "x")

For this to work I set visual studio as follows:
*- C/C++ | General | addition include directories -> C:\Program 
Files\MySQL\Connector C++ 8.0\include\jdbc* 

*- C/C++ | prepocessor | preprocessor Definitions add STATIC_CONCPP *
*- C/C++ | Code Generatin| Runtime library -> Multi-threaded DLL (/MD)* 
*- Linker | General | additional library directories -> add C:\Program 
Files\MySQL\Connector C++ 8.0\lib64\vs14* 
*- Linker | Input | additional dependencies -> add mysqlcppconn-static.lib*


So then I went to a working Maya Plugin I wrote and tried to add that same 
code, adding to the existing visual studio setup the paths above. And I 
gave me an error when it runs: get_driver_instance(); 
Here  is the error

1>mysqlcppconn-static.lib(my_init.obj) : error LNK2001: unresolved external 
symbol __imp_RegCloseKey
1>mysqlcppconn-static.lib(my_init.obj) : error LNK2001: unresolved external 
symbol __imp_RegEnumValueA
1>mysqlcppconn-static.lib(my_init.obj) : error LNK2001: unresolved external 
symbol __imp_RegOpenKeyExA
1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
symbol __imp_EqualSid
1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
symbol __imp_GetTokenInformation
1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
symbol __imp_IsValidSid
1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
symbol __imp_LookupAccountNameW

I have been googling to solve this, but linking errors are a bit advanced 
for me to know exactly what is wrong. I looked into this forum about mysql 
topics but didn't find an answer to setup maya and mysql. And I only found 
in the maya docs this :

https://help.autodesk.com/view/MAYAUL/2023/ENU/?caas=caas/sfdcarticles/sfdcarticles/Installing-and-configuring-the-MySQL-Client-on-Windows-s.html

My guess is that it must be some specific version that works with maya (the 
doc mentions MySQL 5.0.27) but I think it must be more complicated that.
So before breaking my visual studio setup I prefered to ask here, even 
though I am aware it might be a bit of an advanced topic.

Anyway, please let me know what you think.
Thx,

R

-- 
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/dcecd2f0-7d7f-4675-956e-b8e275fb34b3n%40googlegroups.com.


Re: [Maya-Python] how to get the return value with MGlobal::executePythonCommandStringResult

2023-04-30 Thread Rudi Hammad
I spent 2 hours looking into this and you solved it in 2 minutes XD. I 
looked into that documentation definition before, but I didn't understand 
as you did what was going on.
All good now.(In cpp bootstrap is MString type).
Thanks Justin.

El domingo, 30 de abril de 2023 a las 23:14:38 UTC+2, Justin Israel 
escribió:

> "Executes a Python command that returns a string result from the command 
> engine"
>
> Given the documentation, executePythonCommandStringResult wants to parse 
> the python statement through its own command engine. It kind of assumes 
> that the statement sent to this particular function is a single command 
> where it can automatically arrange to capture the string result. So if you 
> feed it larger snippets, the parser gets all wonky. What you can do instead 
> is first feed your supporting code to executePythonCommand(), and then just 
> call executePythonCommandStringResult() with your command. The following 
> works in python:
>
> import maya.OpenMaya as om
>
> bootstrap = """
> def foo():
> xx = cmds.joint()
> return xx
> """
> om.MGlobal.executePythonCommand(bootstrap)
>
> c = "foo()"
> ret = om.MGlobal.executePythonCommandStringResult(c)
> print(ret)
>
>
> On Mon, May 1, 2023 at 8:22 AM Rudi Hammad  wrote:
>
>> Hi,
>> I am writing a Plugin in C++ and I am having trouble figuring out how to 
>> get a return from python execute code.
>> For instance, this works perfectly:
>>
>>  MString pyCommand2;
>> pyCommand2 = "cmds.joint()";
>> auto test2 = MGlobal::executePythonCommandStringResult(pyCommand2);
>> MGlobal::displayInfo(test2);
>>
>> Here I get displayed "joint1", so it is catching the return. But this 
>> doesn't work
>>
>> MString pyCommand;
>> pyCommand =
>> "def foo():\n"
>> "xx = cmds.joint()\n"
>> "return xx\n"
>> " foo()";
>>
>> auto test1 = MGlobal::executePythonCommandStringResult(pyCommand);
>> MGlobal::displayInfo(test1);
>>
>> Here the return value that MGlobal::displayInfo(test1) should provide is 
>> empty.
>> Any ideas?
>>
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/f8e57985-df64-40fe-b8fb-12906ab943b2n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/f8e57985-df64-40fe-b8fb-12906ab943b2n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/2d7cdd35-f585-48a1-82db-cafd0f17ac15n%40googlegroups.com.


[Maya-Python] how to get the return value with MGlobal::executePythonCommandStringResult

2023-04-30 Thread Rudi Hammad
Hi,
I am writing a Plugin in C++ and I am having trouble figuring out how to 
get a return from python execute code.
For instance, this works perfectly:

 MString pyCommand2;
pyCommand2 = "cmds.joint()";
auto test2 = MGlobal::executePythonCommandStringResult(pyCommand2);
MGlobal::displayInfo(test2);

Here I get displayed "joint1", so it is catching the return. But this 
doesn't work

MString pyCommand;
pyCommand =
"def foo():\n"
"xx = cmds.joint()\n"
"return xx\n"
" foo()";

auto test1 = MGlobal::executePythonCommandStringResult(pyCommand);
MGlobal::displayInfo(test1);

Here the return value that MGlobal::displayInfo(test1) should provide is 
empty.
Any ideas?

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/f8e57985-df64-40fe-b8fb-12906ab943b2n%40googlegroups.com.


[Maya-Python] Re: values as -1e-07 causing issues in maya 2023?

2023-02-25 Thread Rudi Hammad
edit: with 1e-07 it is all ok. It is the negative -1e07 that I am getting 
with numpy that is messing things. 


El domingo, 26 de febrero de 2023 a las 0:22:53 UTC+1, Rudi Hammad escribió:

> Hello,
> I recently started updating my code from maya 2018 to 2023. 
> I converted all my code to python 3. I also installed numpy and scipy 
> successfully.
> But I am starting to get errors in my unitests that where passing 
> perfectly before and I realized the following:
>
> I have a scene with a curve that I passed to a MFnCurve called mfnCrv. 
> When I run this :
> *mfnCrv.getPointAtParam(-1e-07, posMPoint, OpenMaya.MSpace.kWorld)*
> I get the error
> * # Error: RuntimeError: file  line 1: (kInvalidParameter): 
> Cannot find item of required type*
>
> but if I do this
> *mfnCrv.getPointAtParam(0.001, posMPoint, OpenMaya.MSpace.kWorld)*
> Everything is fine.
>
> Any one experienced anything like that?
>
> thx,
> R
>
>  
>
>
>

-- 
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/39c31673-f2c0-4def-bb7d-377199dce5c6n%40googlegroups.com.


[Maya-Python] values as -1e-07 causing issues in maya 2023?

2023-02-25 Thread Rudi Hammad
Hello,
I recently started updating my code from maya 2018 to 2023. 
I converted all my code to python 3. I also installed numpy and scipy 
successfully.
But I am starting to get errors in my unitests that where passing perfectly 
before and I realized the following:

I have a scene with a curve that I passed to a MFnCurve called mfnCrv. When 
I run this :
*mfnCrv.getPointAtParam(-1e-07, posMPoint, OpenMaya.MSpace.kWorld)*
I get the error
* # Error: RuntimeError: file  line 1: (kInvalidParameter): 
Cannot find item of required type*

but if I do this
*mfnCrv.getPointAtParam(0.001, posMPoint, OpenMaya.MSpace.kWorld)*
Everything is fine.

Any one experienced anything like that?

thx,
R

 


-- 
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/180563a4-396d-41ce-abd8-82e7ea5732f0n%40googlegroups.com.


[Maya-Python] Re: viewport refresh/lag in parallel mode

2022-03-08 Thread Rudi Hammad
(never mind...animator was creating his own cycle and he wasn't carrying 
about the warning XD)

El jueves, 3 de marzo de 2022 a las 23:23:15 UTC+1, Rudi Hammad escribió:

> Hello,
>
> I was wondering if any one has experienced lag or refreshing issues in the 
> viewport during animation. It seems that some animators when having more 
> than one rig in the scene, have some refreshing issue when playing the 
> animation or scrubing the time line.
> As soon as they switch to DG and/or GPU is set Off, there are no issues.
> Any ideas? Is there something that I should check in the rig that might be 
> causing that or is it just maya's evaluation mode freaking out?
>
> 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/6556f489-a73b-4d38-abce-f395df94a4b2n%40googlegroups.com.


[Maya-Python] viewport refresh/lag in parallel mode

2022-03-03 Thread Rudi Hammad
Hello,

I was wondering if any one has experienced lag or refreshing issues in the 
viewport during animation. It seems that some animators when having more 
than one rig in the scene, have some refreshing issue when playing the 
animation or scrubing the time line.
As soon as they switch to DG and/or GPU is set Off, there are no issues.
Any ideas? Is there something that I should check in the rig that might be 
causing that or is it just maya's evaluation mode freaking out?

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/e7ac2771-94a4-48ca-96e7-0bafde700b89n%40googlegroups.com.


Re: [Maya-Python] casting MPlugArray into a list don't hold the MPlugs in memory?

2022-01-19 Thread Rudi Hammad
yes, it does crash if you save the object in the variable. But it depends 
on how many times you run p.isNull(). I executed that in maya's script 
editor around 6 or 7 times without crash.
But it crashed at the 8th time or so. What I find strange is that the list 
actually holds the MPlugs, but they become null. Maybe that's why they did 
the MPlugArray for MPlug.destinations()??
Anyways, after almost getting a nervious break down I realised that it was 
coming from there XD. I just spent around 3 hours trying to figure it out. 
Also I tried to read the MayaCrashLog.log file
and it was like reading Klingon. No idea how to underst what it says.

El miércoles, 19 de enero de 2022 a las 19:01:28 UTC+1, justin...@gmail.com 
escribió:

>
>
> On Thu, 20 Jan 2022, 6:35 am Rudi Hammad,  wrote:
>
>> hello,
>>
>> I though about sharing someting strange that occured to me. I had a 
>> method that contained
>> MPlug.destinations() which as an art requieres an MPlugArray(). For some 
>> reason, probably because I was in a hurry and I didn't thought about it, I 
>> casted all the MPlugs from MPlug.destinations() into a python list. Let's 
>> call it foo=list().
>> And that's where I started getting crashes. For instance, if I did 
>> something like
>> foo[0], which is supposed to hold an MPlug, maya return the MPlug okey, 
>> but if I did foo[0].isNull() it returned True and then crashed.
>>
>> Whereas if you don't use a python list,  and query directly the 
>> MPlugArray  (e.g, myMPlugArr[0].isNull) it returns False and everything is 
>> ok.
>>
>> So my question more out curiosity than anything else. I know python lists 
>> are mutable objects, but not sure how or if that could be related.
>>
>> Cheers,
>> R
>>
>
> If foo[0] gives you an object, but foo[0].isNull() crashes, then it could 
> be a bug in the C++ wrapper and how it reference counts. Does it crash if 
> you first save the object in a variable? 
> p = foo[0]
> p.isNull()
> I think either way it may be a bug in the wrappers around the C++ memory 
> and the reference counting. 
>
>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/62002c0d-0c72-43d0-9bd8-5e845d3d43b2n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/62002c0d-0c72-43d0-9bd8-5e845d3d43b2n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/f7638778-08fe-473d-a043-0462a9acf968n%40googlegroups.com.


[Maya-Python] casting MPlugArray into a list don't hold the MPlugs in memory?

2022-01-19 Thread Rudi Hammad
hello,

I though about sharing someting strange that occured to me. I had a method 
that contained
MPlug.destinations() which as an art requieres an MPlugArray(). For some 
reason, probably because I was in a hurry and I didn't thought about it, I 
casted all the MPlugs from MPlug.destinations() into a python list. Let's 
call it foo=list().
And that's where I started getting crashes. For instance, if I did 
something like
foo[0], which is supposed to hold an MPlug, maya return the MPlug okey, but 
if I did foo[0].isNull() it returned True and then crashed.

Whereas if you don't use a python list,  and query directly the MPlugArray  
(e.g, myMPlugArr[0].isNull) it returns False and everything is ok.

So my question more out curiosity than anything else. I know python lists 
are mutable objects, but not sure how or if that could be related.

Cheers,
R

-- 
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/62002c0d-0c72-43d0-9bd8-5e845d3d43b2n%40googlegroups.com.


Re: [Maya-Python] event + button click

2022-01-13 Thread Rudi Hammad
aahh,  of course more platform related fun:
*>> Note: *On macOS, the ControlModifier value corresponds to the Command 
keys on the keyboard

At the end I guess I will have to install a mac virtual machine.



El jueves, 13 de enero de 2022 a las 16:07:20 UTC+1, Rudi Hammad escribió:

> thanks marcus, that did it.
>
> El jueves, 13 de enero de 2022 a las 15:02:23 UTC+1, Marcus Ottosson 
> escribió:
>
>> Try getting the modifier state from here.
>>
>>- https://doc.qt.io/qt-5/qguiapplication.html#keyboardModifiers 
>><https://doc.qt.io/qt-5/qt.html#KeyboardModifier-enum>
>>
>> modifiers = QtWidgets.QApplication.keyboardModifiers()
>> if modifiers & QtCore.Qt.ControlModifier:
>>   print("Ctrl was held")
>> if modifiers & QtCore.Qt.ShiftModifier:
>>   print("Shift was held")
>>
>>
>> On Thu, 13 Jan 2022 at 13:29, Rudi Hammad  wrote:
>>
>>> Hello
>>>
>>> I am trying to have a button that print "a" if the button is clicked 
>>> while holding shift, and "b" while holding control.
>>> This is what I have done (since it is not too long I've attached it here)
>>>
>>> from PySide2 import QtWidgets, QtCore, QtGui
>>>
>>> class XX(QtWidgets.QPushButton):
>>>
>>> def __init__(self):
>>> super(XX, self).__init__()
>>> self.setText("myCustomBtn")
>>>
>>> def keyPressEvent(self, event):
>>> if event.type() == QtCore.QEvent.KeyPress and self.isDown():
>>> if event.key() == QtCore.Qt.Key_Shift:
>>> print "a"
>>> if event.key() == QtCore.Qt.Key_Control and self.isDown():
>>> print "b"
>>> 
>>> return QtCore.QObject.event(self, event)
>>>
>>> x = XX()
>>> x.show()
>>>
>>> This kind of works but only if you click and keep the button down and 
>>> the press a key y does what I want. Obviosly this is not what I want.
>>>
>>> Any suggestions?
>>> thanks
>>>
>>> R
>>>
>>>
>>>
>>>
>>> -- 
>>> 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_m...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/4bebba97-bd1b-427f-93db-a0f1afba0eedn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/python_inside_maya/4bebba97-bd1b-427f-93db-a0f1afba0eedn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/ad62640f-c823-4d33-bdb0-4c63f7e3fae1n%40googlegroups.com.


Re: [Maya-Python] event + button click

2022-01-13 Thread Rudi Hammad
thanks marcus, that did it.

El jueves, 13 de enero de 2022 a las 15:02:23 UTC+1, Marcus Ottosson 
escribió:

> Try getting the modifier state from here.
>
>- https://doc.qt.io/qt-5/qguiapplication.html#keyboardModifiers 
><https://doc.qt.io/qt-5/qt.html#KeyboardModifier-enum>
>
> modifiers = QtWidgets.QApplication.keyboardModifiers()
> if modifiers & QtCore.Qt.ControlModifier:
>   print("Ctrl was held")
> if modifiers & QtCore.Qt.ShiftModifier:
>   print("Shift was held")
>
>
> On Thu, 13 Jan 2022 at 13:29, Rudi Hammad  wrote:
>
>> Hello
>>
>> I am trying to have a button that print "a" if the button is clicked 
>> while holding shift, and "b" while holding control.
>> This is what I have done (since it is not too long I've attached it here)
>>
>> from PySide2 import QtWidgets, QtCore, QtGui
>>
>> class XX(QtWidgets.QPushButton):
>>
>> def __init__(self):
>> super(XX, self).__init__()
>> self.setText("myCustomBtn")
>>
>> def keyPressEvent(self, event):
>> if event.type() == QtCore.QEvent.KeyPress and self.isDown():
>> if event.key() == QtCore.Qt.Key_Shift:
>> print "a"
>> if event.key() == QtCore.Qt.Key_Control and self.isDown():
>> print "b"
>> 
>> return QtCore.QObject.event(self, event)
>>
>> x = XX()
>> x.show()
>>
>> This kind of works but only if you click and keep the button down and the 
>> press a key y does what I want. Obviosly this is not what I want.
>>
>> Any suggestions?
>> thanks
>>
>> R
>>
>>
>>
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/4bebba97-bd1b-427f-93db-a0f1afba0eedn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/4bebba97-bd1b-427f-93db-a0f1afba0eedn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/e06468d3-2bf7-4af6-acb2-9e839d61190en%40googlegroups.com.


[Maya-Python] event + button click

2022-01-13 Thread Rudi Hammad
Hello

I am trying to have a button that print "a" if the button is clicked while 
holding shift, and "b" while holding control.
This is what I have done (since it is not too long I've attached it here)

from PySide2 import QtWidgets, QtCore, QtGui

class XX(QtWidgets.QPushButton):

def __init__(self):
super(XX, self).__init__()
self.setText("myCustomBtn")

def keyPressEvent(self, event):
if event.type() == QtCore.QEvent.KeyPress and self.isDown():
if event.key() == QtCore.Qt.Key_Shift:
print "a"
if event.key() == QtCore.Qt.Key_Control and self.isDown():
print "b"

return QtCore.QObject.event(self, event)

x = XX()
x.show()

This kind of works but only if you click and keep the button down and the 
press a key y does what I want. Obviosly this is not what I want.

Any suggestions?
thanks

R




-- 
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/4bebba97-bd1b-427f-93db-a0f1afba0eedn%40googlegroups.com.


Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2022-01-02 Thread Rudi Hammad
 bummer, that's a pain. I'd better make CMake work then. 

El domingo, 2 de enero de 2022 a las 17:31:34 UTC+1, Marcus Ottosson 
escribió:

> > hmmm...I guess there is no alternative way to complile plugins for mac 
> from windows?
>
> Your only option is to build on MacOS, either on a real Mac, a 
> "Hackintosh" or a virtual machine. There is no way to compile a Maya 
> plug-in for Mac using anything but MacOS. The same goes for all platforms. 
> They must be built on the OS they are meant to be used 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/e3885ea7-06b1-43cd-98c0-654c0ba20c6cn%40googlegroups.com.


Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2022-01-02 Thread Rudi Hammad
bummer, that's a pain. I'd better make CMake work then.

On Sunday, January 2, 2022 at 5:31:34 PM UTC+1 Marcus Ottosson wrote:

> > hmmm...I guess there is no alternative way to complile plugins for mac 
> from windows?
>
> Your only option is to build on MacOS, either on a real Mac, a 
> "Hackintosh" or a virtual machine. There is no way to compile a Maya 
> plug-in for Mac using anything but MacOS. The same goes for all platforms. 
> They must be built on the OS they are meant to be used 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/b9f478e2-113e-40e7-9d2b-36c46e2956c4n%40googlegroups.com.


Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2022-01-02 Thread Rudi Hammad
 hey,
yes I followed the same folders structure. I also added the devkit/include. 
But when I run the cmd commands, it creates the folders inside the created 
folder build.2018, but stops with the error mentioned before, and 
build.2018\src\CMakeFiles is empty.

It seems that maya devkit isn't included anymore in maya. I downloaded it, 
and you get a the main "devkitBase" folder, and in it you have "cmake"(with 
qt-5.6.1_vc14-cmake.tar inside), "devkit", "include", "lib", "mkspecs". And 
then inside each, you have other folders, etc.. so there isn't a 
"devkit/include". They are separate folders: "devkit" and "include".

hmmm...I guess there is no alternative way to complile plugins for mac from 
windows?
I have to ship some plugins for animators that use windows and mac, so I 
need to figure out that. I'll keep trying.


El sábado, 1 de enero de 2022 a las 20:59:55 UTC+1, justin...@gmail.com 
escribió:

> On Sun, Jan 2, 2022 at 7:10 AM Rudi Hammad  wrote:
>
>> So I followed Chad Vernom's cmake tutorials on youtube. First I wrote a 
>> everything as he did, and when it came do the build from the command promp 
>> I got an error related to maya path or something, so I thought
>> F###k that, I'll just copy his repo from github, since I barely 
>> understand CMake syntax and I might have done plenty of errors.
>> Anyway, after copying his repo and rebuilding I get the error
>>
>> -
>>  
>>
>> Could not find a package configuration file provided by "Maya" with any of
>>   the following names:
>>
>> MayaConfig.cmake
>> maya-config.cmake
>>
>>   Add the installation prefix of "Maya" to CMAKE_PREFIX_PATH or set
>>   "Maya_DIR" to a directory containing one of the above files.  If "Maya"
>>   provides a separate development package or SDK, be sure it has been
>>   installed.
>>
>> -
>>
>> Since I am not familiar at all with CMake I have no idea what to do with 
>> this. According to the error it says " If "Maya"  provides a separate 
>> development package or SDK, be sure it has been installed. "
>> So should I install maya's devkit separetly or somehing? I so, how to 
>> "install it"? Should I copy paste all folder of "dekitBase" in maya? Do I 
>> even need the SDK?
>>
>
> Hey Rudi, Since I don't have a WIndows Maya development environment, I can 
> only try and guess at the solutions. But it might help you in the meantime, 
> until another Windows user chimes in.
>
> This error looks like it is failing to find the FineMaya.cmake extension 
> module that was provided by Chad's repo. The idea here with cmake is that 
> it is a build system generator, which supports extension modules to do 
> reusable custom tasks, and in this case, to find Maya's development env. 
> The README in Chad's project is suggesting a way to structure your own 
> project and the contents of the CMakeLists files, and to ensure that you 
> have the FindMaya.cmake file in the right spot. 
>
> https://github.com/chadmv/cgcmake/blob/master/README.md?plain=1#L34
> These lines in the root CMakeLists are setting the tools dir to be 
> relative to the current source directory processed by cmake 
> (./cgcmake/modules),
> so it assumes you have this existing path:   
> ./cgcmake/modules/FindMaya.cmake
> Can you confirm that you have this module file in the correct location in 
> your own project?
>
> It will load the FindMaya.cmake because of this:
> https://github.com/chadmv/cgcmake/blob/master/README.md?plain=1#L48
>
> Once you get past that part of cmake finding the module, then it will try 
> to determine the location of your Maya installation:
> https://github.com/chadmv/cgcmake/blob/master/modules/FindMaya.cmake#L54
>
> And you can see what aspects of the Maya installation it expects to find 
> (includes and devkit):
> https://github.com/chadmv/cgcmake/blob/master/modules/FindMaya.cmake#L86
>
> Hope that unblocks you.
>  
>
>>
>>
>> Anyway, I am completly lost here. 
>>
>> Thanks,
>> R
>>
>>
>> El jueves, 14 de octubre de 2021 a las 23:01:30 UTC+2, Mahmoodreza Aarabi 
>> escribió:
>>
>>> Good point Chad
>>>
>>> On Thu, Oct 14, 2021 at 1:44 PM Chad Vernon  wrote:
>>>
>>>> I've used Jenkin

Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2022-01-02 Thread Rudi Hammad
hey,
yes I followed the same folders structure. I also added the devkit/include. 
But when I run the cmd commands, it creates the folders inside the created 
folder build.2018, but stops with the error mentioned before, and 
build.2018\src\CMakeFiles is empty.

It seems that maya devkit isn't included anymore in maya. I downloaded it, 
and you get a the main "devkitBase" folder, and in it you have "cmake"(with 
qt-5.6.1_vc14-cmake.tar inside), "devkit", "include", "lib", "mkspecs". And 
then inside each, you have other folders, etc.. so there isn't a 
"devkit/include". They are separate folders: "devkit" and "include".

hmmm...I guess there is no alternative way to complile plugins for mac from 
windows?
I have to ship some plugins for animators that use windows and mac, so I 
need to figure out that. I'll keep trying.

On Saturday, January 1, 2022 at 8:59:55 PM UTC+1 justin...@gmail.com wrote:

> On Sun, Jan 2, 2022 at 7:10 AM Rudi Hammad  wrote:
>
>> So I followed Chad Vernom's cmake tutorials on youtube. First I wrote a 
>> everything as he did, and when it came do the build from the command promp 
>> I got an error related to maya path or something, so I thought
>> F###k that, I'll just copy his repo from github, since I barely 
>> understand CMake syntax and I might have done plenty of errors.
>> Anyway, after copying his repo and rebuilding I get the error
>>
>> -
>>  
>>
>> Could not find a package configuration file provided by "Maya" with any of
>>   the following names:
>>
>> MayaConfig.cmake
>> maya-config.cmake
>>
>>   Add the installation prefix of "Maya" to CMAKE_PREFIX_PATH or set
>>   "Maya_DIR" to a directory containing one of the above files.  If "Maya"
>>   provides a separate development package or SDK, be sure it has been
>>   installed.
>>
>> -
>>
>> Since I am not familiar at all with CMake I have no idea what to do with 
>> this. According to the error it says " If "Maya"  provides a separate 
>> development package or SDK, be sure it has been installed. "
>> So should I install maya's devkit separetly or somehing? I so, how to 
>> "install it"? Should I copy paste all folder of "dekitBase" in maya? Do I 
>> even need the SDK?
>>
>
> Hey Rudi, Since I don't have a WIndows Maya development environment, I can 
> only try and guess at the solutions. But it might help you in the meantime, 
> until another Windows user chimes in.
>
> This error looks like it is failing to find the FineMaya.cmake extension 
> module that was provided by Chad's repo. The idea here with cmake is that 
> it is a build system generator, which supports extension modules to do 
> reusable custom tasks, and in this case, to find Maya's development env. 
> The README in Chad's project is suggesting a way to structure your own 
> project and the contents of the CMakeLists files, and to ensure that you 
> have the FindMaya.cmake file in the right spot. 
>
> https://github.com/chadmv/cgcmake/blob/master/README.md?plain=1#L34
> These lines in the root CMakeLists are setting the tools dir to be 
> relative to the current source directory processed by cmake 
> (./cgcmake/modules),
> so it assumes you have this existing path:   
> ./cgcmake/modules/FindMaya.cmake
> Can you confirm that you have this module file in the correct location in 
> your own project?
>
> It will load the FindMaya.cmake because of this:
> https://github.com/chadmv/cgcmake/blob/master/README.md?plain=1#L48
>
> Once you get past that part of cmake finding the module, then it will try 
> to determine the location of your Maya installation:
> https://github.com/chadmv/cgcmake/blob/master/modules/FindMaya.cmake#L54
>
> And you can see what aspects of the Maya installation it expects to find 
> (includes and devkit):
> https://github.com/chadmv/cgcmake/blob/master/modules/FindMaya.cmake#L86
>
> Hope that unblocks you.
>  
>
>>
>>
>> Anyway, I am completly lost here. 
>>
>> Thanks,
>> R
>>
>>
>> El jueves, 14 de octubre de 2021 a las 23:01:30 UTC+2, Mahmoodreza Aarabi 
>> escribió:
>>
>>> Good point Chad
>>>
>>> On Thu, Oct 14, 2021 at 1:44 PM Chad Vernon  wrote:
>>>
>>>> I've used Jenkin

Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2022-01-01 Thread Rudi Hammad
 So I followed Chad Vernom's cmake tutorials on youtube. First I wrote a 
everything as he did, and when it came do the build from the command promp 
I got an error related to maya path or something, so I thought
F###k that, I'll just copy his repo from github, since I barely understand 
CMake syntax and I might have done plenty of errors.
Anyway, after copying his repo and rebuilding I get the error

-
 

Could not find a package configuration file provided by "Maya" with any of
  the following names:

MayaConfig.cmake
maya-config.cmake

  Add the installation prefix of "Maya" to CMAKE_PREFIX_PATH or set
  "Maya_DIR" to a directory containing one of the above files.  If "Maya"
  provides a separate development package or SDK, be sure it has been
  installed.
-

Since I am not familiar at all with CMake I have no idea what to do with 
this. According to the error it says " If "Maya"  provides a separate 
development package or SDK, be sure it has been installed. "
So should I install maya's devkit separetly or somehing? I so, how to 
"install it"? Should I copy paste all folder of "dekitBase" in maya? Do I 
even need the SDK? 

Anyway, I am completly lost here. 

Thanks,
R


El jueves, 14 de octubre de 2021 a las 23:01:30 UTC+2, Mahmoodreza Aarabi 
escribió:

> Good point Chad
>
> On Thu, Oct 14, 2021 at 1:44 PM Chad Vernon  wrote:
>
>> I've used Jenkins CI in the past to build plugins for multiple versions 
>> of Maya on all 3 platforms. You have to have access to all three platforms 
>> on the same network. I used CMake to set up the build environment for each 
>> platform/maya version.
>>
>> Also while you can often use a different Visual Studio version than what 
>> Maya was compiled with, you may sometimes see irregularities, like 
>> difficulties running through a debugger.
>>
>> On Thursday, October 14, 2021 at 9:31:40 AM UTC-7 Rudi Hammad wrote:
>>
>>> found this on youtube by chad vernom! 
>>> https://www.youtube.com/watch?v=2mUOt_F2ywo&t=0s
>>>
>>>
>>> El jueves, 14 de octubre de 2021 a las 11:38:17 UTC+2, Rudi Hammad 
>>> escribió:
>>>
>>>> hello,
>>>>
>>>> Not sure if I am understanding correctly. I only know how to setup VS 
>>>> for one maya version. What I do is a set the directories in the properties 
>>>> the the corresponding maya verstion path.
>>>> So what I would do to compile for each is manually change every time 
>>>> the path, which I am sure is not how to do it.
>>>> I would like to get this right first and then I'll check the replies 
>>>> about other platforms.
>>>>
>>>> R
>>>>
>>>> El miércoles, 13 de octubre de 2021 a las 23:15:13 UTC+2, Marcus 
>>>> Ottosson escribió:
>>>>
>>>>> Yes, that's not an issue. The version of Maya you build for is 
>>>>> determined by the SDK you use, e.g. the Maya 2020 SDK for Maya 2020 
>>>>> plug-ins. The only thing to bear in mind is that the compiler version 
>>>>> needs 
>>>>> to match the Maya compiler version, so VS 2015 or 2019 for Maya 
>>>>> 2018-2022. 
>>>>> You can't build for Mac with VS.
>>>>>
>>>>> On Sun, 10 Oct 2021 at 11:47, Rudi Hammad  wrote:
>>>>>
>>>>>> hello,
>>>>>>
>>>>>> the title of the thread sums it up really.
>>>>>> I wonder if there is an easy way to compile the plugins for multiple 
>>>>>> maya's and platforms(windows and mac mainly) at once with visual studio. 
>>>>>> I couldn't find much info googling, or maybe a missed it.
>>>>>>
>>>>>> thanks,
>>>>>>
>>>>>> R
>>>>>>
>>>>>> -- 
>>>>>> 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_m...@googlegroups.com.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/python_inside_maya/90c9a052-2d02-425e

Re: [Maya-Python] Creating an .exe installer.

2021-12-24 Thread Rudi Hammad
Fantastic, thanks. I thought something must already exist. It seems that is 
for windows only. What about mac or linux. Any cross platform installer?
Because usually clients have windows or mac. Haven't found som much on 
linux.

On Saturday, December 25, 2021 at 1:22:08 AM UTC+1 justin...@gmail.com 
wrote:

>
>
> On Sat, 25 Dec 2021, 1:12 pm Rudi Hammad,  
> wrote:
>
>> Hi,
>>
>> I was wondering how to do a .exe installer that display a window as we 
>> see usually in 
>> any software, meaning, you get a UI displaying a first window with a 
>> greeting or whatever,
>> then you have a button with next that brings you to another window where 
>> you can display
>> an agreement text, or a button where you can set the instalation path, 
>> etc...
>>
>> My guess is that you have to create that UI and the widgets your self, 
>> but before doing it I thought that maybe there is already an existing 
>> python framework that does all that since we see that kind of instalation 
>> setup regulary.
>>
>
> Probably avoid writing your own custom ui solution as a first choice. 
> There are existing tools for creating windows installers. Maybe start here: 
>
>
> https://docs.microsoft.com/en-us/visualstudio/extensibility/internals/authoring-a-windows-installer-package?view=vs-2022#setup-tools
>
>
>>
>> Cheers, and merry christmas
>> R
>>
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/34d0aee4-aab5-4e65-ba1a-20e0b174f39dn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/34d0aee4-aab5-4e65-ba1a-20e0b174f39dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/7decd941-ac18-4446-bf38-da8fb6ac1586n%40googlegroups.com.


[Maya-Python] Creating an .exe installer.

2021-12-24 Thread Rudi Hammad
Hi,

I was wondering how to do a .exe installer that display a window as we see 
usually in 
any software, meaning, you get a UI displaying a first window with a 
greeting or whatever,
then you have a button with next that brings you to another window where 
you can display
an agreement text, or a button where you can set the instalation path, 
etc...

My guess is that you have to create that UI and the widgets your self, but 
before doing it I thought that maybe there is already an existing python 
framework that does all that since we see that kind of instalation setup 
regulary. 

Cheers, and merry christmas
R


-- 
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/34d0aee4-aab5-4e65-ba1a-20e0b174f39dn%40googlegroups.com.


Re: [Maya-Python] same rig working in a computer and not in another

2021-12-01 Thread Rudi Hammad
no plugins, and any maya. was having the issue. The animator formated his 
computer, reinstalled maya and voila. All working.
We suspect it might be animbot, but we are not sure. I'll let you know if 
it happens again after using animbot.

El miércoles, 1 de diciembre de 2021 a las 17:47:01 UTC+1, simon payne 
escribió:

> Which version of Maya? Which service packs, any particular plugins or 
> utilities in use and what are tge graphics cards in each machine?
>
> Simon
>
> Sent from my iPhone
>
> On 1 Dec 2021, at 14:09, Rudi Hammad  wrote:
>
> 
>
> hello,
>
> this is the strangest thing I've seen. I delivered a rig to some animators 
> and everything is working fine. Except for one animator that was saying 
> that the rotation on the arms and legs are not working. We tried deleting 
> the prefes, reinstaling maya, installing another fresh version of maya..and 
> nothing. No script editor errors either.
> Just imagin an ik arm rig  where in a computer only translation works, and 
> in all the other computers both translation and rotation works.
>
> Any idea what could be happening?
>
> 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_m...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/5728044a-e7a2-4599-9b33-380261caedc7n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/python_inside_maya/5728044a-e7a2-4599-9b33-380261caedc7n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
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/ebb03494-ea13-4a55-a544-ec4eca6868ben%40googlegroups.com.


[Maya-Python] same rig working in a computer and not in another

2021-12-01 Thread Rudi Hammad
hello,

this is the strangest thing I've seen. I delivered a rig to some animators 
and everything is working fine. Except for one animator that was saying 
that the rotation on the arms and legs are not working. We tried deleting 
the prefes, reinstaling maya, installing another fresh version of maya..and 
nothing. No script editor errors either.
Just imagin an ik arm rig  where in a computer only translation works, and 
in all the other computers both translation and rotation works.

Any idea what could be happening?

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/5728044a-e7a2-4599-9b33-380261caedc7n%40googlegroups.com.


Re: [Maya-Python] Pyside dynamically creating widgets and attaching signal isse

2021-11-14 Thread Rudi Hammad
Noted

El domingo, 14 de noviembre de 2021 a las 20:55:40 UTC+1, 
justin...@gmail.com escribió:

> On Mon, Nov 15, 2021 at 8:44 AM Rudi Hammad  wrote:
>
>> Amazing, thanks for the explanation.
>> I've used wrappers before in other contexts but not partial.  Didn't 
>> found that issue until now. 
>> Nothing much to add! that solved it. Thank you
>>
>
> Welcome!
>
> Also, I should point out that I have seen cases in either pyqt or pyside 
> where using a partial() or local scope function wrapper could lead to a 
> memory leak on the object with the signal, depending on how objects are 
> parented and deleted. This can happen because python (I think) won't be 
> able to automatically disconnect the signal if it doesnt see that the 
> object owning the slot has been garbage collected. When you use a partial() 
> or a local wrapper, its a branch new object. So switching to always using 
> methods bound to your object seems to work better 
> (self._printFooHandler(self.printFoo, n))
> Not saying it happens all the time, but I have seen it before.
>  
>
>>
>> El domingo, 14 de noviembre de 2021 a las 20:21:29 UTC+1, 
>> justin...@gmail.com escribió:
>>
>>> On Mon, Nov 15, 2021 at 7:15 AM Rudi Hammad  wrote:
>>>
>>>> Hello,
>>>>
>>>> I wrote this simple ui to ilustrate the issue. As the title says I am 
>>>> creating dynamically
>>>> some widgets and attaching a signal. In this case 4 buttons that when 
>>>> clicked, print their name.
>>>> The problem if you run the code is that all buttons are printing the 
>>>> same letter 'D', which is the last signal to be set. 
>>>>
>>>> dynamic widget creation <https://pastebin.com/clone/k8cVKC05>
>>>>
>>>> Any ideas how to create dynamic signals that will be attached to the 
>>>> corresponding widget?
>>>>
>>>
>>> Hey there. So this is caused by the fact that a python lambda does not 
>>> perform a full closure over the scoped variable, which leads to bugs like 
>>> this when the locally scope variable (n) is changing over the course of the 
>>> loop. Each lambda you are passing as a slot function has a reference to 
>>> that scope, but will evaluate the last value of the variable n.
>>>
>>> (note: dont do the following)
>>> The safer way to express the lambda that properly captures the variable 
>>> value at that time is something like this double-lambda:
>>>
>>> fn = lambda val: lambda: self.fooPrint(n)
>>> btn.clicked.connect(fn(n))
>>>
>>>
>>> This directly captures the current value of your loop variable and 
>>> returns a new lambda with a closure over that value.
>>>
>>> Because this is such a fragile mechanism, PEP advises against using 
>>> anonymous lambdas in the first place:
>>> https://www.flake8rules.com/rules/E731.html
>>>
>>> So what you could do instead is wrap local def functions (there are 
>>> multiple ways to do this, but here is one way):
>>>
>>> for n in 'ABCD':
>>> def wrap(val=n, *args):
>>> self.fooPrint(val)
>>> btn.clicked.connect(wrap)
>>>
>>>
>>> And this is pretty much what functools.partial() is for:
>>>
>>> from functools import partial
>>> for n in 'ABCD':
>>> btn.clicked.connect(partial(self.fooPrint, n))
>>>
>>>
>>>
>>>
>>>> thanks
>>>>
>>>> R
>>>>
>>>> -- 
>>>> 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_m...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/python_inside_maya/eeb1960d-1e46-43d0-a0d9-1107f695a859n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/python_inside_maya/eeb1960d-1e46-43d0-a0d9-1107f695a859n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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_m...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/919b3797-15f2-4dd9-9769-9bcdd55137c2n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/919b3797-15f2-4dd9-9769-9bcdd55137c2n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/609dca54-7046-4108-bb5e-7c5c53bd7ca4n%40googlegroups.com.


Re: [Maya-Python] Pyside dynamically creating widgets and attaching signal isse

2021-11-14 Thread Rudi Hammad
Amazing, thanks for the explanation.
I've used wrappers before in other contexts but not partial.  Didn't found 
that issue until now. 
Nothing much to add! that solved it. Thank you

El domingo, 14 de noviembre de 2021 a las 20:21:29 UTC+1, 
justin...@gmail.com escribió:

> On Mon, Nov 15, 2021 at 7:15 AM Rudi Hammad  wrote:
>
>> Hello,
>>
>> I wrote this simple ui to ilustrate the issue. As the title says I am 
>> creating dynamically
>> some widgets and attaching a signal. In this case 4 buttons that when 
>> clicked, print their name.
>> The problem if you run the code is that all buttons are printing the same 
>> letter 'D', which is the last signal to be set. 
>>
>> dynamic widget creation <https://pastebin.com/clone/k8cVKC05>
>>
>> Any ideas how to create dynamic signals that will be attached to the 
>> corresponding widget?
>>
>
> Hey there. So this is caused by the fact that a python lambda does not 
> perform a full closure over the scoped variable, which leads to bugs like 
> this when the locally scope variable (n) is changing over the course of the 
> loop. Each lambda you are passing as a slot function has a reference to 
> that scope, but will evaluate the last value of the variable n.
>
> (note: dont do the following)
> The safer way to express the lambda that properly captures the variable 
> value at that time is something like this double-lambda:
>
> fn = lambda val: lambda: self.fooPrint(n)
> btn.clicked.connect(fn(n))
>
>
> This directly captures the current value of your loop variable and returns 
> a new lambda with a closure over that value.
>
> Because this is such a fragile mechanism, PEP advises against using 
> anonymous lambdas in the first place:
> https://www.flake8rules.com/rules/E731.html
>
> So what you could do instead is wrap local def functions (there are 
> multiple ways to do this, but here is one way):
>
> for n in 'ABCD':
> def wrap(val=n, *args):
> self.fooPrint(val)
> btn.clicked.connect(wrap)
>
>
> And this is pretty much what functools.partial() is for:
>
> from functools import partial
> for n in 'ABCD':
> btn.clicked.connect(partial(self.fooPrint, n))
>
>
>
>
>> thanks
>>
>> R
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/eeb1960d-1e46-43d0-a0d9-1107f695a859n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/eeb1960d-1e46-43d0-a0d9-1107f695a859n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/919b3797-15f2-4dd9-9769-9bcdd55137c2n%40googlegroups.com.


[Maya-Python] Pyside dynamically creating widgets and attaching signal isse

2021-11-14 Thread Rudi Hammad
Hello,

I wrote this simple ui to ilustrate the issue. As the title says I am 
creating dynamically
some widgets and attaching a signal. In this case 4 buttons that when 
clicked, print their name.
The problem if you run the code is that all buttons are printing the same 
letter 'D', which is the last signal to be set. 

dynamic widget creation 

Any ideas how to create dynamic signals that will be attached to the 
corresponding widget?

thanks

R

-- 
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/eeb1960d-1e46-43d0-a0d9-1107f695a859n%40googlegroups.com.


Re: [Maya-Python] accessing maya's interpreter globals from another scripts

2021-11-10 Thread Rudi Hammad
that's it! thanks

El miércoles, 10 de noviembre de 2021 a las 18:07:01 UTC+1, 
justin...@gmail.com escribió:

>
>
> On Thu, 11 Nov 2021, 12:55 am Rudi Hammad,  wrote:
>
>> in other words, get the result in foo.py that you get when you run 
>> globals() in maya's script editor.
>>
>
> You can reference what I am going in the MayaSublime project. I import 
> __main__ and access __main__.__dict__ for the globals as you would see them 
> in the script editor
>
> https://github.com/justinfx/MayaSublime/blob/master/MayaSublime.py#L289
>
>
>> El miércoles, 10 de noviembre de 2021 a las 12:52:29 UTC+1, Rudi Hammad 
>> escribió:
>>
>>> of course, in foo.py you get the module's global, and in maya's script 
>>> editor you see maya's. 
>>> So I was wondering if you can query maya's globals (or locals) from an 
>>> other foo.py. 
>>> I know, it is a strange question.
>>>
>>> El miércoles, 10 de noviembre de 2021 a las 12:24:52 UTC+1, Marcus 
>>> Ottosson escribió:
>>>
>>>> Global variables are.. global, so anything present in `globals()` from 
>>>> one module is present in another. Are you seeing different results from 
>>>> `globals()` in `foo.py` versus Maya's interpreter (by which I assume you 
>>>> mean the Script Editor)?
>>>>
>>>> On Wed, 10 Nov 2021 at 09:36, Rudi Hammad  wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I was wondering if it is possible to get the globals variables running 
>>>>> in maya but from another script.
>>>>> For instance say you have a module foo.py. Can you use get all maya's 
>>>>> globals as if you were running 'globals()' withing maya's interpreter?
>>>>>
>>>>> thx,
>>>>>
>>>>> T
>>>>>
>>>>> -- 
>>>>> 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_m...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/python_inside_maya/46ad99b5-42d5-40dd-ba99-74b546516426n%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/python_inside_maya/46ad99b5-42d5-40dd-ba99-74b546516426n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>> 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_m...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/5857d0a2-3851-4ae5-b43f-201bfadf9aafn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/5857d0a2-3851-4ae5-b43f-201bfadf9aafn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/b436adba-cae3-47ed-9636-e094e799178fn%40googlegroups.com.


Re: [Maya-Python] accessing maya's interpreter globals from another scripts

2021-11-10 Thread Rudi Hammad
in other words, get the result in foo.py that you get when you run 
globals() in maya's script editor.

El miércoles, 10 de noviembre de 2021 a las 12:52:29 UTC+1, Rudi Hammad 
escribió:

> of course, in foo.py you get the module's global, and in maya's script 
> editor you see maya's. 
> So I was wondering if you can query maya's globals (or locals) from an 
> other foo.py. 
> I know, it is a strange question.
>
> El miércoles, 10 de noviembre de 2021 a las 12:24:52 UTC+1, Marcus 
> Ottosson escribió:
>
>> Global variables are.. global, so anything present in `globals()` from 
>> one module is present in another. Are you seeing different results from 
>> `globals()` in `foo.py` versus Maya's interpreter (by which I assume you 
>> mean the Script Editor)?
>>
>> On Wed, 10 Nov 2021 at 09:36, Rudi Hammad  wrote:
>>
>>> Hello,
>>>
>>> I was wondering if it is possible to get the globals variables running 
>>> in maya but from another script.
>>> For instance say you have a module foo.py. Can you use get all maya's 
>>> globals as if you were running 'globals()' withing maya's interpreter?
>>>
>>> thx,
>>>
>>> T
>>>
>>> -- 
>>> 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_m...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/46ad99b5-42d5-40dd-ba99-74b546516426n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/python_inside_maya/46ad99b5-42d5-40dd-ba99-74b546516426n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/5857d0a2-3851-4ae5-b43f-201bfadf9aafn%40googlegroups.com.


Re: [Maya-Python] accessing maya's interpreter globals from another scripts

2021-11-10 Thread Rudi Hammad
of course, in foo.py you get the module's global, and in maya's script 
editor you see maya's. 
So I was wondering if you can query maya's globals (or locals) from an 
other foo.py. 
I know, it is a strange question.

El miércoles, 10 de noviembre de 2021 a las 12:24:52 UTC+1, Marcus Ottosson 
escribió:

> Global variables are.. global, so anything present in `globals()` from one 
> module is present in another. Are you seeing different results from 
> `globals()` in `foo.py` versus Maya's interpreter (by which I assume you 
> mean the Script Editor)?
>
> On Wed, 10 Nov 2021 at 09:36, Rudi Hammad  wrote:
>
>> Hello,
>>
>> I was wondering if it is possible to get the globals variables running in 
>> maya but from another script.
>> For instance say you have a module foo.py. Can you use get all maya's 
>> globals as if you were running 'globals()' withing maya's interpreter?
>>
>> thx,
>>
>> T
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/46ad99b5-42d5-40dd-ba99-74b546516426n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/46ad99b5-42d5-40dd-ba99-74b546516426n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/cc32df3f-d365-411b-8ef7-663f9fc1ca69n%40googlegroups.com.


[Maya-Python] accessing maya's interpreter globals from another scripts

2021-11-10 Thread Rudi Hammad
Hello,

I was wondering if it is possible to get the globals variables running in 
maya but from another script.
For instance say you have a module foo.py. Can you use get all maya's 
globals as if you were running 'globals()' withing maya's interpreter?

thx,

T

-- 
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/46ad99b5-42d5-40dd-ba99-74b546516426n%40googlegroups.com.


Re: [Maya-Python] automatically load shelf images in other computers

2021-11-02 Thread Rudi Hammad
Thanks for the reference, I'll check it out.
Cheers,

R

El martes, 2 de noviembre de 2021 a las 10:42:03 UTC+1, hannes...@gmail.com 
escribió:

> i recommend to look into maya projects, maya modules, and environment 
> variables.
>
> video on relative path for textures: 
> https://www.youtube.com/watch?v=3mYetC5sGSk
>
> modules/plugins can load icons relatively from a icons folder setup in the 
> mod file.
>
> you could also ask people to add a env variable. and set your path to  
> %MYICONFOLDER%/someImage.png
> then if everyone sets their env var correctly it will load the icon
>
>
> Kind Regards,
> Hannes Delbeke
>
>
>
> On Mon, 1 Nov 2021 at 23:55, Rudi Hammad  wrote:
>
>> Hello,
>>
>> we are a working in a project where every one is working locally. So 
>> before writing any code, I was wondering if there is a way to automatically 
>> load all the  images of the shelf that I am sending to the other members of 
>> the team.
>>
>> I load the images locally by setting the path:
>> C:\Users\rudi\Documents\maya\2018\prefs\icons\someImage.png, so obviously 
>> this won't work for other users. They will have to manually set the path 
>> which is not ideal.
>>
>> We share everything in google drive too. Is it possible to load directly 
>> from there?
>>
>> Is there an easy way or should I write code to do a custom install 
>> reading each computer environment to get where maya is installed?
>>
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/accedb59-7511-4c15-86d7-cdc70b2f4395n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/accedb59-7511-4c15-86d7-cdc70b2f4395n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/10167ff5-f0d2-4adb-a776-ea188574c746n%40googlegroups.com.


[Maya-Python] automatically load shelf images in other computers

2021-11-01 Thread Rudi Hammad
Hello,

we are a working in a project where every one is working locally. So before 
writing any code, I was wondering if there is a way to automatically load 
all the  images of the shelf that I am sending to the other members of the 
team.

I load the images locally by setting the path:
C:\Users\rudi\Documents\maya\2018\prefs\icons\someImage.png, so obviously 
this won't work for other users. They will have to manually set the path 
which is not ideal.

We share everything in google drive too. Is it possible to load directly 
from there?

Is there an easy way or should I write code to do a custom install reading 
each computer environment to get where maya is installed?

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/accedb59-7511-4c15-86d7-cdc70b2f4395n%40googlegroups.com.


Re: [Maya-Python] Re: possible maya bug with MPlug.setKeyable

2021-10-26 Thread Rudi Hammad
ok, got it. No bug then! 
Thx Marcus

El martes, 26 de octubre de 2021 a las 12:32:52 UTC+2, Marcus Ottosson 
escribió:

> Because translateX is a static attribute, and the keyable state isn't 
> stored with the scene, but with Maya itself. Have a look at any other 
> translateX and you'll find those hidden too. Until you restart Maya.
>
> On Tue, 26 Oct 2021 at 11:07, Rudi Hammad  wrote:
>
>> hmmm...okey. but then how come that if you this exact same thing with 
>> translateX, it does remain hidden after saving and opening the since
>>
>> jnt = cmds.joint()
>> mslist = OpenMaya.MSelectionList()
>> mslist.add(jnt)
>> mobj = OpenMaya.MObject()
>> mslist.getDependNode(0, mobj)
>> mfnDepNode = OpenMaya.MFnDependencyNode(mobj)
>> mplug = mfnDepNode.findPlug("tx")
>> mplug.setKeyable(False)
>>
>> El martes, 26 de octubre de 2021 a las 7:41:52 UTC+2, Marcus Ottosson 
>> escribió:
>>
>>> I was looking at this, but found it consistent across all versions of 
>>> Maya, so I'm not sure it qualifies as a bug. xD I even use it, to 
>>> dynamically alter the Channel Box based on the value of another attribute, 
>>> like if a node is disabled I can go ahead and hide other attributes that 
>>> depend on this value. But I wouldn't want this to be saved with the scene, 
>>> since it's temporary and cosmetic.
>>>
>>> On Mon, 25 Oct 2021 at 23:58, Rudi Hammad  wrote:
>>>
>>>> mkkkay, I'll take that as a bug then XD
>>>>
>>>> El jueves, 21 de octubre de 2021 a las 16:00:26 UTC+2, Rudi Hammad 
>>>> escribió:
>>>>
>>>>> Hello. When I use MPlug.setKeyable() the attribute is hiden as 
>>>>> expected. You can try this to check it: 
>>>>>
>>>>> jnt = cmds.joint()
>>>>> cmds.addAttr(jnt, ln="foo", at="float", k=True)
>>>>> mslist = OpenMaya.MSelectionList()
>>>>> mslist.add(jnt)
>>>>> mobj = OpenMaya.MObject()
>>>>> mslist.getDependNode(0, mobj)
>>>>> mfnDepNode = OpenMaya.MFnDependencyNode(mobj)
>>>>> mplug = mfnDepNode.findPlug("foo")
>>>>> mplug.setKeyable(False)
>>>>>
>>>>>
>>>>> the problem that I am having is that if you save the scene, and open 
>>>>> it again, the attribute is visible again. His happens if you do that 
>>>>> throught mplug. With cmds it is fine.
>>>>> Is that a bug or is there something else that needs to be done?
>>>>>
>>>>> Cheers,
>>>>>
>>>>> R
>>>>>
>>>> -- 
>>>> 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_m...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/python_inside_maya/3d3ac7be-5232-46e7-9ef2-eb8e94264f86n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/python_inside_maya/3d3ac7be-5232-46e7-9ef2-eb8e94264f86n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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_m...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/e26866ad-3820-4111-a8c7-b3390b8afd0an%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/e26866ad-3820-4111-a8c7-b3390b8afd0an%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/62e1ab58-d4d5-4835-b152-8bd3316ce74an%40googlegroups.com.


Re: [Maya-Python] Re: possible maya bug with MPlug.setKeyable

2021-10-26 Thread Rudi Hammad
hmmm...okey. but then how come that if you this exact same thing with 
translateX, it does remain hidden after saving and opening the since

jnt = cmds.joint()
mslist = OpenMaya.MSelectionList()
mslist.add(jnt)
mobj = OpenMaya.MObject()
mslist.getDependNode(0, mobj)
mfnDepNode = OpenMaya.MFnDependencyNode(mobj)
mplug = mfnDepNode.findPlug("tx")
mplug.setKeyable(False)

El martes, 26 de octubre de 2021 a las 7:41:52 UTC+2, Marcus Ottosson 
escribió:

> I was looking at this, but found it consistent across all versions of 
> Maya, so I'm not sure it qualifies as a bug. xD I even use it, to 
> dynamically alter the Channel Box based on the value of another attribute, 
> like if a node is disabled I can go ahead and hide other attributes that 
> depend on this value. But I wouldn't want this to be saved with the scene, 
> since it's temporary and cosmetic.
>
> On Mon, 25 Oct 2021 at 23:58, Rudi Hammad  wrote:
>
>> mkkkay, I'll take that as a bug then XD
>>
>> El jueves, 21 de octubre de 2021 a las 16:00:26 UTC+2, Rudi Hammad 
>> escribió:
>>
>>> Hello. When I use MPlug.setKeyable() the attribute is hiden as expected. 
>>> You can try this to check it: 
>>>
>>> jnt = cmds.joint()
>>> cmds.addAttr(jnt, ln="foo", at="float", k=True)
>>> mslist = OpenMaya.MSelectionList()
>>> mslist.add(jnt)
>>> mobj = OpenMaya.MObject()
>>> mslist.getDependNode(0, mobj)
>>> mfnDepNode = OpenMaya.MFnDependencyNode(mobj)
>>> mplug = mfnDepNode.findPlug("foo")
>>> mplug.setKeyable(False)
>>>
>>>
>>> the problem that I am having is that if you save the scene, and open it 
>>> again, the attribute is visible again. His happens if you do that throught 
>>> mplug. With cmds it is fine.
>>> Is that a bug or is there something else that needs to be done?
>>>
>>> Cheers,
>>>
>>> R
>>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/3d3ac7be-5232-46e7-9ef2-eb8e94264f86n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/3d3ac7be-5232-46e7-9ef2-eb8e94264f86n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/e26866ad-3820-4111-a8c7-b3390b8afd0an%40googlegroups.com.


[Maya-Python] Re: possible maya bug with MPlug.setKeyable

2021-10-25 Thread Rudi Hammad
mkkkay, I'll take that as a bug then XD

El jueves, 21 de octubre de 2021 a las 16:00:26 UTC+2, Rudi Hammad escribió:

> Hello. When I use MPlug.setKeyable() the attribute is hiden as expected. 
> You can try this to check it: 
>
> jnt = cmds.joint()
> cmds.addAttr(jnt, ln="foo", at="float", k=True)
> mslist = OpenMaya.MSelectionList()
> mslist.add(jnt)
> mobj = OpenMaya.MObject()
> mslist.getDependNode(0, mobj)
> mfnDepNode = OpenMaya.MFnDependencyNode(mobj)
> mplug = mfnDepNode.findPlug("foo")
> mplug.setKeyable(False)
>
>
> the problem that I am having is that if you save the scene, and open it 
> again, the attribute is visible again. His happens if you do that throught 
> mplug. With cmds it is fine.
> Is that a bug or is there something else that needs to be done?
>
> Cheers,
>
> R
>

-- 
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/3d3ac7be-5232-46e7-9ef2-eb8e94264f86n%40googlegroups.com.


[Maya-Python] possible maya bug with MPlug.setKeyable

2021-10-21 Thread Rudi Hammad
Hello. When I use MPlug.setKeyable() the attribute is hiden as expected. 
You can try this to check it: 

jnt = cmds.joint()
cmds.addAttr(jnt, ln="foo", at="float", k=True)
mslist = OpenMaya.MSelectionList()
mslist.add(jnt)
mobj = OpenMaya.MObject()
mslist.getDependNode(0, mobj)
mfnDepNode = OpenMaya.MFnDependencyNode(mobj)
mplug = mfnDepNode.findPlug("foo")
mplug.setKeyable(False)


the problem that I am having is that if you save the scene, and open it 
again, the attribute is visible again. His happens if you do that throught 
mplug. With cmds it is fine.
Is that a bug or is there something else that needs to be done?

Cheers,

R

-- 
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/a4dd93d0-dd62-4e80-9680-424925d22332n%40googlegroups.com.


Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2021-10-14 Thread Rudi Hammad
found this on youtube by chad vernom! 
https://www.youtube.com/watch?v=2mUOt_F2ywo&t=0s


El jueves, 14 de octubre de 2021 a las 11:38:17 UTC+2, Rudi Hammad escribió:

> hello,
>
> Not sure if I am understanding correctly. I only know how to setup VS for 
> one maya version. What I do is a set the directories in the properties the 
> the corresponding maya verstion path.
> So what I would do to compile for each is manually change every time the 
> path, which I am sure is not how to do it.
> I would like to get this right first and then I'll check the replies about 
> other platforms.
>
> R
>
> El miércoles, 13 de octubre de 2021 a las 23:15:13 UTC+2, Marcus Ottosson 
> escribió:
>
>> Yes, that's not an issue. The version of Maya you build for is determined 
>> by the SDK you use, e.g. the Maya 2020 SDK for Maya 2020 plug-ins. The only 
>> thing to bear in mind is that the compiler version needs to match the Maya 
>> compiler version, so VS 2015 or 2019 for Maya 2018-2022. You can't build 
>> for Mac with VS.
>>
>> On Sun, 10 Oct 2021 at 11:47, Rudi Hammad  wrote:
>>
>>> hello,
>>>
>>> the title of the thread sums it up really.
>>> I wonder if there is an easy way to compile the plugins for multiple 
>>> maya's and platforms(windows and mac mainly) at once with visual studio. 
>>> I couldn't find much info googling, or maybe a missed it.
>>>
>>> thanks,
>>>
>>> R
>>>
>>> -- 
>>> 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_m...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/90c9a052-2d02-425e-812b-9129f1c71bafn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/python_inside_maya/90c9a052-2d02-425e-812b-9129f1c71bafn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/e18d256b-7e52-43e3-b6b8-5171e6b6c897n%40googlegroups.com.


Re: [Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2021-10-14 Thread Rudi Hammad
hello,

Not sure if I am understanding correctly. I only know how to setup VS for 
one maya version. What I do is a set the directories in the properties the 
the corresponding maya verstion path.
So what I would do to compile for each is manually change every time the 
path, which I am sure is not how to do it.
I would like to get this right first and then I'll check the replies about 
other platforms.

R

El miércoles, 13 de octubre de 2021 a las 23:15:13 UTC+2, Marcus Ottosson 
escribió:

> Yes, that's not an issue. The version of Maya you build for is determined 
> by the SDK you use, e.g. the Maya 2020 SDK for Maya 2020 plug-ins. The only 
> thing to bear in mind is that the compiler version needs to match the Maya 
> compiler version, so VS 2015 or 2019 for Maya 2018-2022. You can't build 
> for Mac with VS.
>
> On Sun, 10 Oct 2021 at 11:47, Rudi Hammad  wrote:
>
>> hello,
>>
>> the title of the thread sums it up really.
>> I wonder if there is an easy way to compile the plugins for multiple 
>> maya's and platforms(windows and mac mainly) at once with visual studio. 
>> I couldn't find much info googling, or maybe a missed it.
>>
>> thanks,
>>
>> R
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/90c9a052-2d02-425e-812b-9129f1c71bafn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/90c9a052-2d02-425e-812b-9129f1c71bafn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/8c7a50b9-3482-44f1-9871-5365cc9817d5n%40googlegroups.com.


[Maya-Python] Compiling plugins in Visual Studio for multiple maya versions and platforms

2021-10-10 Thread Rudi Hammad
hello,

the title of the thread sums it up really.
I wonder if there is an easy way to compile the plugins for multiple maya's 
and platforms(windows and mac mainly) at once with visual studio. 
I couldn't find much info googling, or maybe a missed it.

thanks,

R

-- 
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/90c9a052-2d02-425e-812b-9129f1c71bafn%40googlegroups.com.


Re: [Maya-Python] V Crypt System

2021-09-15 Thread Rudi Hammad
yes, something like that might work, but if I am working locally from home 
sending files to someone else that is also in his own personal computer I 
can't really force that persone to set the usertSetup.py or the other 
alternative you mentioned.
aarrggg...callbacks are nice, but yeah...doesn't seem to hard to by 
pass them. I'll have to trust that people will respect the nda agreement...

About what I am trying to protect is the rig basically in 2 aspects:
1-prevent redistribution outside a production
2-prevent reverse ingeniering, which I did find out recently that a lot of 
nda's have a section stating that you agree not to do that...but 
againhow can you enforce that? it is impossible.

So far the safest system is VCrypt, but as we talked before, many clients 
might refuse to use it even if provide them a license. Anyway, thanks for 
all the suggestions.


El miércoles, 15 de septiembre de 2021 a las 7:47:08 UTC+2, Marcus Ottosson 
escribió:

> it work is you execute that at the beginning of every maya session (for 
> instance putting it in the userSetup.py), but then you just have to find 
> this part of the code and remove it…
>
> About MSceneMessage.addCheckCallback, there are a few ways of installing 
> it.
>
>- userSetup.py 
>- plug-in 
>- Script node in a New Scene Template 
>
> I’d argue each of these are equally insecure, in that anyone can (1) edit 
> the userSetup.py, or associated environment variable that points to it, (2) 
> unload the plug-in, forcefully or launch Maya without plug-ins and (3) find 
> that hidden spot where you edit the new scene template.
>
> userSetup.py can be made more secure by residing on PYTHONPATH rather than 
> in the user’s home directory. That way, you provide your own Maya 
> executable (e.g. a .bat file on Windows) whereby a userSetup of your choice 
> is added to PYTHONPATH prior to launch.
>
> :: maya.batset PYTHONPATH=\\server\pipeline\userSetup.pystart "c:\program 
> files\autodesk\maya2020\bin\maya.exe"
>
> That way, the user would be unable to launch Maya without also executing 
> this userSetup.py. Especially if it is also what loads up relevant pipeline 
> tooling such that if they were to try and launch it without this executable 
> (which is read-only, on a network), they would be unable to even use Maya 
> for their work.
>
> And again, I think you have to define what you protecting against. 
> Malicious hacker-animators, or the 99% case? Because no system can ever 
> protect against every attack; not in Maya, not anywhere. If what it takes 
> to defeat your system is to bypass a hidden userSetup.py then I’d argue you 
> have already protected against the vast majority of cases.
>
> On Wed, 15 Sept 2021 at 04:02, Justin Israel  wrote:
>
>>
>>
>> On Wed, Sep 15, 2021 at 11:36 AM Rudi Hammad  wrote:
>>
>>> So I cam up with a evil idea that seems to work.
>>> . I create a script node that travels with the scene that will check 
>>> your mac address out from a list of valid addresses (that would be the ones 
>>> corresponding to the people working remotly on their personal computers).
>>>   if the address doesn't match it wont open (it opens a new file for 
>>> instance)
>>> . So then, lets say that your address is valid. Now you would think that 
>>> you can just delete the scriptNode and that's it, right? weI 
>>> added a callback that triggers when you delete the scriptNode, that deletes 
>>> everything .
>>>
>>> Of course we can just change that to something less evil, but maybe this 
>>> might work? save a scriptnode will what ever callback are needed, and 
>>> prevent this script node from bein delete?
>>> I don't know...I am starting to lose motivation...
>>>
>>
>> What if I just open the scene file with the option to disable script 
>> nodes? If it's somewhat trivial to defeat the security then you have to 
>> decide if you are doing this with the goal of absolute security, or just 
>> being a deterrent and using security-via-obscurity. If there is any way to 
>> get the scene file opened, either by disabling script nodes, or by another 
>> binary to ascii conversion that can then edit the script nodes, it kind of 
>> makes this pointless if the goal is security.
>>
>>  
>>
>>>
>>>
>>>
>>> El lunes, 13 de septiembre de 2021 a las 22:21:47 UTC+2, 
>>> justin...@gmail.com escribió:
>>>
>>>> On Tue, Sep 14, 2021 at 7:52 AM Rudi Hammad  wrote:
>>>>
>>>>> About V crypt, I got in thouch with them and they sent me the sys

Re: [Maya-Python] V Crypt System

2021-09-15 Thread Rudi Hammad
oh noI had no idea you can open files disabeling script nodes. 
Bummer...good thing I am not working in security.

El miércoles, 15 de septiembre de 2021 a las 5:02:23 UTC+2, 
justin...@gmail.com escribió:

> On Wed, Sep 15, 2021 at 11:36 AM Rudi Hammad  wrote:
>
>> So I cam up with a evil idea that seems to work.
>> . I create a script node that travels with the scene that will check your 
>> mac address out from a list of valid addresses (that would be the ones 
>> corresponding to the people working remotly on their personal computers).
>>   if the address doesn't match it wont open (it opens a new file for 
>> instance)
>> . So then, lets say that your address is valid. Now you would think that 
>> you can just delete the scriptNode and that's it, right? weI 
>> added a callback that triggers when you delete the scriptNode, that deletes 
>> everything .
>>
>> Of course we can just change that to something less evil, but maybe this 
>> might work? save a scriptnode will what ever callback are needed, and 
>> prevent this script node from bein delete?
>> I don't know...I am starting to lose motivation...
>>
>
> What if I just open the scene file with the option to disable script 
> nodes? If it's somewhat trivial to defeat the security then you have to 
> decide if you are doing this with the goal of absolute security, or just 
> being a deterrent and using security-via-obscurity. If there is any way to 
> get the scene file opened, either by disabling script nodes, or by another 
> binary to ascii conversion that can then edit the script nodes, it kind of 
> makes this pointless if the goal is security.
>
>  
>
>>
>>
>>
>> El lunes, 13 de septiembre de 2021 a las 22:21:47 UTC+2, 
>> justin...@gmail.com escribió:
>>
>>> On Tue, Sep 14, 2021 at 7:52 AM Rudi Hammad  wrote:
>>>
>>>> About V crypt, I got in thouch with them and they sent me the system to 
>>>> test it in demo mode. It work pretty well, but as Justin anticipated and 
>>>> as 
>>>> the video showed, all clients are requiered to have the app.
>>>> So maya is should be launched from V Crypt, and then you can open the 
>>>> encrypted files. Which is not ideal because you are enforcing everyone to 
>>>> purchast their system.
>>>>
>>>> So as an alternatively I tried to do something with addCheckCallback 
>>>> that Marcus mention:
>>>>
>>>> mSceneMsgOpenCheck = OpenMaya.MSceneMessage()
>>>> def licenseCheckOnOpen(*args):  # a function that reads your mac 
>>>> address and if it doesn't match the hardcoded one, it won't open.
>>>>  
>>>> OpenMaya.MSceneMessage.addCheckCallback(mSceneMsgOpenCheck.kBeforeOpenCheck,
>>>>  
>>>> licenseCheckOnOpen)
>>>>
>>>> but that was a total failit work is you execute that at the 
>>>> beginning of every maya session (for instance putting it in the 
>>>> userSetup.py),  but then you just have to find this part of the code and 
>>>> remove it...
>>>>
>>>> ps: let me know if this last part is offtopic and I'll just shut up 
>>>> about it.
>>>>
>>>
>>> Oh I didn't even connect your MEL and callback questions to this topic. 
>>> I see now that you were experimenting with related custom approaches. 
>>>
>>> Yea I agree with you that it would be cumbersome to require everyone to 
>>> purchase some encryption app license. But maybe the approach is that a temp 
>>> license is given to the client on behalf of the owner of the media and the 
>>> one imposing the workflow? Having full ownership of the Maya process, as V 
>>> Crypt wants to do, seems like the only way to get close enough to securing 
>>> the media. If you ever let the user have direct unregulated access to the 
>>> source then they can disable whatever checks (callbacks or whatever). 
>>> "Close enough" is maybe just making it hard enough to avoid mistakes and 
>>> easily sharing things? 
>>>  
>>>
>>>>
>>>> El lunes, 13 de septiembre de 2021 a las 19:22:37 UTC+2, Rudi Hammad 
>>>> escribió:
>>>>
>>>>> It was still kind in the context of encrypting a maya scene that 
>>>>> derived from the main V Crypt topic, but we'll do.
>>>>> El lunes, 13 de septiembre de 2021 a las 19:07:28 UTC+2, 
>>>>> justin...@gmail.com escribió:
>>>>>

Re: [Maya-Python] V Crypt System

2021-09-14 Thread Rudi Hammad
So I cam up with a evil idea that seems to work.
. I create a script node that travels with the scene that will check your 
mac address out from a list of valid addresses (that would be the ones 
corresponding to the people working remotly on their personal computers).
  if the address doesn't match it wont open (it opens a new file for 
instance)
. So then, lets say that your address is valid. Now you would think that 
you can just delete the scriptNode and that's it, right? weI 
added a callback that triggers when you delete the scriptNode, that deletes 
everything .

Of course we can just change that to something less evil, but maybe this 
might work? save a scriptnode will what ever callback are needed, and 
prevent this script node from bein delete?
I don't know...I am starting to lose motivation...



El lunes, 13 de septiembre de 2021 a las 22:21:47 UTC+2, 
justin...@gmail.com escribió:

> On Tue, Sep 14, 2021 at 7:52 AM Rudi Hammad  wrote:
>
>> About V crypt, I got in thouch with them and they sent me the system to 
>> test it in demo mode. It work pretty well, but as Justin anticipated and as 
>> the video showed, all clients are requiered to have the app.
>> So maya is should be launched from V Crypt, and then you can open the 
>> encrypted files. Which is not ideal because you are enforcing everyone to 
>> purchast their system.
>>
>> So as an alternatively I tried to do something with addCheckCallback that 
>> Marcus mention:
>>
>> mSceneMsgOpenCheck = OpenMaya.MSceneMessage()
>> def licenseCheckOnOpen(*args):  # a function that reads your mac address 
>> and if it doesn't match the hardcoded one, it won't open.
>>  
>> OpenMaya.MSceneMessage.addCheckCallback(mSceneMsgOpenCheck.kBeforeOpenCheck, 
>> licenseCheckOnOpen)
>>
>> but that was a total failit work is you execute that at the beginning 
>> of every maya session (for instance putting it in the userSetup.py),  but 
>> then you just have to find this part of the code and remove it...
>>
>> ps: let me know if this last part is offtopic and I'll just shut up about 
>> it.
>>
>
> Oh I didn't even connect your MEL and callback questions to this topic. I 
> see now that you were experimenting with related custom approaches. 
>
> Yea I agree with you that it would be cumbersome to require everyone to 
> purchase some encryption app license. But maybe the approach is that a temp 
> license is given to the client on behalf of the owner of the media and the 
> one imposing the workflow? Having full ownership of the Maya process, as V 
> Crypt wants to do, seems like the only way to get close enough to securing 
> the media. If you ever let the user have direct unregulated access to the 
> source then they can disable whatever checks (callbacks or whatever). 
> "Close enough" is maybe just making it hard enough to avoid mistakes and 
> easily sharing things? 
>  
>
>>
>> El lunes, 13 de septiembre de 2021 a las 19:22:37 UTC+2, Rudi Hammad 
>> escribió:
>>
>>> It was still kind in the context of encrypting a maya scene that derived 
>>> from the main V Crypt topic, but we'll do.
>>> El lunes, 13 de septiembre de 2021 a las 19:07:28 UTC+2, 
>>> justin...@gmail.com escribió:
>>>
>>>> Please make sure to start a new thread if you want to engage in new 
>>>> topics. It seems two completely new questions have been asked since the 
>>>> original thread was started about V Crypt, and are entirely unrelated. 
>>>> Thanks! 
>>>>
>>>> On Tue, 14 Sep 2021, 4:25 am Rudi Hammad,  wrote:
>>>>
>>>>> That's it! thanks Juan
>>>>>
>>>>> El lunes, 13 de septiembre de 2021 a las 15:33:57 UTC+2, Juan Moraga 
>>>>> escribió:
>>>>>
>>>>>> Try using "def onOpenCallBack(*args):" instead. 
>>>>>> Callbacks may pass on arguments to you method, which you can use or 
>>>>>> not. But you need to allow the function to receive these arguments, 
>>>>>> otherwise it will raise an exception.
>>>>>>
>>>>>>
>>>>>> On Mon, 13 Sep 2021, 15:09 Rudi Hammad,  wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>> any idea why this is not working?
>>>>>>> I opened a scene and created this callback, and then saved the scene
>>>>>>>
>>>>>>> def onOpenCallBack():
>>>>>>>print "this is a test"
>>>>>>>
>>>&g

Re: [Maya-Python] V Crypt System

2021-09-13 Thread Rudi Hammad
About V crypt, I got in thouch with them and they sent me the system to 
test it in demo mode. It work pretty well, but as Justin anticipated and as 
the video showed, all clients are requiered to have the app.
So maya is should be launched from V Crypt, and then you can open the 
encrypted files. Which is not ideal because you are enforcing everyone to 
purchast their system.

So as an alternatively I tried to do something with addCheckCallback that 
Marcus mention:

mSceneMsgOpenCheck = OpenMaya.MSceneMessage()
def licenseCheckOnOpen(*args):  # a function that reads your mac address 
and if it doesn't match the hardcoded one, it won't open.
 OpenMaya.MSceneMessage.addCheckCallback(mSceneMsgOpenCheck.kBeforeOpenCheck, 
licenseCheckOnOpen)

but that was a total failit work is you execute that at the beginning 
of every maya session (for instance putting it in the userSetup.py),  but 
then you just have to find this part of the code and remove it...

ps: let me know if this last part is offtopic and I'll just shut up about 
it.

El lunes, 13 de septiembre de 2021 a las 19:22:37 UTC+2, Rudi Hammad 
escribió:

> It was still kind in the context of encrypting a maya scene that derived 
> from the main V Crypt topic, but we'll do.
> El lunes, 13 de septiembre de 2021 a las 19:07:28 UTC+2, 
> justin...@gmail.com escribió:
>
>> Please make sure to start a new thread if you want to engage in new 
>> topics. It seems two completely new questions have been asked since the 
>> original thread was started about V Crypt, and are entirely unrelated. 
>> Thanks! 
>>
>> On Tue, 14 Sep 2021, 4:25 am Rudi Hammad,  wrote:
>>
>>> That's it! thanks Juan
>>>
>>> El lunes, 13 de septiembre de 2021 a las 15:33:57 UTC+2, Juan Moraga 
>>> escribió:
>>>
>>>> Try using "def onOpenCallBack(*args):" instead. 
>>>> Callbacks may pass on arguments to you method, which you can use or 
>>>> not. But you need to allow the function to receive these arguments, 
>>>> otherwise it will raise an exception.
>>>>
>>>>
>>>> On Mon, 13 Sep 2021, 15:09 Rudi Hammad,  wrote:
>>>>
>>>>> Hello,
>>>>> any idea why this is not working?
>>>>> I opened a scene and created this callback, and then saved the scene
>>>>>
>>>>> def onOpenCallBack():
>>>>>print "this is a test"
>>>>>
>>>>> checkCallback = 
>>>>> OpenMaya.MSceneMessage.addCheckCallback(OpenMaya.MSceneMessage.kBeforeOpenCheck,
>>>>>  
>>>>> onOpenCallBack)
>>>>>
>>>>> Now when I open the scene I get this error:
>>>>> # TypeError: onOpenCallBack() takes no arguments (2 given) // 
>>>>> // Warning: line 0: Python callback failed // 
>>>>>
>>>>> but I didn't give any arguments. Why is it saying given 2? are they 
>>>>> *args and **kwargs? Still, any idea why this is not working?
>>>>> Thanks
>>>>>
>>>>> El lunes, 6 de septiembre de 2021 a las 22:23:04 UTC+2, Rudi Hammad 
>>>>> escribió:
>>>>>
>>>>>> oh, about the screenshots. If the rig is encapsulated in a black box, 
>>>>>> maybe it would be possible set a callback preventing from unlocking the 
>>>>>> blackbox?
>>>>>> That way you can check want is inside and take screenshot.
>>>>>>
>>>>>> El lunes, 6 de septiembre de 2021 a las 22:02:29 UTC+2, Rudi Hammad 
>>>>>> escribió:
>>>>>>
>>>>>>> Quick question, I haven't use mel in 4 years now so it is probably 
>>>>>>> something foolish but why is this not working?
>>>>>>>
>>>>>>> string $toEval = "def foo():import uuid; macAddress = 
>>>>>>> uuid.getnode(); return macAddress; foo()";
>>>>>>> string $macAddress = python($toEval);
>>>>>>> print $x;
>>>>>>>
>>>>>>> I would expect $x to print my computer mac address by it is empty.
>>>>>>>
>>>>>>> El lunes, 6 de septiembre de 2021 a las 15:39:02 UTC+2, 
>>>>>>> golu...@gmail.com escribió:
>>>>>>>
>>>>>>>> Marcus, thanks for your comment!
>>>>>>>>
>>>>>>>> When I talked about export I meant not to ma or mb, I meant for 
>>>>>>>> example to alembic 

Re: [Maya-Python] V Crypt System

2021-09-13 Thread Rudi Hammad
It was still kind in the context of encrypting a maya scene that derived 
from the main V Crypt topic, but we'll do.
El lunes, 13 de septiembre de 2021 a las 19:07:28 UTC+2, 
justin...@gmail.com escribió:

> Please make sure to start a new thread if you want to engage in new 
> topics. It seems two completely new questions have been asked since the 
> original thread was started about V Crypt, and are entirely unrelated. 
> Thanks! 
>
> On Tue, 14 Sep 2021, 4:25 am Rudi Hammad,  wrote:
>
>> That's it! thanks Juan
>>
>> El lunes, 13 de septiembre de 2021 a las 15:33:57 UTC+2, Juan Moraga 
>> escribió:
>>
>>> Try using "def onOpenCallBack(*args):" instead. 
>>> Callbacks may pass on arguments to you method, which you can use or not. 
>>> But you need to allow the function to receive these arguments, otherwise it 
>>> will raise an exception.
>>>
>>>
>>> On Mon, 13 Sep 2021, 15:09 Rudi Hammad,  wrote:
>>>
>>>> Hello,
>>>> any idea why this is not working?
>>>> I opened a scene and created this callback, and then saved the scene
>>>>
>>>> def onOpenCallBack():
>>>>print "this is a test"
>>>>
>>>> checkCallback = 
>>>> OpenMaya.MSceneMessage.addCheckCallback(OpenMaya.MSceneMessage.kBeforeOpenCheck,
>>>>  
>>>> onOpenCallBack)
>>>>
>>>> Now when I open the scene I get this error:
>>>> # TypeError: onOpenCallBack() takes no arguments (2 given) // 
>>>> // Warning: line 0: Python callback failed // 
>>>>
>>>> but I didn't give any arguments. Why is it saying given 2? are they 
>>>> *args and **kwargs? Still, any idea why this is not working?
>>>> Thanks
>>>>
>>>> El lunes, 6 de septiembre de 2021 a las 22:23:04 UTC+2, Rudi Hammad 
>>>> escribió:
>>>>
>>>>> oh, about the screenshots. If the rig is encapsulated in a black box, 
>>>>> maybe it would be possible set a callback preventing from unlocking the 
>>>>> blackbox?
>>>>> That way you can check want is inside and take screenshot.
>>>>>
>>>>> El lunes, 6 de septiembre de 2021 a las 22:02:29 UTC+2, Rudi Hammad 
>>>>> escribió:
>>>>>
>>>>>> Quick question, I haven't use mel in 4 years now so it is probably 
>>>>>> something foolish but why is this not working?
>>>>>>
>>>>>> string $toEval = "def foo():import uuid; macAddress = uuid.getnode(); 
>>>>>> return macAddress; foo()";
>>>>>> string $macAddress = python($toEval);
>>>>>> print $x;
>>>>>>
>>>>>> I would expect $x to print my computer mac address by it is empty.
>>>>>>
>>>>>> El lunes, 6 de septiembre de 2021 a las 15:39:02 UTC+2, 
>>>>>> golu...@gmail.com escribió:
>>>>>>
>>>>>>> Marcus, thanks for your comment!
>>>>>>>
>>>>>>> When I talked about export I meant not to ma or mb, I meant for 
>>>>>>> example to alembic or other,  because as I knew alembic export is like 
>>>>>>> a 
>>>>>>> separate plugin, and .correct me if I am wrong export to alembic will 
>>>>>>> be 
>>>>>>> ignored by this callback.
>>>>>>>
>>>>>>> I've not understood you, sorry, yes it is already protected, but if 
>>>>>>> this protected scene to /myrig.mb will be referenced in the main scene, 
>>>>>>> during the main parent scene opening, I will need to decrypt my rig.mb 
>>>>>>> and 
>>>>>>> any other child scene which is referenced and send to a remote worker,
>>>>>>> or I understand you wrong)
>>>>>>>
>>>>>>> About RAM I'm sorry, that's my mistake, later edited the message, 
>>>>>>> but was too late, you absolutely right!
>>>>>>>
>>>>>>> понедельник, 6 сентября 2021 г. в 13:27:48 UTC+3, Marcus Ottosson: 
>>>>>>>
>>>>>>>> The part of Maya that does the serialisation to ma and mb - be it 
>>>>>>>> via export or save - is a singular point of access. The scene 
>>>>>>>> callbacks 
>>>>>>>> should accoun

Re: [Maya-Python] V Crypt System

2021-09-13 Thread Rudi Hammad
That's it! thanks Juan

El lunes, 13 de septiembre de 2021 a las 15:33:57 UTC+2, Juan Moraga 
escribió:

> Try using "def onOpenCallBack(*args):" instead. 
> Callbacks may pass on arguments to you method, which you can use or not. 
> But you need to allow the function to receive these arguments, otherwise it 
> will raise an exception.
>
>
> On Mon, 13 Sep 2021, 15:09 Rudi Hammad,  wrote:
>
>> Hello,
>> any idea why this is not working?
>> I opened a scene and created this callback, and then saved the scene
>>
>> def onOpenCallBack():
>>print "this is a test"
>>
>> checkCallback = 
>> OpenMaya.MSceneMessage.addCheckCallback(OpenMaya.MSceneMessage.kBeforeOpenCheck,
>>  
>> onOpenCallBack)
>>
>> Now when I open the scene I get this error:
>> # TypeError: onOpenCallBack() takes no arguments (2 given) // 
>> // Warning: line 0: Python callback failed // 
>>
>> but I didn't give any arguments. Why is it saying given 2? are they *args 
>> and **kwargs? Still, any idea why this is not working?
>> Thanks
>>
>> El lunes, 6 de septiembre de 2021 a las 22:23:04 UTC+2, Rudi Hammad 
>> escribió:
>>
>>> oh, about the screenshots. If the rig is encapsulated in a black box, 
>>> maybe it would be possible set a callback preventing from unlocking the 
>>> blackbox?
>>> That way you can check want is inside and take screenshot.
>>>
>>> El lunes, 6 de septiembre de 2021 a las 22:02:29 UTC+2, Rudi Hammad 
>>> escribió:
>>>
>>>> Quick question, I haven't use mel in 4 years now so it is probably 
>>>> something foolish but why is this not working?
>>>>
>>>> string $toEval = "def foo():import uuid; macAddress = uuid.getnode(); 
>>>> return macAddress; foo()";
>>>> string $macAddress = python($toEval);
>>>> print $x;
>>>>
>>>> I would expect $x to print my computer mac address by it is empty.
>>>>
>>>> El lunes, 6 de septiembre de 2021 a las 15:39:02 UTC+2, 
>>>> golu...@gmail.com escribió:
>>>>
>>>>> Marcus, thanks for your comment!
>>>>>
>>>>> When I talked about export I meant not to ma or mb, I meant for 
>>>>> example to alembic or other,  because as I knew alembic export is like a 
>>>>> separate plugin, and .correct me if I am wrong export to alembic will be 
>>>>> ignored by this callback.
>>>>>
>>>>> I've not understood you, sorry, yes it is already protected, but if 
>>>>> this protected scene to /myrig.mb will be referenced in the main scene, 
>>>>> during the main parent scene opening, I will need to decrypt my rig.mb 
>>>>> and 
>>>>> any other child scene which is referenced and send to a remote worker,
>>>>> or I understand you wrong)
>>>>>
>>>>> About RAM I'm sorry, that's my mistake, later edited the message, but 
>>>>> was too late, you absolutely right!
>>>>>
>>>>> понедельник, 6 сентября 2021 г. в 13:27:48 UTC+3, Marcus Ottosson: 
>>>>>
>>>>>> The part of Maya that does the serialisation to ma and mb - be it via 
>>>>>> export or save - is a singular point of access. The scene callbacks 
>>>>>> should 
>>>>>> account for all ways in which creating those is possible, including via 
>>>>>> Python and MEL. It wouldn’t account for manual export to other formats, 
>>>>>> but 
>>>>>> there’s no end to that. Screenshotting your viewport is a format too, 
>>>>>> albeit a lossy one. But I’d argue that depending on what you want to 
>>>>>> protect, if that is rigs and animation, the Maya scene format should be 
>>>>>> enough.
>>>>>>
>>>>>>- OpenMaya.MSceneMessage.addCheckCallback() 
>>>>>>
>>>>>> <https://help.autodesk.com/view/MAYAUL/2020/ENU/?guid=__py_ref_class_open_maya_1_1_m_scene_message_html#a2c26fb924ad7939fd6bf50253044a7d3>
>>>>>>  
>>>>>>
>>>>>> And all of it must be done recursively on the whole data tree in scene
>>>>>>
>>>>>> I’d argue not. The information you protect is the information in the 
>>>>>> scene file. If that scene file consists of an absolute path to e.g. 
>>>>>> c:\myassets\myrig.mb 

Re: [Maya-Python] V Crypt System

2021-09-13 Thread Rudi Hammad
Hello,
any idea why this is not working?
I opened a scene and created this callback, and then saved the scene

def onOpenCallBack():
   print "this is a test"

checkCallback = 
OpenMaya.MSceneMessage.addCheckCallback(OpenMaya.MSceneMessage.kBeforeOpenCheck,
 
onOpenCallBack)

Now when I open the scene I get this error:
# TypeError: onOpenCallBack() takes no arguments (2 given) // 
// Warning: line 0: Python callback failed // 

but I didn't give any arguments. Why is it saying given 2? are they *args 
and **kwargs? Still, any idea why this is not working?
Thanks

El lunes, 6 de septiembre de 2021 a las 22:23:04 UTC+2, Rudi Hammad 
escribió:

> oh, about the screenshots. If the rig is encapsulated in a black box, 
> maybe it would be possible set a callback preventing from unlocking the 
> blackbox?
> That way you can check want is inside and take screenshot.
>
> El lunes, 6 de septiembre de 2021 a las 22:02:29 UTC+2, Rudi Hammad 
> escribió:
>
>> Quick question, I haven't use mel in 4 years now so it is probably 
>> something foolish but why is this not working?
>>
>> string $toEval = "def foo():import uuid; macAddress = uuid.getnode(); 
>> return macAddress; foo()";
>> string $macAddress = python($toEval);
>> print $x;
>>
>> I would expect $x to print my computer mac address by it is empty.
>>
>> El lunes, 6 de septiembre de 2021 a las 15:39:02 UTC+2, golu...@gmail.com 
>> escribió:
>>
>>> Marcus, thanks for your comment!
>>>
>>> When I talked about export I meant not to ma or mb, I meant for example 
>>> to alembic or other,  because as I knew alembic export is like a separate 
>>> plugin, and .correct me if I am wrong export to alembic will be ignored by 
>>> this callback.
>>>
>>> I've not understood you, sorry, yes it is already protected, but if this 
>>> protected scene to /myrig.mb will be referenced in the main scene, during 
>>> the main parent scene opening, I will need to decrypt my rig.mb and any 
>>> other child scene which is referenced and send to a remote worker,
>>> or I understand you wrong)
>>>
>>> About RAM I'm sorry, that's my mistake, later edited the message, but 
>>> was too late, you absolutely right!
>>>
>>> понедельник, 6 сентября 2021 г. в 13:27:48 UTC+3, Marcus Ottosson: 
>>>
>>>> The part of Maya that does the serialisation to ma and mb - be it via 
>>>> export or save - is a singular point of access. The scene callbacks should 
>>>> account for all ways in which creating those is possible, including via 
>>>> Python and MEL. It wouldn’t account for manual export to other formats, 
>>>> but 
>>>> there’s no end to that. Screenshotting your viewport is a format too, 
>>>> albeit a lossy one. But I’d argue that depending on what you want to 
>>>> protect, if that is rigs and animation, the Maya scene format should be 
>>>> enough.
>>>>
>>>>- OpenMaya.MSceneMessage.addCheckCallback() 
>>>>
>>>> <https://help.autodesk.com/view/MAYAUL/2020/ENU/?guid=__py_ref_class_open_maya_1_1_m_scene_message_html#a2c26fb924ad7939fd6bf50253044a7d3>
>>>>  
>>>>
>>>> And all of it must be done recursively on the whole data tree in scene
>>>>
>>>> I’d argue not. The information you protect is the information in the 
>>>> scene file. If that scene file consists of an absolute path to e.g. 
>>>> c:\myassets\myrig.mb then that is *already* protected; nobody can 
>>>> access that file but you on your local machine.
>>>>
>>>> so at some point how to handle your RAM memory, because you can’t store 
>>>> this encrypted data somewhere…)
>>>>
>>>> I’d argue not (again :)). Is it to protect against hacker-animators and 
>>>> hacker-riggers? Or against the general workforce that has no clue about 
>>>> callbacks and encryption? If the latter, then saving it into a temp 
>>>> directory first, and encrypting it after should suffice. To the user, the 
>>>> file would end up where they said it should. But really, it’s a different 
>>>> file altogether. Then that file is copied back into a temp directory and 
>>>> decrypted whenever they open it. All of that can happen on disk.
>>>>
>>>> And besides, memory is just another location. A motivated-enough 
>>>> hacker-animator could access RAM as easily as any location on disk. 
>>>> Doesn’t 
>>>> increase t

Re: [Maya-Python] V Crypt System

2021-09-06 Thread Rudi Hammad
oh, about the screenshots. If the rig is encapsulated in a black box, maybe 
it would be possible set a callback preventing from unlocking the blackbox?
That way you can check want is inside and take screenshot.

El lunes, 6 de septiembre de 2021 a las 22:02:29 UTC+2, Rudi Hammad 
escribió:

> Quick question, I haven't use mel in 4 years now so it is probably 
> something foolish but why is this not working?
>
> string $toEval = "def foo():import uuid; macAddress = uuid.getnode(); 
> return macAddress; foo()";
> string $macAddress = python($toEval);
> print $x;
>
> I would expect $x to print my computer mac address by it is empty.
>
> El lunes, 6 de septiembre de 2021 a las 15:39:02 UTC+2, golu...@gmail.com 
> escribió:
>
>> Marcus, thanks for your comment!
>>
>> When I talked about export I meant not to ma or mb, I meant for example 
>> to alembic or other,  because as I knew alembic export is like a separate 
>> plugin, and .correct me if I am wrong export to alembic will be ignored by 
>> this callback.
>>
>> I've not understood you, sorry, yes it is already protected, but if this 
>> protected scene to /myrig.mb will be referenced in the main scene, during 
>> the main parent scene opening, I will need to decrypt my rig.mb and any 
>> other child scene which is referenced and send to a remote worker,
>> or I understand you wrong)
>>
>> About RAM I'm sorry, that's my mistake, later edited the message, but was 
>> too late, you absolutely right!
>>
>> понедельник, 6 сентября 2021 г. в 13:27:48 UTC+3, Marcus Ottosson: 
>>
>>> The part of Maya that does the serialisation to ma and mb - be it via 
>>> export or save - is a singular point of access. The scene callbacks should 
>>> account for all ways in which creating those is possible, including via 
>>> Python and MEL. It wouldn’t account for manual export to other formats, but 
>>> there’s no end to that. Screenshotting your viewport is a format too, 
>>> albeit a lossy one. But I’d argue that depending on what you want to 
>>> protect, if that is rigs and animation, the Maya scene format should be 
>>> enough.
>>>
>>>- OpenMaya.MSceneMessage.addCheckCallback() 
>>>
>>> <https://help.autodesk.com/view/MAYAUL/2020/ENU/?guid=__py_ref_class_open_maya_1_1_m_scene_message_html#a2c26fb924ad7939fd6bf50253044a7d3>
>>>  
>>>
>>> And all of it must be done recursively on the whole data tree in scene
>>>
>>> I’d argue not. The information you protect is the information in the 
>>> scene file. If that scene file consists of an absolute path to e.g. 
>>> c:\myassets\myrig.mb then that is *already* protected; nobody can 
>>> access that file but you on your local machine.
>>>
>>> so at some point how to handle your RAM memory, because you can’t store 
>>> this encrypted data somewhere…)
>>>
>>> I’d argue not (again :)). Is it to protect against hacker-animators and 
>>> hacker-riggers? Or against the general workforce that has no clue about 
>>> callbacks and encryption? If the latter, then saving it into a temp 
>>> directory first, and encrypting it after should suffice. To the user, the 
>>> file would end up where they said it should. But really, it’s a different 
>>> file altogether. Then that file is copied back into a temp directory and 
>>> decrypted whenever they open it. All of that can happen on disk.
>>>
>>> And besides, memory is just another location. A motivated-enough 
>>> hacker-animator could access RAM as easily as any location on disk. Doesn’t 
>>> increase the level of protection.
>>>
>>> On Mon, 6 Sept 2021 at 11:02, Andrew Golubev  wrote:
>>>
>>>> It is a very interesting discussion.  
>>>>
>>>> Yeah, I will agree that it definitely must be invisible - so artists 
>>>> don't even know that encryption happened.
>>>> But you can't stop on scene saving and loading, you should create lots 
>>>> of workarounds in this "secure Maya client".
>>>> Somehow you need to lock any exporting of data inside in any format, 
>>>> hide\lock\encrypt code of all used inside scripts, lock any new plugin 
>>>> loading\or current plugins disabling. 
>>>> And lock script editor, or make some sort of interceptor, to ensure, 
>>>> that no script will run to export or explore private scene data. 
>>>> Also, if I understand all correctly, it will give a lot of restrictions 
>

Re: [Maya-Python] V Crypt System

2021-09-06 Thread Rudi Hammad
;> All of it must be done recursively on the whole data tree in scene,
>>> so at some point how to handle your RAM memory, because you can't store 
>>> this encrypted data somewhere.
>>>
>>> And even this will not save you from attempt to try take this decrypted 
>>> data from RAM...
>>> воскресенье, 5 сентября 2021 г. в 10:27:53 UTC+3, Marcus Ottosson: 
>>>
>>>> I agree with you. This would not solve all problems with working 
>>>> remotely, but it would solve some. Perhaps the biggest problems, namely 
>>>> accidental sharing and theft. I have also personally received material 
>>>> from 
>>>> artists at studios that really shouldn't have managed to leave the studio. 
>>>> Some even have limited internet access with local browsers accessible only 
>>>> through a virtual machine or local VNC connection, and assets *still* 
>>>> manage to leave the premises.
>>>>
>>>> That not only puts the studio at risk, but the recipient too. Both as a 
>>>> private person, as now your machine can leak confidential material, and as 
>>>> another business. If a leak should happen that leads to loss of cash for 
>>>> any larger entity such as WB there will be investigations and 
>>>> consequences. 
>>>> Private persons can get in trouble and businesses can crumble.
>>>>
>>>> The part I'm sceptical about is whether this particular tool is what 
>>>> solves this problem. If it complicates saving and loading of scenes (and 
>>>> even launching of Maya?) then I'd imagine people simply would not use it. 
>>>> But the idea sounds worth exploring, so off the top of my head I would try 
>>>> implementing a scene save/open callback to perform the encryption live and 
>>>> natively, rather than rely on an external tool. It could be as simple as 
>>>> letting Maya produce that binary `.mb` file of 1's and 0's, and reversing 
>>>> the whole thing on save, and then do the opposite on load. No one would 
>>>> know it happened, and it would unlikely have any noticeable effect on 
>>>> save/load time, and there are equal callbacks for exporting.
>>>>
>>>> On Sat, 4 Sept 2021 at 22:26, Rudi Hammad  wrote:
>>>>
>>>>> I think they must have thought about the export aswell. Otherwise it 
>>>>> wouldn't make any sense.
>>>>> Of course ideally you would each person would work in their office 
>>>>> stations remotly, but it is not up to me. So if I choose not work with a 
>>>>> client unless he guaranties remote workstation solutions, I will loose a 
>>>>> lot of work.
>>>>> Also  many studios have not the resources , and even if they do, the 
>>>>> lag is some times to high to work remotly.
>>>>>
>>>>> Many times sharing is accidental due to the lack of control, or 
>>>>> planning in a production. In my experience I was doing a freelance work a 
>>>>> couple of month a go. And we where all working remotly in our personal 
>>>>> computers.
>>>>> The supervisor at somepoint, sent me a rig from another project as a 
>>>>> reference. So obviously that was accidental because working in this 
>>>>> situations like that, you do always thing that you are doing anywrong.
>>>>> So even if you sign NDAs, and you have good intentions, it can leak. 
>>>>> And of course, there is always people with bad intentions, so we can't be 
>>>>> naive thinking that everyone will be professional. I work with a guy who 
>>>>> managed
>>>>> to get rigs that he shouldn't have. When I asked how did he get them, 
>>>>> he told me he took them out of the office in his last day.
>>>>>
>>>>> My point being, that with a system like V Crypt, wheter it is by 
>>>>> accident or not, it might be the solution to encrypt files and safely 
>>>>> work 
>>>>> as freelance (specially for me since now I am full time freelancer)
>>>>>
>>>>> I'll keep you posted
>>>>>
>>>>> El sábado, 4 de septiembre de 2021 a las 22:59:06 UTC+2, 
>>>>> justin...@gmail.com escribió:
>>>>>
>>>>>> On Sun, Sep 5, 2021 at 8:38 AM Marcus Ottosson  
>>>>>> wrote:
>>>>>>
>>>>>>> That is true, that doe

Re: [Maya-Python] V Crypt System

2021-09-04 Thread Rudi Hammad
I think they must have thought about the export aswell. Otherwise it 
wouldn't make any sense.
Of course ideally you would each person would work in their office stations 
remotly, but it is not up to me. So if I choose not work with a client 
unless he guaranties remote workstation solutions, I will loose a lot of 
work.
Also  many studios have not the resources , and even if they do, the lag is 
some times to high to work remotly.

Many times sharing is accidental due to the lack of control, or planning in 
a production. In my experience I was doing a freelance work a couple of 
month a go. And we where all working remotly in our personal computers.
The supervisor at somepoint, sent me a rig from another project as a 
reference. So obviously that was accidental because working in this 
situations like that, you do always thing that you are doing anywrong.
So even if you sign NDAs, and you have good intentions, it can leak. And of 
course, there is always people with bad intentions, so we can't be naive 
thinking that everyone will be professional. I work with a guy who managed
to get rigs that he shouldn't have. When I asked how did he get them, he 
told me he took them out of the office in his last day.

My point being, that with a system like V Crypt, wheter it is by accident 
or not, it might be the solution to encrypt files and safely work as 
freelance (specially for me since now I am full time freelancer)

I'll keep you posted

El sábado, 4 de septiembre de 2021 a las 22:59:06 UTC+2, 
justin...@gmail.com escribió:

> On Sun, Sep 5, 2021 at 8:38 AM Marcus Ottosson  
> wrote:
>
>> That is true, that does sound like a good idea. Assuming the software 
>> actually does what it says on the tin, it would at least protect against 
>> theft and accidental sharing.
>>
>> It wouldn’t protect against sending files though, because if someone 
>> wanted to send some model or some rig, they could still just export it to a 
>> new .ma? For that, you’d probably be better off intermingling it with 
>> custom nodes. Like how anything rigged with mGear is riddled with mGear 
>> nodes, making anyone attempting to open that rig without mGear loaded left 
>> with a sorely broken rig. And no amount of exporting or tampering with the 
>> scene file could fix it.
>>
> From the video it looks like you have to launch Maya from their launcher, 
> which I assume installs a particular reader/writer plugin. I wonder if it's 
> specific to ma/mb file types or if it hooks into every type. Because I was 
> thinking that same thing you said about exporting to other formats, and 
> would that go through the same hook?  Also once Maya is launched, could 
> someone turn off the plugin after the scene is loaded?
>
> When it comes to protecting stuff like code, usually you hear the best 
> security is to just never let the source get onto the client side. But with 
> DCC scene files if you have to work with them locally then it feels like 
> there is going to be some way to defeat it. Once its unencrypted in the 
> DCC, there must be a weakness that might just be more obscure to many 
> people and the security is really just focused on the obvious act of 
> copying files around. Probably the better approach is just not letting 
> people work on their person workstations and only support a remote 
> workstation solution like teradici.
>  
>
>>
>> On Sat, 4 Sept 2021 at 19:50, Rudi Hammad  wrote:
>>
>>> Yes I am refereing to the actual file, not source code.
>>> Here's a usecase:
>>> due to covid a lot of production are done remotly. In somecase you can 
>>> connect  by logging remotly to office computers to work, in which case no 
>>> protection is needed since it pretty much as if you where in the office.
>>> But in many cases, the files are sent to personal computers. Let's say  
>>> you rig  characters  that are sent to 10 different animators to their 
>>> personal computers. Despite the NDAs, its impossible to police everyone,
>>> specially if you don't know the client but you don't want to miss the 
>>> opportunity to get a job. There is no guaranty that someone will not leak 
>>> the file outside the production.
>>> So here is where you use in V Crypt system. It is not like you are 
>>> recieving a file from an untrusted source because you are part of a 
>>> production and you know that your .mb and .ma files are from the rigger not 
>>> form a the prince
>>> of niggeria that is asking you for money XD.
>>>
>>> That's seem a pretty secure way of working don't you think? you know you 
>>> recieve a file that is encrypted because you know you are in producti

Re: [Maya-Python] V Crypt System

2021-09-04 Thread Rudi Hammad
oh yea, nothing protects it from sending it to anyone, but you can encrypt 
the MAC address of your client's computer, so if it doesn't match it won't 
open. Or something like that.
Maybe you ask the client to give you his MAX address and generate a license 
number mapped to it.

El sábado, 4 de septiembre de 2021 a las 22:38:20 UTC+2, Marcus Ottosson 
escribió:

> That is true, that does sound like a good idea. Assuming the software 
> actually does what it says on the tin, it would at least protect against 
> theft and accidental sharing.
>
> It wouldn’t protect against sending files though, because if someone 
> wanted to send some model or some rig, they could still just export it to a 
> new .ma? For that, you’d probably be better off intermingling it with 
> custom nodes. Like how anything rigged with mGear is riddled with mGear 
> nodes, making anyone attempting to open that rig without mGear loaded left 
> with a sorely broken rig. And no amount of exporting or tampering with the 
> scene file could fix it.
>
> On Sat, 4 Sept 2021 at 19:50, Rudi Hammad  wrote:
>
>> Yes I am refereing to the actual file, not source code.
>> Here's a usecase:
>> due to covid a lot of production are done remotly. In somecase you can 
>> connect  by logging remotly to office computers to work, in which case no 
>> protection is needed since it pretty much as if you where in the office.
>> But in many cases, the files are sent to personal computers. Let's say  
>> you rig  characters  that are sent to 10 different animators to their 
>> personal computers. Despite the NDAs, its impossible to police everyone,
>> specially if you don't know the client but you don't want to miss the 
>> opportunity to get a job. There is no guaranty that someone will not leak 
>> the file outside the production.
>> So here is where you use in V Crypt system. It is not like you are 
>> recieving a file from an untrusted source because you are part of a 
>> production and you know that your .mb and .ma files are from the rigger not 
>> form a the prince
>> of niggeria that is asking you for money XD.
>>
>> That's seem a pretty secure way of working don't you think? you know you 
>> recieve a file that is encrypted because you know you are in production 
>> context. You can open it and work with it. It simply won't work outside you
>> computer.
>> El sábado, 4 de septiembre de 2021 a las 20:06:47 UTC+2, Marcus Ottosson 
>> escribió:
>>
>>> To protect the contents of a Maya file? Typically protection would 
>>> involve software, like Python source, but you mean to protect like a model 
>>> or some animation? At that point, why wouldn’t you just hold onto the file, 
>>> and not send it or make it publicly available? Maybe you have a particualr 
>>> usecase in mind, because I can’t quite see it.
>>>
>>> Also I would be most weary opening an .mb from an untrusted source. 
>>> That’s what .ma is for, so you can inspect it for any script-related 
>>> things. I’ve been bitten before and, as they saying goes, fool me once.
>>>
>>> On Sat, 4 Sept 2021 at 16:17, Rudi Hammad  wrote:
>>>
>>>> Hi,
>>>> a while a go I create a thread about protecting your work.
>>>> Along the same lines I saw this
>>>>
>>>> V Crypt maya files <https://www.youtube.com/watch?v=kZc2-FcLuiI>
>>>>
>>>> So in theory, you can generate a license for the computer mac address, 
>>>> and inside your
>>>> .ma and .mb so some kind of assertion make sure sure that the file is 
>>>> being open in the right computer. And since both files are crypted, you 
>>>> can 
>>>> remove that block of the code.
>>>> Also, if you try to saveAs, it is saved with th crypted format.
>>>>
>>>> It seems like a good solution right? what do you think?
>>>>
>>>> R
>>>>
>>>> -- 
>>>> 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_m...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/python_inside_maya/a1c4949b-eead-412d-b10a-6750ab07ef85n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/python_inside_maya/a1c4949b-eead-412d-b10a-6750ab07ef85n%40googlegroups.com?utm_medium=email&am

Re: [Maya-Python] V Crypt System

2021-09-04 Thread Rudi Hammad
I don't know about the export...h..., but saveas is safe. I am talking 
with them via email and that's what they said. I will ask about the export 
too.
(About custom nodes I am not using any at the moment, I might implement 
that later as an alternative option to the client. It is all maya nodes)

El sábado, 4 de septiembre de 2021 a las 22:38:20 UTC+2, Marcus Ottosson 
escribió:

> That is true, that does sound like a good idea. Assuming the software 
> actually does what it says on the tin, it would at least protect against 
> theft and accidental sharing.
>
> It wouldn’t protect against sending files though, because if someone 
> wanted to send some model or some rig, they could still just export it to a 
> new .ma? For that, you’d probably be better off intermingling it with 
> custom nodes. Like how anything rigged with mGear is riddled with mGear 
> nodes, making anyone attempting to open that rig without mGear loaded left 
> with a sorely broken rig. And no amount of exporting or tampering with the 
> scene file could fix it.
>
> On Sat, 4 Sept 2021 at 19:50, Rudi Hammad  wrote:
>
>> Yes I am refereing to the actual file, not source code.
>> Here's a usecase:
>> due to covid a lot of production are done remotly. In somecase you can 
>> connect  by logging remotly to office computers to work, in which case no 
>> protection is needed since it pretty much as if you where in the office.
>> But in many cases, the files are sent to personal computers. Let's say  
>> you rig  characters  that are sent to 10 different animators to their 
>> personal computers. Despite the NDAs, its impossible to police everyone,
>> specially if you don't know the client but you don't want to miss the 
>> opportunity to get a job. There is no guaranty that someone will not leak 
>> the file outside the production.
>> So here is where you use in V Crypt system. It is not like you are 
>> recieving a file from an untrusted source because you are part of a 
>> production and you know that your .mb and .ma files are from the rigger not 
>> form a the prince
>> of niggeria that is asking you for money XD.
>>
>> That's seem a pretty secure way of working don't you think? you know you 
>> recieve a file that is encrypted because you know you are in production 
>> context. You can open it and work with it. It simply won't work outside you
>> computer.
>> El sábado, 4 de septiembre de 2021 a las 20:06:47 UTC+2, Marcus Ottosson 
>> escribió:
>>
>>> To protect the contents of a Maya file? Typically protection would 
>>> involve software, like Python source, but you mean to protect like a model 
>>> or some animation? At that point, why wouldn’t you just hold onto the file, 
>>> and not send it or make it publicly available? Maybe you have a particualr 
>>> usecase in mind, because I can’t quite see it.
>>>
>>> Also I would be most weary opening an .mb from an untrusted source. 
>>> That’s what .ma is for, so you can inspect it for any script-related 
>>> things. I’ve been bitten before and, as they saying goes, fool me once.
>>>
>>> On Sat, 4 Sept 2021 at 16:17, Rudi Hammad  wrote:
>>>
>>>> Hi,
>>>> a while a go I create a thread about protecting your work.
>>>> Along the same lines I saw this
>>>>
>>>> V Crypt maya files <https://www.youtube.com/watch?v=kZc2-FcLuiI>
>>>>
>>>> So in theory, you can generate a license for the computer mac address, 
>>>> and inside your
>>>> .ma and .mb so some kind of assertion make sure sure that the file is 
>>>> being open in the right computer. And since both files are crypted, you 
>>>> can 
>>>> remove that block of the code.
>>>> Also, if you try to saveAs, it is saved with th crypted format.
>>>>
>>>> It seems like a good solution right? what do you think?
>>>>
>>>> R
>>>>
>>>> -- 
>>>> 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_m...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/python_inside_maya/a1c4949b-eead-412d-b10a-6750ab07ef85n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/python_inside_maya/a1c4949b-eead-412d-b10a-6750ab07ef85n%40googlegroups.com

Re: [Maya-Python] V Crypt System

2021-09-04 Thread Rudi Hammad
Yes I am refereing to the actual file, not source code.
Here's a usecase:
due to covid a lot of production are done remotly. In somecase you can 
connect  by logging remotly to office computers to work, in which case no 
protection is needed since it pretty much as if you where in the office.
But in many cases, the files are sent to personal computers. Let's say  you 
rig  characters  that are sent to 10 different animators to their personal 
computers. Despite the NDAs, its impossible to police everyone,
specially if you don't know the client but you don't want to miss the 
opportunity to get a job. There is no guaranty that someone will not leak 
the file outside the production.
So here is where you use in V Crypt system. It is not like you are 
recieving a file from an untrusted source because you are part of a 
production and you know that your .mb and .ma files are from the rigger not 
form a the prince
of niggeria that is asking you for money XD.

That's seem a pretty secure way of working don't you think? you know you 
recieve a file that is encrypted because you know you are in production 
context. You can open it and work with it. It simply won't work outside you
computer.
El sábado, 4 de septiembre de 2021 a las 20:06:47 UTC+2, Marcus Ottosson 
escribió:

> To protect the contents of a Maya file? Typically protection would involve 
> software, like Python source, but you mean to protect like a model or some 
> animation? At that point, why wouldn’t you just hold onto the file, and not 
> send it or make it publicly available? Maybe you have a particualr usecase 
> in mind, because I can’t quite see it.
>
> Also I would be most weary opening an .mb from an untrusted source. 
> That’s what .ma is for, so you can inspect it for any script-related 
> things. I’ve been bitten before and, as they saying goes, fool me once.
>
> On Sat, 4 Sept 2021 at 16:17, Rudi Hammad  wrote:
>
>> Hi,
>> a while a go I create a thread about protecting your work.
>> Along the same lines I saw this
>>
>> V Crypt maya files <https://www.youtube.com/watch?v=kZc2-FcLuiI>
>>
>> So in theory, you can generate a license for the computer mac address, 
>> and inside your
>> .ma and .mb so some kind of assertion make sure sure that the file is 
>> being open in the right computer. And since both files are crypted, you can 
>> remove that block of the code.
>> Also, if you try to saveAs, it is saved with th crypted format.
>>
>> It seems like a good solution right? what do you think?
>>
>> R
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/a1c4949b-eead-412d-b10a-6750ab07ef85n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/a1c4949b-eead-412d-b10a-6750ab07ef85n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/e91cc054-a7ce-42d0-8d69-920dfdaa9ffcn%40googlegroups.com.


[Maya-Python] V Crypt System

2021-09-04 Thread Rudi Hammad
Hi,
a while a go I create a thread about protecting your work.
Along the same lines I saw this

V Crypt maya files 

So in theory, you can generate a license for the computer mac address, and 
inside your
.ma and .mb so some kind of assertion make sure sure that the file is being 
open in the right computer. And since both files are crypted, you can 
remove that block of the code.
Also, if you try to saveAs, it is saved with th crypted format.

It seems like a good solution right? what do you think?

R

-- 
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/a1c4949b-eead-412d-b10a-6750ab07ef85n%40googlegroups.com.


[Maya-Python] Re: LayeredTexture node alternative?

2021-09-02 Thread Rudi Hammad
Nop. can't cache shaders attrs. That was a nice conversation with my self 
XD. 

El martes, 31 de agosto de 2021 a las 17:26:00 UTC+2, Rudi Hammad escribió:

> oh, by the way, is it possible to cache the layered texture or any shader 
> with the alembic?
> The only way I can think of doing this is by adding to the geo some  "foo" 
> attribute, connect to it the shader attribute I want, and cache that "foo" 
> attribute.
> Then in the alembic scene I import the shader and connect the attribute 
> cached to the shader's one.
> This works pretty well, but I wonder if I am missing some option that will 
> cache the shader and its's attributes as well
> El lunes, 30 de agosto de 2021 a las 15:52:23 UTC+2, Rudi Hammad escribió:
>
>>
>> Hello,
>>
>> I am trying to do a facial rig using maps. I am using the technique 
>> explained here:
>> wrinkles rig 
>> <https://lesterbanks.com/2019/02/how-to-manage-blendshapes-for-animated-wrinkles/>
>> The results are quite nice but it is very slow. The fps drop down from 
>> 400 fps to 200 fps.
>> I guess that working with textures that overlay each other is heavy to 
>> compute. And with every new texture layer, more the fps drop.
>>
>> Do you know any alternatives to this technicque that is so heavy to 
>> compute?
>>
>> Thanks,
>> R
>>
>>
>>

-- 
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/807e3da8-f531-4b3e-8f2e-f76ff2f9e7cfn%40googlegroups.com.


[Maya-Python] Re: LayeredTexture node alternative?

2021-08-31 Thread Rudi Hammad
oh, by the way, is it possible to cache the layered texture or any shader 
with the alembic?
The only way I can think of doing this is by adding to the geo some  "foo" 
attribute, connect to it the shader attribute I want, and cache that "foo" 
attribute.
Then in the alembic scene I import the shader and connect the attribute 
cached to the shader's one.
This works pretty well, but I wonder if I am missing some option that will 
cache the shader and its's attributes as well
El lunes, 30 de agosto de 2021 a las 15:52:23 UTC+2, Rudi Hammad escribió:

>
> Hello,
>
> I am trying to do a facial rig using maps. I am using the technique 
> explained here:
> wrinkles rig 
> <https://lesterbanks.com/2019/02/how-to-manage-blendshapes-for-animated-wrinkles/>
> The results are quite nice but it is very slow. The fps drop down from 400 
> fps to 200 fps.
> I guess that working with textures that overlay each other is heavy to 
> compute. And with every new texture layer, more the fps drop.
>
> Do you know any alternatives to this technicque that is so heavy to 
> compute?
>
> Thanks,
> R
>
>
>

-- 
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/66c28461-d8ab-48b1-b547-5cdb68ec035bn%40googlegroups.com.


[Maya-Python] LayeredTexture node alternative?

2021-08-30 Thread Rudi Hammad

Hello,

I am trying to do a facial rig using maps. I am using the technique 
explained here:
wrinkles rig 

The results are quite nice but it is very slow. The fps drop down from 400 
fps to 200 fps.
I guess that working with textures that overlay each other is heavy to 
compute. And with every new texture layer, more the fps drop.

Do you know any alternatives to this technicque that is so heavy to compute?

Thanks,
R


-- 
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/fa46311a-9aa4-441b-937b-d310587c3753n%40googlegroups.com.


Re: [Maya-Python] is it possible to not show the error --> # Error: Non-deletable node

2021-08-22 Thread Rudi Hammad
of course! that is must simpler!
thanks.

El domingo, 22 de agosto de 2021 a las 9:29:46 UTC+2, Marcus Ottosson 
escribió:

> My first go-to would be to try cmds.file(new=True, force=True) instead of 
> cmds.delete(), does that work for you?
>
> On Sun, 22 Aug 2021 at 03:09, Rudi Hammad  wrote:
>
>> Hi,
>> this might seem an odd question, but I was wondering if it is possible to 
>> make maya's IDE not showing the error message when you try to delete an 
>> undeletable node.
>> The reason is than when running unitests, sometimes clean the scene wiht 
>> cmds.delete("*"), causing a cascade of # Error: Non-deletable node, which 
>> is a bit annoying.
>>
>> Cheers.
>>
>> R
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/f960c514-f7c1-4ca0-9334-3ed56e41982dn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/f960c514-f7c1-4ca0-9334-3ed56e41982dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/bbd6db1a-32bd-4cc4-acde-8ba6114edb2fn%40googlegroups.com.


[Maya-Python] is it possible to not show the error --> # Error: Non-deletable node

2021-08-21 Thread Rudi Hammad
Hi,
this might seem an odd question, but I was wondering if it is possible to 
make maya's IDE not showing the error message when you try to delete an 
undeletable node.
The reason is than when running unitests, sometimes clean the scene wiht 
cmds.delete("*"), causing a cascade of # Error: Non-deletable node, which 
is a bit annoying.

Cheers.

R

-- 
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/f960c514-f7c1-4ca0-9334-3ed56e41982dn%40googlegroups.com.


Re: [Maya-Python] hugh ik solver maya bug?

2021-08-14 Thread Rudi Hammad
Great, thanks for capturing the bug.
How weird that this wasn't  noticed by autodesk sin ik solvers are used a 
lot in rigging. It happens in maya 2018 and 2019. In 2022 it is fixed. 
Haven't tried 2020 nor 2021

El sábado, 14 de agosto de 2021 a las 9:30:23 UTC+2, Marcus Ottosson 
escribió:

> I got curious and had a look in 2019. It’s a UI issue.
>
> [image: ikwrong2]
>
> Notice how I selected that second joint chain, but am still affecting the 
> first? Bug bug bug.
>
> [image: ikfix]
>
> Here it’s “fixed” by copying the AE. Notice how both AEs tell me it’s 
> editing the same node, ikHandle3. When really, that combobox is being 
> naughty.
>
> On Fri, 13 Aug 2021 at 18:51, Rudi Hammad  wrote:
>
>> it one of thouse things that if I don't capture on video is hard to 
>> believe, but it happened, I promise!! XD
>>
>> El viernes, 13 de agosto de 2021 a las 19:49:31 UTC+2, Rudi Hammad 
>> escribió:
>>
>>> I though that at the beginning, that maybe it just displaying scSolver 
>>> when it actually a RPSolver, but it is not.
>>> I have to complete separate chain. I set the first one as RP solver, and 
>>> the seconde as SC solver. So far so good. Now, Y go to the SC solver one, 
>>> change it to RP solver, and again,
>>> back to the SC solver, and the first chain that is completly unrelated 
>>> and that I am not touching, changes to SC solver too.
>>>
>>> El viernes, 13 de agosto de 2021 a las 17:22:59 UTC+2, vince touache 
>>> escribió:
>>>
>>>> i m not in front of my machine, but isnt it just a gui bug?
>>>>
>>>> Le ven. 13 août 2021 à 06:22, Rudi Hammad  a 
>>>> écrit :
>>>>
>>>>>
>>>>> hello,
>>>>>
>>>>> I noticed something very weird in maya 2018, and 2019 (not in maya 
>>>>> 2022).
>>>>> It is very simple. Let's say we have 2 separate chains or one chain of 
>>>>> joints. The goal is to create two iks. So we create on ik as rotate plane 
>>>>> solver between joint 1 and 3, and another ik as SC solver between joints 
>>>>> 3 
>>>>> and 4 or even in the other chain of joints.
>>>>> This is literally what is happening. When I change the type of any of 
>>>>> the iks, the all become the same type.
>>>>> In fact, if the first Ik I created was rotate plane solver, and the 
>>>>> second a SC solver,  automatically, the firt ik become a SC solver aswell.
>>>>>
>>>>> ¿¿¿???
>>>>> what could be happening?
>>>>>
>>>>> -- 
>>>>> 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_m...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/python_inside_maya/e2db9f31-c233-4a49-bd18-56ac3e0d0ed5n%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/python_inside_maya/e2db9f31-c233-4a49-bd18-56ac3e0d0ed5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>> 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_m...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/09bd9e93-e8b1-40b6-96d9-f4852aa919fcn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/09bd9e93-e8b1-40b6-96d9-f4852aa919fcn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/5b3c3951-9fa0-42cf-976a-75ccc39efd23n%40googlegroups.com.


Re: [Maya-Python] hugh ik solver maya bug?

2021-08-13 Thread Rudi Hammad
it one of thouse things that if I don't capture on video is hard to 
believe, but it happened, I promise!! XD

El viernes, 13 de agosto de 2021 a las 19:49:31 UTC+2, Rudi Hammad escribió:

> I though that at the beginning, that maybe it just displaying scSolver 
> when it actually a RPSolver, but it is not.
> I have to complete separate chain. I set the first one as RP solver, and 
> the seconde as SC solver. So far so good. Now, Y go to the SC solver one, 
> change it to RP solver, and again,
> back to the SC solver, and the first chain that is completly unrelated and 
> that I am not touching, changes to SC solver too.
>
> El viernes, 13 de agosto de 2021 a las 17:22:59 UTC+2, vince touache 
> escribió:
>
>> i m not in front of my machine, but isnt it just a gui bug?
>>
>> Le ven. 13 août 2021 à 06:22, Rudi Hammad  a écrit :
>>
>>>
>>> hello,
>>>
>>> I noticed something very weird in maya 2018, and 2019 (not in maya 2022).
>>> It is very simple. Let's say we have 2 separate chains or one chain of 
>>> joints. The goal is to create two iks. So we create on ik as rotate plane 
>>> solver between joint 1 and 3, and another ik as SC solver between joints 3 
>>> and 4 or even in the other chain of joints.
>>> This is literally what is happening. When I change the type of any of 
>>> the iks, the all become the same type.
>>> In fact, if the first Ik I created was rotate plane solver, and the 
>>> second a SC solver,  automatically, the firt ik become a SC solver aswell.
>>>
>>> ¿¿¿???
>>> what could be happening?
>>>
>>> -- 
>>> 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_m...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/e2db9f31-c233-4a49-bd18-56ac3e0d0ed5n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/python_inside_maya/e2db9f31-c233-4a49-bd18-56ac3e0d0ed5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/09bd9e93-e8b1-40b6-96d9-f4852aa919fcn%40googlegroups.com.


Re: [Maya-Python] hugh ik solver maya bug?

2021-08-13 Thread Rudi Hammad
I though that at the beginning, that maybe it just displaying scSolver when 
it actually a RPSolver, but it is not.
I have to complete separate chain. I set the first one as RP solver, and 
the seconde as SC solver. So far so good. Now, Y go to the SC solver one, 
change it to RP solver, and again,
back to the SC solver, and the first chain that is completly unrelated and 
that I am not touching, changes to SC solver too.

El viernes, 13 de agosto de 2021 a las 17:22:59 UTC+2, vince touache 
escribió:

> i m not in front of my machine, but isnt it just a gui bug?
>
> Le ven. 13 août 2021 à 06:22, Rudi Hammad  a écrit :
>
>>
>> hello,
>>
>> I noticed something very weird in maya 2018, and 2019 (not in maya 2022).
>> It is very simple. Let's say we have 2 separate chains or one chain of 
>> joints. The goal is to create two iks. So we create on ik as rotate plane 
>> solver between joint 1 and 3, and another ik as SC solver between joints 3 
>> and 4 or even in the other chain of joints.
>> This is literally what is happening. When I change the type of any of the 
>> iks, the all become the same type.
>> In fact, if the first Ik I created was rotate plane solver, and the 
>> second a SC solver,  automatically, the firt ik become a SC solver aswell.
>>
>> ¿¿¿???
>> what could be happening?
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/e2db9f31-c233-4a49-bd18-56ac3e0d0ed5n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/e2db9f31-c233-4a49-bd18-56ac3e0d0ed5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/e1ba3067-9611-460b-b769-adf9636609b9n%40googlegroups.com.


[Maya-Python] hugh ik solver maya bug?

2021-08-13 Thread Rudi Hammad

hello,

I noticed something very weird in maya 2018, and 2019 (not in maya 2022).
It is very simple. Let's say we have 2 separate chains or one chain of 
joints. The goal is to create two iks. So we create on ik as rotate plane 
solver between joint 1 and 3, and another ik as SC solver between joints 3 
and 4 or even in the other chain of joints.
This is literally what is happening. When I change the type of any of the 
iks, the all become the same type.
In fact, if the first Ik I created was rotate plane solver, and the second 
a SC solver,  automatically, the firt ik become a SC solver aswell.

¿¿¿???
what could be happening?

-- 
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/e2db9f31-c233-4a49-bd18-56ac3e0d0ed5n%40googlegroups.com.


Re: [Maya-Python] make attribute not keyable

2021-07-25 Thread Rudi Hammad
 edited

"Right-click on rotateX to Key Selected still produces a key, again 
regardless of their non-keyable state."

Yes, sorry, that is what I meant. The "s"  doesn't create the key, but 
right-click and key creates a key. That is what was bugging me.
The solution whould be set connectable to False, but the problem is that if 
you close maya and open a new session  it reverts it to keyable, so it 
doesn't really save if you close your session.

By the way, after running your code, since connectable was set to False, 
any new dag node you create will have the translateX not connectable. Is 
that a static variable and that's 
why it propagates through each new node that is created? we'll need to be 
careful to set back to True.

Interesting stuff...


El domingo, 25 de julio de 2021 a las 20:41:15 UTC+2, Marcus Ottosson 
escribió:

> Yes, the jargon here is terrible. Likely for legacy reasons. (Although I 
> can’t think of which ones exactly? I remember this being fuzzy way back in 
> Maya 4.0)
>
> But, it isn’t true that the s hotkey puts a key on non-keyable 
> attributes, can you confirm?
>
>1. Create cube 
>2. Make translateY, translateZ and rotateX non-keyable 
>3. Hit s 
>
> You should find all attributes in the channel box have a key, except for 
> those three.
>
> But, as far as I know, only the s key respects this attribute. And the s 
> key is mostly a wasted keyboard shortcut. (How often do you intend on 
> keying every single keyable attribute?) More usable means disregards the 
> non-keyable state (perhaps for the better).
>
>1. Shift + w still keys translateY and translateZ, regardless of their 
>non-keyable state 
>2. Right-click on rotateX to Key Selected still produces a key, again 
>regardless of their non-keyable state. 
>
> Some tools do respect the non-keyable state, like Edit -> Bake Simulation 
> and creating a new animation layer.
>
> So, unlike the locked state the non-keyable state is more of a hint. Some 
> metadata that tools may choose whether or not to respect, with a slight 
> hint in the channel box for the animator that the attribute isn’t intended 
> to be keyed. With that in mind, one way of making a channel 100% unkeyable 
> is by making it locked, although that typically isn’t a practical use for 
> the locked state. Another is by making it un-*connectable*, since a keyed 
> channel is merely one that is connected to a keyframe node, like 
> animCurveTL.
>
> I wasn’t able to find a way of doing this via cmds, maybe someone else 
> knows?
>
> from maya.api import OpenMaya as om
>
> cmds.file(new=True, force=True)
> cube, _ = cmds.polyCube()
> sl = om.MSelectionList()
> sl.add(cube)
> mobj = sl.getDependNode(0)
> fn = om.MFnDependencyNode(mobj)
> plug = fn.findPlug("translateX", False)plug.name()
> fna = om.MFnAttribute(plug.attribute())
> fna.connectable = False
>
> cmds.setKeyframe(v=10, at="translateX")  # Fail!
>
> The API does sometime allow metadata like this to be edited without 
> actually being able to save it with the scene (e.g. 
> MFnAttribute.setNiceNameOverride), especially not for native plugs like 
> this one. But this does appear to save and load fine. This would make an 
> attribute truly non-keyable, whilst still allowing it to be *edited* 
> (unlike a locked attribute).
>
> On Wed, 21 Jul 2021 at 12:55, Rudi Hammad  wrote:
>
>>
>> Hello,
>> to make an attribute not keyable you can do it with cmds or mplug or 
>> right click 'make not keyable'. What this does is grey out the channel box, 
>> so if you select the node and set a key typing 's', the attribute is not 
>> keyed. So far so good.
>>
>> Now, this is what I find annoying. Many times when animating you just 
>> select the channel box attributes (so not the node) and type 's'. In this 
>> case even if it set not to be keyable, it will add a key, so it is not 
>> really unkeyable. So is it possible to make it 100% unkeyable?
>>
>>
>> Side note: I find odd that the api uses the method MPlug.setKeyable() to 
>> hide and MPlug.setChannelBox() to make keyable. A bit confusing isn't it?
>>
>> R
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/b210fbff-2a8f-4c63-a914-da9eb7547d5cn%40googlegroups.com
>>  
>> <htt

Re: [Maya-Python] make attribute not keyable

2021-07-25 Thread Rudi Hammad
"Right-click on rotateX to Key Selected still produces a key, again 
regardless of their non-keyable state."

Yes, sorry, that is what I meant. The "s" respects doesn't create the key, 
but right-click key creates. That is what was bugging me.
The solution whould be set connectable to False, but the problem is that if 
you close maya and reopen it reverts it to keyable, so it doesn't really 
save if you close your session.

By the way, after running your code, since connectable was set to False, 
any new dag node you create will have the translateX not connectable. Is 
that a static variable and that's 
why it propagates through each new node that is created? So it could a 
solution, but we'll need to be careful to set back to True.

Interesting stuff...



El domingo, 25 de julio de 2021 a las 20:41:15 UTC+2, Marcus Ottosson 
escribió:

> Yes, the jargon here is terrible. Likely for legacy reasons. (Although I 
> can’t think of which ones exactly? I remember this being fuzzy way back in 
> Maya 4.0)
>
> But, it isn’t true that the s hotkey puts a key on non-keyable 
> attributes, can you confirm?
>
>1. Create cube 
>2. Make translateY, translateZ and rotateX non-keyable 
>3. Hit s 
>
> You should find all attributes in the channel box have a key, except for 
> those three.
>
> But, as far as I know, only the s key respects this attribute. And the s 
> key is mostly a wasted keyboard shortcut. (How often do you intend on 
> keying every single keyable attribute?) More usable means disregards the 
> non-keyable state (perhaps for the better).
>
>1. Shift + w still keys translateY and translateZ, regardless of their 
>non-keyable state 
>2. Right-click on rotateX to Key Selected still produces a key, again 
>regardless of their non-keyable state. 
>
> Some tools do respect the non-keyable state, like Edit -> Bake Simulation 
> and creating a new animation layer.
>
> So, unlike the locked state the non-keyable state is more of a hint. Some 
> metadata that tools may choose whether or not to respect, with a slight 
> hint in the channel box for the animator that the attribute isn’t intended 
> to be keyed. With that in mind, one way of making a channel 100% unkeyable 
> is by making it locked, although that typically isn’t a practical use for 
> the locked state. Another is by making it un-*connectable*, since a keyed 
> channel is merely one that is connected to a keyframe node, like 
> animCurveTL.
>
> I wasn’t able to find a way of doing this via cmds, maybe someone else 
> knows?
>
> from maya.api import OpenMaya as om
>
> cmds.file(new=True, force=True)
> cube, _ = cmds.polyCube()
> sl = om.MSelectionList()
> sl.add(cube)
> mobj = sl.getDependNode(0)
> fn = om.MFnDependencyNode(mobj)
> plug = fn.findPlug("translateX", False)plug.name()
> fna = om.MFnAttribute(plug.attribute())
> fna.connectable = False
>
> cmds.setKeyframe(v=10, at="translateX")  # Fail!
>
> The API does sometime allow metadata like this to be edited without 
> actually being able to save it with the scene (e.g. 
> MFnAttribute.setNiceNameOverride), especially not for native plugs like 
> this one. But this does appear to save and load fine. This would make an 
> attribute truly non-keyable, whilst still allowing it to be *edited* 
> (unlike a locked attribute).
>
> On Wed, 21 Jul 2021 at 12:55, Rudi Hammad  wrote:
>
>>
>> Hello,
>> to make an attribute not keyable you can do it with cmds or mplug or 
>> right click 'make not keyable'. What this does is grey out the channel box, 
>> so if you select the node and set a key typing 's', the attribute is not 
>> keyed. So far so good.
>>
>> Now, this is what I find annoying. Many times when animating you just 
>> select the channel box attributes (so not the node) and type 's'. In this 
>> case even if it set not to be keyable, it will add a key, so it is not 
>> really unkeyable. So is it possible to make it 100% unkeyable?
>>
>>
>> Side note: I find odd that the api uses the method MPlug.setKeyable() to 
>> hide and MPlug.setChannelBox() to make keyable. A bit confusing isn't it?
>>
>> R
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/b210fbff-2a8f-4c63-a914-da9eb7547d5cn%40googlegroups.com
>>  
>> 

[Maya-Python] make attribute not keyable

2021-07-21 Thread Rudi Hammad

Hello,
to make an attribute not keyable you can do it with cmds or mplug or right 
click 'make not keyable'. What this does is grey out the channel box, so if 
you select the node and set a key typing 's', the attribute is not keyed. 
So far so good.

Now, this is what I find annoying. Many times when animating you just 
select the channel box attributes (so not the node) and type 's'. In this 
case even if it set not to be keyable, it will add a key, so it is not 
really unkeyable. So is it possible to make it 100% unkeyable?


Side note: I find odd that the api uses the method MPlug.setKeyable() to 
hide and MPlug.setChannelBox() to make keyable. A bit confusing isn't it?

R

-- 
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/b210fbff-2a8f-4c63-a914-da9eb7547d5cn%40googlegroups.com.


Re: [Maya-Python] OpenMaya MFnTransform setScale() issue

2021-07-16 Thread Rudi Hammad
hmmm..ok, i see. 
Yes, the matrices matched each other , but the scaled axes didn't match. 
What ever I tried, during the conversation it was alway the scaleZ set to 
-1.
Thanks

R

El viernes, 16 de julio de 2021 a las 15:33:21 UTC+2, Marcus Ottosson 
escribió:

> A matrix cannot accurately represent a negative scale along an arbitrary 
> axis. The information along which axis you scale is lost during the 
> conversion from transform into a matrix. The resulting worldspace matrix 
> will be correct, but they may have different decomposed scale (and rotate) 
> values.
>
> - 
> https://forums.autodesk.com/t5/maya-programming/bug-in-mtransformationmatrix/m-p/10024546#M13015
>
> On Fri, 16 Jul 2021 at 14:09, Rudi Hammad  wrote:
>
>>
>> Hello,
>> I am trying to set the scale with OpenMaya and for some reason, it is 
>> setting the 
>> wrong axis. Here is the code:
>>
>> https://pastebin.com/GVYrMUGK
>>
>> What I am doing is creating 2 locators, setting one of them  to -1 in 
>> scaleY, getting the matrix, and then from that matrix extracting the scale 
>> and set that scale to the other locator. But for some reason that I don't 
>> get, the scale set is no the scaleY , but the scaleZ.
>>
>> thoughts?
>>
>> R
>>
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/a949f734-dd9b-4eb9-a1cc-ce9b36748319n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/a949f734-dd9b-4eb9-a1cc-ce9b36748319n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/ad85fea1-d36b-4bf0-ab9d-bd03b5208c73n%40googlegroups.com.


[Maya-Python] OpenMaya MFnTransform setScale() issue

2021-07-16 Thread Rudi Hammad

Hello,
I am trying to set the scale with OpenMaya and for some reason, it is 
setting the 
wrong axis. Here is the code:

https://pastebin.com/GVYrMUGK

What I am doing is creating 2 locators, setting one of them  to -1 in 
scaleY, getting the matrix, and then from that matrix extracting the scale 
and set that scale to the other locator. But for some reason that I don't 
get, the scale set is no the scaleY , but the scaleZ.

thoughts?

R


-- 
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/a949f734-dd9b-4eb9-a1cc-ce9b36748319n%40googlegroups.com.


[Maya-Python] Parallel GPU override slows performance

2021-06-30 Thread Rudi Hammad

Hello,
I am testing the same scene in maya 2018 an maya 2022. Here are the results
in maya 2018 in parallel , NO gpu override --> 140 fps
in maya 2018 in parallel , gpu override --> 90 fps 
in maya 2022 in parallel , NO gpu override --> 170 fps 
in maya 2018 in parallel , gpu override --> 280 fps 

Two think caught my attention. First, maya 2022 almost is twisce as fast 
than 2018 in general. And second, in maya 2018 turning gpu override slows 
down the fps, unlike maya
2022 where you get 100 fps more.

Any thoughts on this? 
Cheers,
R


-- 
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/abeb233c-0f00-493a-b665-a1c3f1804355n%40googlegroups.com.


Re: [Maya-Python] Re: transfer vertex ids between different

2021-06-22 Thread Rudi Hammad
Here are the reason why I prefer the cut out(maya 2022 and previous) :
1. it is cleaner in the sense that you don't need to have an entire body if 
your are just movind points in the head. 
2. the file size where your keep your blendshapes will be smaller. You 
might not notice this is cartoony characters, but if you are working with 
high res geo (like in realistic character) you will feel the impact in size 
and loading times.
3. if the body topology changes, all your facial blendshapes are still 
safe. Even adding an extra loop in the fingers later on will mess up all 
your facial blendshapes.
4. cutting out the head will allow you to display the head with different 
LODs. You might get 24 fps with one char in the scene but if you have 4, i 
hardly see it will keep up to 24 fps. If you cut out the head you can 
display it with a procy
  body so you will have 24 fps with many chars in the scene.

In a nutt shell I find separating the head a cleaner and more optimize 
design. Just do what ever you think is best for your workflow.


El miércoles, 23 de junio de 2021 a las 3:06:45 UTC+2, smann escribió:

> Yes that's what I'm saying Roy, 
>   You no longer need to separate.. as the morph deformer will act like a 
> blendShape to the joined full body/head . 
>
> If you don't need it to be connected.. like the neck goes under a shirt. 
> then sure..   I prefer separate shells,,, ( I am not a multi shell poly 
> fan) 
>
> but for characters where you have the head and neck connection visible as 
> it flows into the body,, then  I don't bother to cut the head off and go 
> thru the rig-a-marole of cutting off and re-ordering and re-connecting 
> hack. 
> Dropping your verts out of the blendShape deformer will result in a 
> similar performance and file size.  or if in 2022 you can use the morph 
> deformer.
>
> -=s
>
> On Tue, Jun 22, 2021 at 8:17 PM Rudi Hammad  wrote:
>
>> By the way I just saw that the solution I came out with it is what he 
>> mentioned in the video. Happy accidents happen after all!
>>
>>
>>
>> El miércoles, 23 de junio de 2021 a las 2:05:30 UTC+2, Rudi Hammad 
>> escribió:
>>
>>> Cool stuff about the morph deformer. I just need something that works 
>>> across previous maya version. Thanks for the ref.
>>> About separating the head it simply how I like to my rigs. I used both 
>>> method in different production and still prefer the cut out.
>>>
>>> El martes, 22 de junio de 2021 a las 23:12:22 UTC+2, Roy Nieterau 
>>> escribió:
>>>
>>>> Not an answer to the question, but the separated mesh rig-blendshape 
>>>> workflow can be much optimized in Maya 2022 using the new Morph deformer: 
>>>> https://youtu.be/Cdow0UVZfBI?t=1605
>>>> In particular the "partial deformation" around 28:10 he states it and 
>>>> starts showing after. :) No need for actual merging of meshes, etc. - 
>>>> That's prone to get slow!
>>>>
>>>> On Tuesday, June 22, 2021 at 11:03:11 PM UTC+2 smann wrote:
>>>>
>>>>> Why are you separating the head.. you don't really need to do that 
>>>>> technique any more , now that there is the morph deformer... 
>>>>>
>>>>> Also, I usually found the performance hit of having a connected head 
>>>>> to body with morph targets was never really that bad.. especially if you 
>>>>> remove the body components from the blend shape. 
>>>>>
>>>>> I'd be curious if the head cutting off is still necessary , and in 
>>>>> what cases.. 
>>>>>
>>>>>
>>>>> -=s
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Jun 22, 2021 at 7:22 AM Hannes Delbeke  
>>>>> wrote:
>>>>>
>>>>>> that's true when it stays separate, but when merging the 2 pieces 
>>>>>> together including merging overlapping verts and vert UV, order for 
>>>>>> those 
>>>>>> merged verts can change
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, 22 Jun 2021 at 12:01, Alok Gandhi  
>>>>>> wrote:
>>>>>>
>>>>>>> Nice!
>>>>>>>
>>>>>>> On Tue, Jun 22, 2021 at 4:30 PM Rudi Hammad  
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Actually I is possible, I did figure out how to do it. If you 
>>>>>>>> separate the head from the body, dup

Re: [Maya-Python] Re: transfer vertex ids between different

2021-06-22 Thread Rudi Hammad
By the way I just saw that the solution I came out with it is what he 
mentioned in the video. Happy accidents happen after all!



El miércoles, 23 de junio de 2021 a las 2:05:30 UTC+2, Rudi Hammad escribió:

> Cool stuff about the morph deformer. I just need something that works 
> across previous maya version. Thanks for the ref.
> About separating the head it simply how I like to my rigs. I used both 
> method in different production and still prefer the cut out.
>
> El martes, 22 de junio de 2021 a las 23:12:22 UTC+2, Roy Nieterau escribió:
>
>> Not an answer to the question, but the separated mesh rig-blendshape 
>> workflow can be much optimized in Maya 2022 using the new Morph deformer: 
>> https://youtu.be/Cdow0UVZfBI?t=1605
>> In particular the "partial deformation" around 28:10 he states it and 
>> starts showing after. :) No need for actual merging of meshes, etc. - 
>> That's prone to get slow!
>>
>> On Tuesday, June 22, 2021 at 11:03:11 PM UTC+2 smann wrote:
>>
>>> Why are you separating the head.. you don't really need to do that 
>>> technique any more , now that there is the morph deformer... 
>>>
>>> Also, I usually found the performance hit of having a connected head to 
>>> body with morph targets was never really that bad.. especially if you 
>>> remove the body components from the blend shape. 
>>>
>>> I'd be curious if the head cutting off is still necessary , and in what 
>>> cases.. 
>>>
>>>
>>> -=s
>>>
>>>
>>>
>>> On Tue, Jun 22, 2021 at 7:22 AM Hannes Delbeke  
>>> wrote:
>>>
>>>> that's true when it stays separate, but when merging the 2 pieces 
>>>> together including merging overlapping verts and vert UV, order for those 
>>>> merged verts can change
>>>>
>>>>
>>>>
>>>>
>>>> On Tue, 22 Jun 2021 at 12:01, Alok Gandhi  wrote:
>>>>
>>>>> Nice!
>>>>>
>>>>> On Tue, Jun 22, 2021 at 4:30 PM Rudi Hammad  
>>>>> wrote:
>>>>>
>>>>>> Actually I is possible, I did figure out how to do it. If you 
>>>>>> separate the head from the body, duplicate the head, and then recombine 
>>>>>> the 
>>>>>> head to the body, vertex order is preserved.
>>>>>> Then you can do a blendshape. I'll probably end up writing a deformer 
>>>>>> anyway, but that's a nice little trick there.
>>>>>>
>>>>>>
>>>>>> El martes, 22 de junio de 2021 a las 12:41:19 UTC+2, 
>>>>>> hannes...@gmail.com escribió:
>>>>>>
>>>>>>> match by vert id is impossible in that case because the vert ids 
>>>>>>> cant ever match, unless you somehow reorder the verts yourself from the 
>>>>>>> mesh with the most verts(the body)
>>>>>>> what i suggest to do instead is match vert by world position, or if 
>>>>>>> you have unique UVs by UV position.
>>>>>>>
>>>>>>> get the closest vert, for every vert. and hook them up in a tuple.
>>>>>>> then use this to do anything you want. ex transfer skinning.
>>>>>>>
>>>>>>> i suggest to do this with openmaya because of speed
>>>>>>> it will be very slow in pymel
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, 22 Jun 2021 at 10:46, Rudi Hammad  
>>>>>>> wrote:
>>>>>>>
>>>>>>>> (so no, meshes whould not have the same number of cvs)
>>>>>>>>
>>>>>>>> El martes, 22 de junio de 2021 a las 11:44:57 UTC+2, Rudi Hammad 
>>>>>>>> escribió:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> yes, i want to have different topologies. The use case would be a 
>>>>>>>>> rig where you have a mesh cut out of the head for the facial rig, 
>>>>>>>>> that you 
>>>>>>>>> blendshape into the full body mesh. So there you have 2 different 
>>>>>>>>> topologies. In maya you can do a blendshape between different 
>>>>>>>>> topologies 
>>>>>>>>> but if the ids don't match you get unwan

Re: [Maya-Python] Re: transfer vertex ids between different

2021-06-22 Thread Rudi Hammad
Cool stuff about the morph deformer. I just need something that works 
across previous maya version. Thanks for the ref.
About separating the head it simply how I like to my rigs. I used both 
method in different production and still prefer the cut out.

El martes, 22 de junio de 2021 a las 23:12:22 UTC+2, Roy Nieterau escribió:

> Not an answer to the question, but the separated mesh rig-blendshape 
> workflow can be much optimized in Maya 2022 using the new Morph deformer: 
> https://youtu.be/Cdow0UVZfBI?t=1605
> In particular the "partial deformation" around 28:10 he states it and 
> starts showing after. :) No need for actual merging of meshes, etc. - 
> That's prone to get slow!
>
> On Tuesday, June 22, 2021 at 11:03:11 PM UTC+2 smann wrote:
>
>> Why are you separating the head.. you don't really need to do that 
>> technique any more , now that there is the morph deformer... 
>>
>> Also, I usually found the performance hit of having a connected head to 
>> body with morph targets was never really that bad.. especially if you 
>> remove the body components from the blend shape. 
>>
>> I'd be curious if the head cutting off is still necessary , and in what 
>> cases.. 
>>
>>
>> -=s
>>
>>
>>
>> On Tue, Jun 22, 2021 at 7:22 AM Hannes Delbeke  
>> wrote:
>>
>>> that's true when it stays separate, but when merging the 2 pieces 
>>> together including merging overlapping verts and vert UV, order for those 
>>> merged verts can change
>>>
>>>
>>>
>>>
>>> On Tue, 22 Jun 2021 at 12:01, Alok Gandhi  wrote:
>>>
>>>> Nice!
>>>>
>>>> On Tue, Jun 22, 2021 at 4:30 PM Rudi Hammad  wrote:
>>>>
>>>>> Actually I is possible, I did figure out how to do it. If you separate 
>>>>> the head from the body, duplicate the head, and then recombine the head 
>>>>> to 
>>>>> the body, vertex order is preserved.
>>>>> Then you can do a blendshape. I'll probably end up writing a deformer 
>>>>> anyway, but that's a nice little trick there.
>>>>>
>>>>>
>>>>> El martes, 22 de junio de 2021 a las 12:41:19 UTC+2, 
>>>>> hannes...@gmail.com escribió:
>>>>>
>>>>>> match by vert id is impossible in that case because the vert ids cant 
>>>>>> ever match, unless you somehow reorder the verts yourself from the mesh 
>>>>>> with the most verts(the body)
>>>>>> what i suggest to do instead is match vert by world position, or if 
>>>>>> you have unique UVs by UV position.
>>>>>>
>>>>>> get the closest vert, for every vert. and hook them up in a tuple.
>>>>>> then use this to do anything you want. ex transfer skinning.
>>>>>>
>>>>>> i suggest to do this with openmaya because of speed
>>>>>> it will be very slow in pymel
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, 22 Jun 2021 at 10:46, Rudi Hammad  wrote:
>>>>>>
>>>>>>> (so no, meshes whould not have the same number of cvs)
>>>>>>>
>>>>>>> El martes, 22 de junio de 2021 a las 11:44:57 UTC+2, Rudi Hammad 
>>>>>>> escribió:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> yes, i want to have different topologies. The use case would be a 
>>>>>>>> rig where you have a mesh cut out of the head for the facial rig, that 
>>>>>>>> you 
>>>>>>>> blendshape into the full body mesh. So there you have 2 different 
>>>>>>>> topologies. In maya you can do a blendshape between different 
>>>>>>>> topologies 
>>>>>>>> but if the ids don't match you get unwanted results.
>>>>>>>> I can achieve that alternativly wrighting a wrap deformer , but I 
>>>>>>>> was wondering  by beeing able to match the vertices ids it would be 
>>>>>>>> easier.
>>>>>>>>
>>>>>>>> R
>>>>>>>> El martes, 22 de junio de 2021 a las 10:46:50 UTC+2, Alok Gandhi 
>>>>>>>> escribió:
>>>>>>>>
>>>>>>>>> Ok. Btw, I am curious as to how you would transfer the vertex id 
>>>>>

Re: [Maya-Python] Re: transfer vertex ids between different

2021-06-22 Thread Rudi Hammad
Actually I is possible, I did figure out how to do it. If you separate the 
head from the body, duplicate the head, and then recombine the head to the 
body, vertex order is preserved.
Then you can do a blendshape. I'll probably end up writing a deformer 
anyway, but that's a nice little trick there.


El martes, 22 de junio de 2021 a las 12:41:19 UTC+2, hannes...@gmail.com 
escribió:

> match by vert id is impossible in that case because the vert ids cant ever 
> match, unless you somehow reorder the verts yourself from the mesh with the 
> most verts(the body)
> what i suggest to do instead is match vert by world position, or if you 
> have unique UVs by UV position.
>
> get the closest vert, for every vert. and hook them up in a tuple.
> then use this to do anything you want. ex transfer skinning.
>
> i suggest to do this with openmaya because of speed
> it will be very slow in pymel
>
>
>
> On Tue, 22 Jun 2021 at 10:46, Rudi Hammad  wrote:
>
>> (so no, meshes whould not have the same number of cvs)
>>
>> El martes, 22 de junio de 2021 a las 11:44:57 UTC+2, Rudi Hammad escribió:
>>
>>>
>>>
>>> yes, i want to have different topologies. The use case would be a rig 
>>> where you have a mesh cut out of the head for the facial rig, that you 
>>> blendshape into the full body mesh. So there you have 2 different 
>>> topologies. In maya you can do a blendshape between different topologies 
>>> but if the ids don't match you get unwanted results.
>>> I can achieve that alternativly wrighting a wrap deformer , but I was 
>>> wondering  by beeing able to match the vertices ids it would be easier.
>>>
>>> R
>>> El martes, 22 de junio de 2021 a las 10:46:50 UTC+2, Alok Gandhi 
>>> escribió:
>>>
>>>> Ok. Btw, I am curious as to how you would transfer the vertex id for 
>>>> two differing topologies. Can you give some details about what's different 
>>>> between the two topologies. In any case, I assume that they have the same 
>>>> number of vertex (otherwise you cannot transfer the vertex ids).
>>>>
>>>>
>>>> On Tue, Jun 22, 2021 at 2:05 PM Rudi Hammad  wrote:
>>>>
>>>>> It looks similar to maya's transfer attribute tool, but it doesn't 
>>>>> look to do a vertex id transfer.
>>>>>
>>>>> El martes, 22 de junio de 2021 a las 9:53:25 UTC+2, Alok Gandhi 
>>>>> escribió:
>>>>>
>>>>>> There was GATOR 
>>>>>> <https://download.autodesk.com/global/docs/softimage2012/en_us/userguide/index.html?url=files/property8064.htm,topicNumber=d28e458586>
>>>>>>  
>>>>>> is Softimage XSI that could handle such cases as yours. I remember 
>>>>>> vaguely 
>>>>>> that it was being worked upon in Maya (since the Softimage dev team was 
>>>>>> merged with the Maya team). I am not sure if it exists in Maya in some 
>>>>>> form. Maybe someone here has more information and can comment.
>>>>>>
>>>>>> On Tue, Jun 22, 2021 at 1:15 PM Rudi Hammad  
>>>>>> wrote:
>>>>>>
>>>>>>> That was to nice to be true. So I guess there is no easy way (or no 
>>>>>>> way at all probably) to transfer the vertices ids between different 
>>>>>>> topologies?
>>>>>>>
>>>>>>> El martes, 22 de junio de 2021 a las 1:10:27 UTC+2, 
>>>>>>> voidr...@gmail.com escribió:
>>>>>>>
>>>>>>>> I believe you need to have the same topology to transfer the vertex 
>>>>>>>> order, since you'll need the same number of vtx to copy the id to, 
>>>>>>>> otherwise maya will crash.
>>>>>>>>
>>>>>>>> On Monday, June 21, 2021 at 6:57:33 p.m. UTC-4 Rudi Hammad wrote:
>>>>>>>>
>>>>>>>>> Hello,
>>>>>>>>> haven't found anything in the search bar and nothing really worked 
>>>>>>>>> for me doing a google search, so I was wondering if it is possible to 
>>>>>>>>> transfer the vertices ids from one mesh to another with different 
>>>>>>>>> topologies. There is a tool in Maya called transfer vertex order , 
>>>>>>>>> but it 
>>>>>>>>> crashes maya every time.
>>>>>>>>&g

Re: [Maya-Python] Re: transfer vertex ids between different

2021-06-22 Thread Rudi Hammad
(so no, meshes whould not have the same number of cvs)

El martes, 22 de junio de 2021 a las 11:44:57 UTC+2, Rudi Hammad escribió:

>
>
> yes, i want to have different topologies. The use case would be a rig 
> where you have a mesh cut out of the head for the facial rig, that you 
> blendshape into the full body mesh. So there you have 2 different 
> topologies. In maya you can do a blendshape between different topologies 
> but if the ids don't match you get unwanted results.
> I can achieve that alternativly wrighting a wrap deformer , but I was 
> wondering  by beeing able to match the vertices ids it would be easier.
>
> R
> El martes, 22 de junio de 2021 a las 10:46:50 UTC+2, Alok Gandhi escribió:
>
>> Ok. Btw, I am curious as to how you would transfer the vertex id for two 
>> differing topologies. Can you give some details about what's different 
>> between the two topologies. In any case, I assume that they have the same 
>> number of vertex (otherwise you cannot transfer the vertex ids).
>>
>>
>> On Tue, Jun 22, 2021 at 2:05 PM Rudi Hammad  wrote:
>>
>>> It looks similar to maya's transfer attribute tool, but it doesn't look 
>>> to do a vertex id transfer.
>>>
>>> El martes, 22 de junio de 2021 a las 9:53:25 UTC+2, Alok Gandhi escribió:
>>>
>>>> There was GATOR 
>>>> <https://download.autodesk.com/global/docs/softimage2012/en_us/userguide/index.html?url=files/property8064.htm,topicNumber=d28e458586>
>>>>  
>>>> is Softimage XSI that could handle such cases as yours. I remember vaguely 
>>>> that it was being worked upon in Maya (since the Softimage dev team was 
>>>> merged with the Maya team). I am not sure if it exists in Maya in some 
>>>> form. Maybe someone here has more information and can comment.
>>>>
>>>> On Tue, Jun 22, 2021 at 1:15 PM Rudi Hammad  wrote:
>>>>
>>>>> That was to nice to be true. So I guess there is no easy way (or no 
>>>>> way at all probably) to transfer the vertices ids between different 
>>>>> topologies?
>>>>>
>>>>> El martes, 22 de junio de 2021 a las 1:10:27 UTC+2, voidr...@gmail.com 
>>>>> escribió:
>>>>>
>>>>>> I believe you need to have the same topology to transfer the vertex 
>>>>>> order, since you'll need the same number of vtx to copy the id to, 
>>>>>> otherwise maya will crash.
>>>>>>
>>>>>> On Monday, June 21, 2021 at 6:57:33 p.m. UTC-4 Rudi Hammad wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>> haven't found anything in the search bar and nothing really worked 
>>>>>>> for me doing a google search, so I was wondering if it is possible to 
>>>>>>> transfer the vertices ids from one mesh to another with different 
>>>>>>> topologies. There is a tool in Maya called transfer vertex order , but 
>>>>>>> it 
>>>>>>> crashes maya every time.
>>>>>>> Any suggestions?
>>>>>>> Thanks
>>>>>>>
>>>>>>> R
>>>>>>>
>>>>>>> -- 
>>>>> 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_m...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/python_inside_maya/a86d302a-881b-4443-a487-18a468ecb0b4n%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/python_inside_maya/a86d302a-881b-4443-a487-18a468ecb0b4n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>> 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_m...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/d86ccae2-606c-4656-8de7-df9e1d738ba0n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/python_inside_maya/d86ccae2-606c-4656-8de7-df9e1d738ba0n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/1430847f-6f9b-475b-9cbc-94b27f8ed6f1n%40googlegroups.com.


Re: [Maya-Python] Re: transfer vertex ids between different

2021-06-22 Thread Rudi Hammad


yes, i want to have different topologies. The use case would be a rig where 
you have a mesh cut out of the head for the facial rig, that you blendshape 
into the full body mesh. So there you have 2 different topologies. In maya 
you can do a blendshape between different topologies but if the ids don't 
match you get unwanted results.
I can achieve that alternativly wrighting a wrap deformer , but I was 
wondering  by beeing able to match the vertices ids it would be easier.

R
El martes, 22 de junio de 2021 a las 10:46:50 UTC+2, Alok Gandhi escribió:

> Ok. Btw, I am curious as to how you would transfer the vertex id for two 
> differing topologies. Can you give some details about what's different 
> between the two topologies. In any case, I assume that they have the same 
> number of vertex (otherwise you cannot transfer the vertex ids).
>
>
> On Tue, Jun 22, 2021 at 2:05 PM Rudi Hammad  wrote:
>
>> It looks similar to maya's transfer attribute tool, but it doesn't look 
>> to do a vertex id transfer.
>>
>> El martes, 22 de junio de 2021 a las 9:53:25 UTC+2, Alok Gandhi escribió:
>>
>>> There was GATOR 
>>> <https://download.autodesk.com/global/docs/softimage2012/en_us/userguide/index.html?url=files/property8064.htm,topicNumber=d28e458586>
>>>  
>>> is Softimage XSI that could handle such cases as yours. I remember vaguely 
>>> that it was being worked upon in Maya (since the Softimage dev team was 
>>> merged with the Maya team). I am not sure if it exists in Maya in some 
>>> form. Maybe someone here has more information and can comment.
>>>
>>> On Tue, Jun 22, 2021 at 1:15 PM Rudi Hammad  wrote:
>>>
>>>> That was to nice to be true. So I guess there is no easy way (or no way 
>>>> at all probably) to transfer the vertices ids between different topologies?
>>>>
>>>> El martes, 22 de junio de 2021 a las 1:10:27 UTC+2, voidr...@gmail.com 
>>>> escribió:
>>>>
>>>>> I believe you need to have the same topology to transfer the vertex 
>>>>> order, since you'll need the same number of vtx to copy the id to, 
>>>>> otherwise maya will crash.
>>>>>
>>>>> On Monday, June 21, 2021 at 6:57:33 p.m. UTC-4 Rudi Hammad wrote:
>>>>>
>>>>>> Hello,
>>>>>> haven't found anything in the search bar and nothing really worked 
>>>>>> for me doing a google search, so I was wondering if it is possible to 
>>>>>> transfer the vertices ids from one mesh to another with different 
>>>>>> topologies. There is a tool in Maya called transfer vertex order , but 
>>>>>> it 
>>>>>> crashes maya every time.
>>>>>> Any suggestions?
>>>>>> Thanks
>>>>>>
>>>>>> R
>>>>>>
>>>>>> -- 
>>>> 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_m...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/python_inside_maya/a86d302a-881b-4443-a487-18a468ecb0b4n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/python_inside_maya/a86d302a-881b-4443-a487-18a468ecb0b4n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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_m...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/d86ccae2-606c-4656-8de7-df9e1d738ba0n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/d86ccae2-606c-4656-8de7-df9e1d738ba0n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/fdf38386-0573-4f28-81f6-761f6f99da92n%40googlegroups.com.


Re: [Maya-Python] Re: transfer vertex ids between different

2021-06-22 Thread Rudi Hammad
It looks similar to maya's transfer attribute tool, but it doesn't look to 
do a vertex id transfer.

El martes, 22 de junio de 2021 a las 9:53:25 UTC+2, Alok Gandhi escribió:

> There was GATOR 
> <https://download.autodesk.com/global/docs/softimage2012/en_us/userguide/index.html?url=files/property8064.htm,topicNumber=d28e458586>
>  
> is Softimage XSI that could handle such cases as yours. I remember vaguely 
> that it was being worked upon in Maya (since the Softimage dev team was 
> merged with the Maya team). I am not sure if it exists in Maya in some 
> form. Maybe someone here has more information and can comment.
>
> On Tue, Jun 22, 2021 at 1:15 PM Rudi Hammad  wrote:
>
>> That was to nice to be true. So I guess there is no easy way (or no way 
>> at all probably) to transfer the vertices ids between different topologies?
>>
>> El martes, 22 de junio de 2021 a las 1:10:27 UTC+2, voidr...@gmail.com 
>> escribió:
>>
>>> I believe you need to have the same topology to transfer the vertex 
>>> order, since you'll need the same number of vtx to copy the id to, 
>>> otherwise maya will crash.
>>>
>>> On Monday, June 21, 2021 at 6:57:33 p.m. UTC-4 Rudi Hammad wrote:
>>>
>>>> Hello,
>>>> haven't found anything in the search bar and nothing really worked for 
>>>> me doing a google search, so I was wondering if it is possible to transfer 
>>>> the vertices ids from one mesh to another with different topologies. There 
>>>> is a tool in Maya called transfer vertex order , but it crashes maya every 
>>>> time.
>>>> Any suggestions?
>>>> Thanks
>>>>
>>>> R
>>>>
>>>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/a86d302a-881b-4443-a487-18a468ecb0b4n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/a86d302a-881b-4443-a487-18a468ecb0b4n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/d86ccae2-606c-4656-8de7-df9e1d738ba0n%40googlegroups.com.


[Maya-Python] Re: transfer vertex ids between different

2021-06-22 Thread Rudi Hammad
That was to nice to be true. So I guess there is no easy way (or no way at 
all probably) to transfer the vertices ids between different topologies?

El martes, 22 de junio de 2021 a las 1:10:27 UTC+2, voidr...@gmail.com 
escribió:

> I believe you need to have the same topology to transfer the vertex order, 
> since you'll need the same number of vtx to copy the id to, otherwise maya 
> will crash.
>
> On Monday, June 21, 2021 at 6:57:33 p.m. UTC-4 Rudi Hammad wrote:
>
>> Hello,
>> haven't found anything in the search bar and nothing really worked for me 
>> doing a google search, so I was wondering if it is possible to transfer the 
>> vertices ids from one mesh to another with different topologies. There is a 
>> tool in Maya called transfer vertex order , but it crashes maya every time.
>> Any suggestions?
>> Thanks
>>
>> R
>>
>>

-- 
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/a86d302a-881b-4443-a487-18a468ecb0b4n%40googlegroups.com.


[Maya-Python] transfer vertex ids between different

2021-06-21 Thread Rudi Hammad
Hello,
haven't found anything in the search bar and nothing really worked for me 
doing a google search, so I was wondering if it is possible to transfer the 
vertices ids from one mesh to another with different topologies. There is a 
tool in Maya called transfer vertex order , but it crashes maya every time.
Any suggestions?
Thanks

R

-- 
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/d327d591-63a6-4447-ad07-bc59cce1c875n%40googlegroups.com.


Re: [Maya-Python] A good way to store mesh components in a set ?

2021-06-19 Thread Rudi Hammad
Not sure if that is what you are looking for, but if you want  to use the 
API you can do something like

mSel = OpenMaya.MSelectionList()
mSel.add("yourObject")
mDag = OpenMaya.MDagPath()
cmpMObj = OpenMaya.MObject()
mSel.getDagPath(0, mDag, cmpMObj)

faces = list()
mIt = OpenMaya.MItMeshPolygon(mDag, cmpMObj)
while not mIt.isDone():
faces.append(mIt.index())
mIt.next()


El viernes, 18 de junio de 2021 a las 18:54:49 UTC+2, Juan Moraga escribió:

> I totally agree. I had a problem like this before and I ended up using a 
> method similar to Marcus'.
> As an additional note, something I found handy in the past was the 
> "-flatten" flag of the cmds.ls() command, which will return you a list 
> with one item for each component (faces, verts etc.).
>
> for mesh in cmds.ls(selection=True, type="transform"):
>> faces = cmds.ls(mesh + ".f[0:]", fl = True)
>> print(faces)
>>
>
> By the way, wouldn't the ls() in the for loop be with the type = 
> "transform" flag instead of type = "mesh" flag? 
>
> Kind regards,
>
>
>
> On Fri, 18 Jun 2021 at 15:12, Marcus Ottosson  wrote:
>
>> Cool. :) It should be fast, you’re more or less passing the burden of 
>> actually iterating over the scene to those two commands which are already 
>> implemented in C++. So it’s likely that trying to replicate this via the 
>> Python API would be *more* expensive.
>>
>> On Fri, 18 Jun 2021 at 14:56, Alejandro  wrote:
>>
>>> I made a few tests on the usual number of elements, 2k / 1k, and it goes 
>>> smoothly, not bad!
>>>
>>> Thanks a lot Marcus :)
>>>
>>> On Friday, June 18, 2021 at 9:42:35 a.m. UTC-4 Marcus Ottosson wrote:
>>>
 You tell me. How long does it take currently? How often do you intend 
 on running it? How long would you like it to take?

 On Fri, 18 Jun 2021 at 12:38, Alejandro  wrote:

> Thanks a lot Marcus, 
>
> I was looking for an option with the API for speed, since I have 
> scenes with more than 1k objects, do you think it's not needed in this 
> case 
> ?
>
>
> On Friday, June 18, 2021 at 3:01:43 a.m. UTC-4 Marcus Ottosson wrote:
>
>> Something like this should have you covered.
>>
>> for mesh in cmds.ls(selection=True, type="mesh"):
>> cmds.select("%s.f[0:]" % mesh)
>> cmds.sets(name="%s_set" % mesh)
>>
>> The .f[] syntax is for selecting faces, it’s what you see echoed in 
>> the Script Editor as you select a face interactively via the viewport.
>>
>> On Fri, 18 Jun 2021 at 00:44, Alejandro  wrote:
>>
>>> Hello guys!,
>>>
>>> What would be the fastest solution to store all the face components 
>>> for each object I select into its correspondent set?
>>>
>>> I'm trying something like this:
>>>
>>> mesh = maya.cmds.ls(selection=True, type='mesh')[0]
>>> selection_list = OpenMaya.MSelectionList()
>>> selection_list.add(mesh)
>>> dag_path = selection_list.getDagPath(0)
>>> mfn_mesh = OpenMaya.MFnMesh(dag_path)
>>>
>>> v_count, ids = mfn_mesh.getTriangles()
>>>
>>> but these are only triangle counts and vtx indexes, how could I have 
>>> the full face element and store in a set ?
>>>
>>> thank 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_m...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/24a2b1e9-f975-4461-97a1-e1155b235973n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
> 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_m...@googlegroups.com.
>
 To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/66b60eee-81c2-4ea5-9f77-effe7565d39an%40googlegroups.com
>  
> 
> .
>
 -- 
>>> 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_m...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/5e7dd6e7-ff12-4c8c-b5c2-afee720bn%40googlegroups.com
>>>  
>>> 

Re: [Maya-Python] which units do you use in your productions?

2021-06-02 Thread Rudi Hammad
thanks for you input Jason.
About floating point miss calculation, it is not a problem. You just have 
to localize the skin.
R

El miércoles, 2 de junio de 2021 a las 18:13:48 UTC+2, Jason Brummett 
escribió:

> I model and perform all aspects at real world scale.  I’d recommend it and 
> though it appears Maya wants to be at 1:10 scale it’s misleading IMO.  Maya 
> doesn’t really care.  If you are at 1:1 however scenes should be close to 
> 0,0,0 as much as possible to avoid floating point miss calcs.
>
>  
>
> *From:* python_in...@googlegroups.com [mailto:
> python_in...@googlegroups.com] *On Behalf Of *Marcus Ottosson
> *Sent:* Wednesday, June 02, 2021 3:27 AM
> *To:* python_in...@googlegroups.com
> *Subject:* Re: [Maya-Python] which units do you use in your productions?
>
>  
>
> In my experience there is no right answer, it all depends. :(
>
> Like you mentioned, for *some* grooming tools, real-world scale is 
> preferred. But even that depends on whether the tools themselves where 
> designed around it, which isn’t necessarily the case. Rendering typically 
> assumes real-world scale, for things like subsurface scatter depth being in 
> centimeters. Simulation varies greatly, to my great surprise. nCloth 
> assumes *0.01x* with a default gravity of 9.8 cm/s as opposed to m/s, 
> Bullet assumes 1.0x and who knows what third-party solvers end up choosing.
>
> For animation this problem is also ever present, in that translate versus 
> rotate curves in the graph editor appear at wildly different scales. E.g. 
> an arm rotated 20 degrees can cover the Y-axis of the editor, but then 
> display that alongside hip translation and you’ll end up either zooming in 
> or out like mad, obscuring the rotation.
>
> So no matter how consistent you are, someone *will* end up suffering. 
> It’s an unsolved problem.
>
>  
>
> On Wed, 2 Jun 2021 at 09:57, Rudi Hammad  wrote:
>
>  
>
> hey everyone,
>
> for a long a time I worked in 1:10 base scale in maya. So 10 cm units 
> would actually represent 100 cm. If i remember correctly autodesk 
> recommended that 1:10 scale based
>
>  [image: Capture.JPG]
>
> the image above show a character in 1:10 compared to 1:1. So it almost 
> like maya is inviting you to work at 1:10 since the character looks nicely 
> fitting the grid proportions.
>
> But talking with some groming artists(and having delt with groming myself) 
> xgen works better in a 1:1 scale. With a 1:10 scale the settings are harder 
> to tweak because they blow out of proportions inmediatly.
> What is your take on that on a personal or production level?
>
> Cheers,
>
>  
>
> R
>
> -- 
> 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_m...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/e161eb64-eff6-4683-83e9-14c666e6aea3n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/python_inside_maya/e161eb64-eff6-4683-83e9-14c666e6aea3n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> -- 
> 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_m...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBFN%3DP9%3Di5q81n2qkxupwHcaYOPPX5hFUBQpSctq1x6kg%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBFN%3DP9%3Di5q81n2qkxupwHcaYOPPX5hFUBQpSctq1x6kg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/101d3dbd-c739-475d-9f2b-3e9b40cc9872n%40googlegroups.com.


Re: [Maya-Python] which units do you use in your productions?

2021-06-02 Thread Rudi Hammad

Great point about the animation curves, I never though about that in terms 
of how the curves display relative to each other.
Cool thanks. 
El miércoles, 2 de junio de 2021 a las 11:27:16 UTC+2, Marcus Ottosson 
escribió:

> In my experience there is no right answer, it all depends. :(
>
> Like you mentioned, for *some* grooming tools, real-world scale is 
> preferred. But even that depends on whether the tools themselves where 
> designed around it, which isn’t necessarily the case. Rendering typically 
> assumes real-world scale, for things like subsurface scatter depth being in 
> centimeters. Simulation varies greatly, to my great surprise. nCloth 
> assumes *0.01x* with a default gravity of 9.8 cm/s as opposed to m/s, 
> Bullet assumes 1.0x and who knows what third-party solvers end up choosing.
>
> For animation this problem is also ever present, in that translate versus 
> rotate curves in the graph editor appear at wildly different scales. E.g. 
> an arm rotated 20 degrees can cover the Y-axis of the editor, but then 
> display that alongside hip translation and you’ll end up either zooming in 
> or out like mad, obscuring the rotation.
>
> So no matter how consistent you are, someone *will* end up suffering. 
> It’s an unsolved problem.
>
> On Wed, 2 Jun 2021 at 09:57, Rudi Hammad  wrote:
>
>>
>> hey everyone,
>> for a long a time I worked in 1:10 base scale in maya. So 10 cm units 
>> would actually represent 100 cm. If i remember correctly autodesk 
>> recommended that 1:10 scale based
>>  [image: Capture.JPG]
>> the image above show a character in 1:10 compared to 1:1. So it almost 
>> like maya is inviting you to work at 1:10 since the character looks nicely 
>> fitting the grid proportions.
>> But talking with some groming artists(and having delt with groming 
>> myself) xgen works better in a 1:1 scale. With a 1:10 scale the settings 
>> are harder to tweak because they blow out of proportions inmediatly.
>> What is your take on that on a personal or production level?
>> Cheers,
>>
>> R
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/e161eb64-eff6-4683-83e9-14c666e6aea3n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/e161eb64-eff6-4683-83e9-14c666e6aea3n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/4d47ce45-dcb1-41eb-8edc-c2b93d96f662n%40googlegroups.com.


[Maya-Python] which units do you use in your productions?

2021-06-02 Thread Rudi Hammad

hey everyone,
for a long a time I worked in 1:10 base scale in maya. So 10 cm units would 
actually represent 100 cm. If i remember correctly autodesk recommended 
that 1:10 scale based
 [image: Capture.JPG]
the image above show a character in 1:10 compared to 1:1. So it almost like 
maya is inviting you to work at 1:10 since the character looks nicely 
fitting the grid proportions.
But talking with some groming artists(and having delt with groming myself) 
xgen works better in a 1:1 scale. With a 1:10 scale the settings are harder 
to tweak because they blow out of proportions inmediatly.
What is your take on that on a personal or production level?
Cheers,

R

-- 
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/e161eb64-eff6-4683-83e9-14c666e6aea3n%40googlegroups.com.


Re: [Maya-Python] another naming convention topic: get prefix on none getter methods

2021-05-11 Thread Rudi Hammad
For instance in the MFnCurve there are the methods degree(),  numCVs(), 
area(), lenght(), knot()... not getDegree(), getNumCVs(), getArea(), etc...
So I wonder if there is a logic for that. It looks like anything without 
'get' prefix returns a number?? ...   ¯\_(ツ)_/¯ 

El martes, 11 de mayo de 2021 a las 20:46:54 UTC+2, Rudi Hammad escribió:

>
> cool thanks for your opinion.
> I do use @property in somesituations, not saying to stay away (in fact we 
> had a discusion is another thread about it a while back) 
>
> I agree that function are usually verbes. And it is true that if you 
> isolate the name pointPositions() it doesn't feel natural but being a 
> method it would read as
> myMesh.pointsPositions() which I think reads nice . For me 
> myMesh.getPointsPositions() read well but in the back of my head I expecy 
> myMesh.setPointPositions() too. Must be subjective I guess.
>
>
> El martes, 11 de mayo de 2021 a las 20:02:42 UTC+2, Alok Gandhi escribió:
>
>> I have generously used prefix for methods 'get' without any 'set'.
>>
>> I think there is no convention and my code readability is generally 
>> dictated by common sense and ease of understanding.
>>
>> Another point is that functions/methods sgould always be verbs as long as 
>> possible. So pointPositions() to me does not feel like a natural function 
>> that 'does' something.
>>
>> I would definitely use descriptor protocol (@property) wherever I can. It 
>> makes code beautiful, plus readonly attrs are easily managed by absence of 
>> a @setter.attr.
>>
>> So overall, I would not stay away from get_ prefix in absence of a set_
>>
>>
>> On Tue, May 11, 2021, 22:34 Rudi Hammad  wrote:
>>
>>>
>>> So, I get the feeling that there isn't a clear naming convenction when 
>>> it comes to use "get" as a prefix. I am not refering to the python 
>>> @property, nor getter/setter methods. I am talking about normal methods.
>>>
>>> My criteria is:
>>> when ever I prefix a method with "get" it is because I am implying there 
>>> is a "set". By doing that, just by this naming it hints the reader if it is 
>>> a getter or normal method.
>>> For instance, I do ~.pointsPositions() not  ~.getPointsPositions(). 
>>> Reading that I am trying to hint the reader that there is no 
>>> setPointsPositions().
>>>
>>> Reading different apis, it seems there isn't a clear convention for 
>>> this. Even within the same api you can find the prefix "get" almost 
>>> randomly. Sometimes it might even be a getter that is not prefixed with 
>>> get, but has its corresponding setter with the prefix "set".
>>>
>>> thoughts?
>>>
>>> R
>>>
>>>
>>>
>>> -- 
>>> 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_m...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/d1ebae5b-3343-4e94-8829-4879b11a6e68n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/python_inside_maya/d1ebae5b-3343-4e94-8829-4879b11a6e68n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/26915f40-6c00-40cd-8e96-deec54f0bd53n%40googlegroups.com.


Re: [Maya-Python] another naming convention topic: get prefix on none getter methods

2021-05-11 Thread Rudi Hammad

cool thanks for your opinion.
I do use @property in somesituations, not saying to stay away (in fact we 
had a discusion is another thread about it a while back) 

I agree that function are usually verbes. And it is true that if you 
isolate the name pointPositions() it doesn't feel natural but being a 
method it would read as
myMesh.pointsPositions() which I think reads nice . For me 
myMesh.getPointsPositions() read well but in the back of my head I expecy 
myMesh.setPointPositions() too. Must be subjective I guess.


El martes, 11 de mayo de 2021 a las 20:02:42 UTC+2, Alok Gandhi escribió:

> I have generously used prefix for methods 'get' without any 'set'.
>
> I think there is no convention and my code readability is generally 
> dictated by common sense and ease of understanding.
>
> Another point is that functions/methods sgould always be verbs as long as 
> possible. So pointPositions() to me does not feel like a natural function 
> that 'does' something.
>
> I would definitely use descriptor protocol (@property) wherever I can. It 
> makes code beautiful, plus readonly attrs are easily managed by absence of 
> a @setter.attr.
>
> So overall, I would not stay away from get_ prefix in absence of a set_
>
>
> On Tue, May 11, 2021, 22:34 Rudi Hammad  wrote:
>
>>
>> So, I get the feeling that there isn't a clear naming convenction when it 
>> comes to use "get" as a prefix. I am not refering to the python @property, 
>> nor getter/setter methods. I am talking about normal methods.
>>
>> My criteria is:
>> when ever I prefix a method with "get" it is because I am implying there 
>> is a "set". By doing that, just by this naming it hints the reader if it is 
>> a getter or normal method.
>> For instance, I do ~.pointsPositions() not  ~.getPointsPositions(). 
>> Reading that I am trying to hint the reader that there is no 
>> setPointsPositions().
>>
>> Reading different apis, it seems there isn't a clear convention for this. 
>> Even within the same api you can find the prefix "get" almost randomly. 
>> Sometimes it might even be a getter that is not prefixed with get, but has 
>> its corresponding setter with the prefix "set".
>>
>> thoughts?
>>
>> R
>>
>>
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/d1ebae5b-3343-4e94-8829-4879b11a6e68n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/d1ebae5b-3343-4e94-8829-4879b11a6e68n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/740087bf-129e-40c2-bd62-6dd8b7b694e8n%40googlegroups.com.


[Maya-Python] another naming convention topic: get prefix on none getter methods

2021-05-11 Thread Rudi Hammad

So, I get the feeling that there isn't a clear naming convenction when it 
comes to use "get" as a prefix. I am not refering to the python @property, 
nor getter/setter methods. I am talking about normal methods.

My criteria is:
when ever I prefix a method with "get" it is because I am implying there is 
a "set". By doing that, just by this naming it hints the reader if it is a 
getter or normal method.
For instance, I do ~.pointsPositions() not  ~.getPointsPositions(). Reading 
that I am trying to hint the reader that there is no setPointsPositions().

Reading different apis, it seems there isn't a clear convention for this. 
Even within the same api you can find the prefix "get" almost randomly. 
Sometimes it might even be a getter that is not prefixed with get, but has 
its corresponding setter with the prefix "set".

thoughts?

R



-- 
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/d1ebae5b-3343-4e94-8829-4879b11a6e68n%40googlegroups.com.


[Maya-Python] vertex normal display different that result from MFnMesh

2021-05-11 Thread Rudi Hammad
Hi,
digging a bit more in the MFnMesh class I am trying to access the vertex 
normal.

In the image you can see two blue lines that correspond to the vertex 
normal obtained by the getVertexNormal() method. One is with the 
angleWeighted arg True and the other False, but that is not the issue. What 
I find odd is that to check that any of those vectors correspond to the 
vertex normal, I displayed in the viewport the normals per vertex, and 
neither of the normal vectors I obtained correspond with the one displayed.

Any idea why? my guess would be that the viewport is not as accurate to 
improve performance and that the correct values are the ones provided by 
the method but it is just a speculating.

R

-- 
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/676879d8-e08b-4eda-87dd-5f2b17f96be1n%40googlegroups.com.


Re: [Maya-Python] numpy errors fixed when reintializing maya

2021-05-05 Thread Rudi Hammad
By the way,  I modified the script i linked above in paste bin to not 
include any module related to numpy  and it fixed the bug since it doesn't 
reimport those modules.
thanks again for the tips.

El lunes, 3 de mayo de 2021 a las 14:05:06 UTC+2, Rudi Hammad escribió:

> awesome, thanks for pointing that out.
>
> El lunes, 3 de mayo de 2021 a las 7:36:51 UTC+2, Alok Gandhi escribió:
>
>> Seems like a known bug in numpy related to re-initialization of core 
>> module.
>>
>> https://github.com/numpy/numpy/issues/12305
>>
>>
>>
>> On Mon, May 3, 2021, 04:31 Rudi Hammad  wrote:
>>
>>> okey. well, I'll just have to deal with it. Maybe thing's will get 
>>> better with python 3 in maya 2021
>>>
>>> El lunes, 3 de mayo de 2021 a las 0:16:28 UTC+2, justin...@gmail.com 
>>> escribió:
>>>
>>>> On Mon, May 3, 2021 at 9:59 AM Rudi Hammad  wrote:
>>>>
>>>>> no, I don't used reload(). To avoid using reload everywhere I use this.
>>>>> https://pastebin.com/sxhYQNTn
>>>>
>>>>
>>>> Hmm, but you are still trying to dynamically change the imported module 
>>>> objects to force a re-import. Might not be related at all, but these 
>>>> workflows don't play very nicely with compiled extensions (numpy) which 
>>>> can't really be unloaded entirely from memory.
>>>>  
>>>>
>>>>>
>>>>> El domingo, 2 de mayo de 2021 a las 23:45:59 UTC+2, 
>>>>> justin...@gmail.com escribió:
>>>>>
>>>>>> Shot in the dark are you using python's reload() functionality 
>>>>>> anywhere? Does it seem to break after some type of workflow operation?
>>>>>>
>>>>>> On Mon, May 3, 2021 at 9:38 AM Rudi Hammad  
>>>>>> wrote:
>>>>>>
>>>>>>> I got the log error. Here it is:
>>>>>>>
>>>>>>> # 
>>>>>>> ==
>>>>>>> # ERROR: test_average 
>>>>>>> (domain._unittest.testmath.test_numeric.TestNumeric)
>>>>>>> # 
>>>>>>> --
>>>>>>> # # Traceback (most recent call last):
>>>>>>> #   File "D:\domain\_unittest\testmath\test_numeric.py", line 8, in 
>>>>>>> test_average
>>>>>>> # assert np.allclose(numeric.average(((0,-2), (1, 2))), [0.5, 
>>>>>>> 0.0] , atol=0.01)
>>>>>>> #   File "D:\domain\math\numeric.py", line 33, in average
>>>>>>> # averageList.append(np.average(_))
>>>>>>> #   File "C:\Program 
>>>>>>> Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\lib\function_base.py",
>>>>>>>  
>>>>>>> line 514, in average
>>>>>>> # avg = a.mean(axis)
>>>>>>> #   File "C:\Program 
>>>>>>> Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\core\_methods.py",
>>>>>>>  
>>>>>>> line 54, in _mean
>>>>>>> # arr = asanyarray(a)
>>>>>>> TypeError: 'NoneType' object is not callable
>>>>>>>
>>>>>>>
>>>>>>> Remember that this error was fixed on its own just by restarting 
>>>>>>> maya. Any idea what could be happening?
>>>>>>>
>>>>>>> El sábado, 1 de mayo de 2021 a las 10:22:04 UTC+2, Juan Moraga 
>>>>>>> escribió:
>>>>>>>
>>>>>>>> I agree on what Marcus said, pip install Numpy is not reliable 
>>>>>>>> (from what I have experienced in the past anyway), at least for Maya 
>>>>>>>> 2018.7 
>>>>>>>> (and I can imagine with MayaPy2.7 in general).
>>>>>>>>
>>>>>>>> Kind regards!
>>>>>>>>
>>>>>>>> On Sat, 1 May 2021, 07:40 Marcus Ottosson,  
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> > I can use it with no problem, it is just a rare issue that 
>>>>>>>>> happens sometimes.
>>>>>>>>>
>>>>&g

Re: [Maya-Python] numpy errors fixed when reintializing maya

2021-05-03 Thread Rudi Hammad
awesome, thanks for pointing that out.

El lunes, 3 de mayo de 2021 a las 7:36:51 UTC+2, Alok Gandhi escribió:

> Seems like a known bug in numpy related to re-initialization of core 
> module.
>
> https://github.com/numpy/numpy/issues/12305
>
>
>
> On Mon, May 3, 2021, 04:31 Rudi Hammad  wrote:
>
>> okey. well, I'll just have to deal with it. Maybe thing's will get better 
>> with python 3 in maya 2021
>>
>> El lunes, 3 de mayo de 2021 a las 0:16:28 UTC+2, justin...@gmail.com 
>> escribió:
>>
>>> On Mon, May 3, 2021 at 9:59 AM Rudi Hammad  wrote:
>>>
>>>> no, I don't used reload(). To avoid using reload everywhere I use this.
>>>> https://pastebin.com/sxhYQNTn
>>>
>>>
>>> Hmm, but you are still trying to dynamically change the imported module 
>>> objects to force a re-import. Might not be related at all, but these 
>>> workflows don't play very nicely with compiled extensions (numpy) which 
>>> can't really be unloaded entirely from memory.
>>>  
>>>
>>>>
>>>> El domingo, 2 de mayo de 2021 a las 23:45:59 UTC+2, justin...@gmail.com 
>>>> escribió:
>>>>
>>>>> Shot in the dark are you using python's reload() functionality 
>>>>> anywhere? Does it seem to break after some type of workflow operation?
>>>>>
>>>>> On Mon, May 3, 2021 at 9:38 AM Rudi Hammad  wrote:
>>>>>
>>>>>> I got the log error. Here it is:
>>>>>>
>>>>>> # 
>>>>>> ==
>>>>>> # ERROR: test_average 
>>>>>> (domain._unittest.testmath.test_numeric.TestNumeric)
>>>>>> # 
>>>>>> --
>>>>>> # # Traceback (most recent call last):
>>>>>> #   File "D:\domain\_unittest\testmath\test_numeric.py", line 8, in 
>>>>>> test_average
>>>>>> # assert np.allclose(numeric.average(((0,-2), (1, 2))), [0.5, 
>>>>>> 0.0] , atol=0.01)
>>>>>> #   File "D:\domain\math\numeric.py", line 33, in average
>>>>>> # averageList.append(np.average(_))
>>>>>> #   File "C:\Program 
>>>>>> Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\lib\function_base.py",
>>>>>>  
>>>>>> line 514, in average
>>>>>> # avg = a.mean(axis)
>>>>>> #   File "C:\Program 
>>>>>> Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\core\_methods.py",
>>>>>>  
>>>>>> line 54, in _mean
>>>>>> # arr = asanyarray(a)
>>>>>> TypeError: 'NoneType' object is not callable
>>>>>>
>>>>>>
>>>>>> Remember that this error was fixed on its own just by restarting 
>>>>>> maya. Any idea what could be happening?
>>>>>>
>>>>>> El sábado, 1 de mayo de 2021 a las 10:22:04 UTC+2, Juan Moraga 
>>>>>> escribió:
>>>>>>
>>>>>>> I agree on what Marcus said, pip install Numpy is not reliable (from 
>>>>>>> what I have experienced in the past anyway), at least for Maya 2018.7 
>>>>>>> (and 
>>>>>>> I can imagine with MayaPy2.7 in general).
>>>>>>>
>>>>>>> Kind regards!
>>>>>>>
>>>>>>> On Sat, 1 May 2021, 07:40 Marcus Ottosson,  
>>>>>>> wrote:
>>>>>>>
>>>>>>>> > I can use it with no problem, it is just a rare issue that 
>>>>>>>> happens sometimes.
>>>>>>>>
>>>>>>>> Ah, ok. The reason I ask is because this sounds like the kind of 
>>>>>>>> problems you would get with a version compiled for a different Python. 
>>>>>>>> Random, subtle, memory related. I would double-check where you got it 
>>>>>>>> from, 
>>>>>>>> and make sure it was actually compiled for your version of Maya.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, 30 Apr 2021 at 23:51, Rudi Hammad  
>>>>>>>> wrote:
>>>>>>>>
>>&g

Re: [Maya-Python] numpy errors fixed when reintializing maya

2021-05-02 Thread Rudi Hammad
okey. well, I'll just have to deal with it. Maybe thing's will get better 
with python 3 in maya 2021

El lunes, 3 de mayo de 2021 a las 0:16:28 UTC+2, justin...@gmail.com 
escribió:

> On Mon, May 3, 2021 at 9:59 AM Rudi Hammad  wrote:
>
>> no, I don't used reload(). To avoid using reload everywhere I use this.
>> https://pastebin.com/sxhYQNTn
>
>
> Hmm, but you are still trying to dynamically change the imported module 
> objects to force a re-import. Might not be related at all, but these 
> workflows don't play very nicely with compiled extensions (numpy) which 
> can't really be unloaded entirely from memory.
>  
>
>>
>> El domingo, 2 de mayo de 2021 a las 23:45:59 UTC+2, justin...@gmail.com 
>> escribió:
>>
>>> Shot in the dark are you using python's reload() functionality 
>>> anywhere? Does it seem to break after some type of workflow operation?
>>>
>>> On Mon, May 3, 2021 at 9:38 AM Rudi Hammad  wrote:
>>>
>>>> I got the log error. Here it is:
>>>>
>>>> # ==
>>>> # ERROR: test_average 
>>>> (domain._unittest.testmath.test_numeric.TestNumeric)
>>>> # --
>>>> # # Traceback (most recent call last):
>>>> #   File "D:\domain\_unittest\testmath\test_numeric.py", line 8, in 
>>>> test_average
>>>> # assert np.allclose(numeric.average(((0,-2), (1, 2))), [0.5, 0.0] 
>>>> , atol=0.01)
>>>> #   File "D:\domain\math\numeric.py", line 33, in average
>>>> # averageList.append(np.average(_))
>>>> #   File "C:\Program 
>>>> Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\lib\function_base.py",
>>>>  
>>>> line 514, in average
>>>> # avg = a.mean(axis)
>>>> #   File "C:\Program 
>>>> Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\core\_methods.py", 
>>>> line 54, in _mean
>>>> # arr = asanyarray(a)
>>>> TypeError: 'NoneType' object is not callable
>>>>
>>>>
>>>> Remember that this error was fixed on its own just by restarting maya. 
>>>> Any idea what could be happening?
>>>>
>>>> El sábado, 1 de mayo de 2021 a las 10:22:04 UTC+2, Juan Moraga escribió:
>>>>
>>>>> I agree on what Marcus said, pip install Numpy is not reliable (from 
>>>>> what I have experienced in the past anyway), at least for Maya 2018.7 
>>>>> (and 
>>>>> I can imagine with MayaPy2.7 in general).
>>>>>
>>>>> Kind regards!
>>>>>
>>>>> On Sat, 1 May 2021, 07:40 Marcus Ottosson,  
>>>>> wrote:
>>>>>
>>>>>> > I can use it with no problem, it is just a rare issue that happens 
>>>>>> sometimes.
>>>>>>
>>>>>> Ah, ok. The reason I ask is because this sounds like the kind of 
>>>>>> problems you would get with a version compiled for a different Python. 
>>>>>> Random, subtle, memory related. I would double-check where you got it 
>>>>>> from, 
>>>>>> and make sure it was actually compiled for your version of Maya.
>>>>>>
>>>>>>
>>>>>> On Fri, 30 Apr 2021 at 23:51, Rudi Hammad  wrote:
>>>>>>
>>>>>>> sure, I will.
>>>>>>> I had a similar issue once at work. Not with numpy but with a 
>>>>>>> unitest when comparing matrices using MMatrix.isEquivalent(). In my 
>>>>>>> computer all the tests passed, so I pushed my code into the servered. 
>>>>>>> But 
>>>>>>> strangly enough,
>>>>>>> in my colleague computer the same code didn't passed. So we reduce 
>>>>>>> the tolerance argument, and then it passed. Almost like my cpu could 
>>>>>>> handle 
>>>>>>> to compare the float percision but his couldn't.
>>>>>>> So maybe it is maya messing thing is up depending on how the cpu is 
>>>>>>> feeling that day? I don't know
>>>>>>>
>>>>>>> El viernes, 30 de abril de 2021 a las 21:30:19 UTC+2, Alok Gandhi 
>>>>>>> escribió:
>>>>>>&

Re: [Maya-Python] numpy errors fixed when reintializing maya

2021-05-02 Thread Rudi Hammad
no, I don't used reload(). To avoid using reload everywhere I use this.
https://pastebin.com/sxhYQNTn
El domingo, 2 de mayo de 2021 a las 23:45:59 UTC+2, justin...@gmail.com 
escribió:

> Shot in the dark are you using python's reload() functionality 
> anywhere? Does it seem to break after some type of workflow operation?
>
> On Mon, May 3, 2021 at 9:38 AM Rudi Hammad  wrote:
>
>> I got the log error. Here it is:
>>
>> # ==
>> # ERROR: test_average (domain._unittest.testmath.test_numeric.TestNumeric)
>> # --
>> # # Traceback (most recent call last):
>> #   File "D:\domain\_unittest\testmath\test_numeric.py", line 8, in 
>> test_average
>> # assert np.allclose(numeric.average(((0,-2), (1, 2))), [0.5, 0.0] , 
>> atol=0.01)
>> #   File "D:\domain\math\numeric.py", line 33, in average
>> # averageList.append(np.average(_))
>> #   File "C:\Program 
>> Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\lib\function_base.py",
>>  
>> line 514, in average
>> # avg = a.mean(axis)
>> #   File "C:\Program 
>> Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\core\_methods.py", 
>> line 54, in _mean
>> # arr = asanyarray(a)
>> TypeError: 'NoneType' object is not callable
>>
>>
>> Remember that this error was fixed on its own just by restarting maya. 
>> Any idea what could be happening?
>>
>> El sábado, 1 de mayo de 2021 a las 10:22:04 UTC+2, Juan Moraga escribió:
>>
>>> I agree on what Marcus said, pip install Numpy is not reliable (from 
>>> what I have experienced in the past anyway), at least for Maya 2018.7 (and 
>>> I can imagine with MayaPy2.7 in general).
>>>
>>> Kind regards!
>>>
>>> On Sat, 1 May 2021, 07:40 Marcus Ottosson,  wrote:
>>>
>>>> > I can use it with no problem, it is just a rare issue that happens 
>>>> sometimes.
>>>>
>>>> Ah, ok. The reason I ask is because this sounds like the kind of 
>>>> problems you would get with a version compiled for a different Python. 
>>>> Random, subtle, memory related. I would double-check where you got it 
>>>> from, 
>>>> and make sure it was actually compiled for your version of Maya.
>>>>
>>>>
>>>> On Fri, 30 Apr 2021 at 23:51, Rudi Hammad  wrote:
>>>>
>>>>> sure, I will.
>>>>> I had a similar issue once at work. Not with numpy but with a unitest 
>>>>> when comparing matrices using MMatrix.isEquivalent(). In my computer all 
>>>>> the tests passed, so I pushed my code into the servered. But strangly 
>>>>> enough,
>>>>> in my colleague computer the same code didn't passed. So we reduce the 
>>>>> tolerance argument, and then it passed. Almost like my cpu could handle 
>>>>> to 
>>>>> compare the float percision but his couldn't.
>>>>> So maybe it is maya messing thing is up depending on how the cpu is 
>>>>> feeling that day? I don't know
>>>>>
>>>>> El viernes, 30 de abril de 2021 a las 21:30:19 UTC+2, Alok Gandhi 
>>>>> escribió:
>>>>>
>>>>>> And as this is not reliably reproducible, and a restart seems to fix 
>>>>>> it for a while, I would not rule out any memory issues. Keep an eye on 
>>>>>> the 
>>>>>> memory next time it happens. 
>>>>>>
>>>>>> On Sat, May 1, 2021, 00:04 Marcus Ottosson  
>>>>>> wrote:
>>>>>>
>>>>>>> Did you happen to get NumPy from PyPI, via pip install? There was a 
>>>>>>> thread here about it not long ago, but the bottom line is if you 
>>>>>>> haven’t 
>>>>>>> got a version compiled specifically for your version of Maya, it won’t 
>>>>>>> behave.
>>>>>>>
>>>>>>> On Fri, 30 Apr 2021 at 18:20, Rudi Hammad  
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I'll let you know when the error happens again, since I don't know 
>>>>>>>> how to cause it. I think it is something related to can't do what ever 
>>>>>>>> with 
>>>>>>>> None, or something refe

Re: [Maya-Python] numpy errors fixed when reintializing maya

2021-05-02 Thread Rudi Hammad
I got the log error. Here it is:

# ==
# ERROR: test_average (domain._unittest.testmath.test_numeric.TestNumeric)
# --
# # Traceback (most recent call last):
#   File "D:\domain\_unittest\testmath\test_numeric.py", line 8, in 
test_average
# assert np.allclose(numeric.average(((0,-2), (1, 2))), [0.5, 0.0] , 
atol=0.01)
#   File "D:\domain\math\numeric.py", line 33, in average
# averageList.append(np.average(_))
#   File "C:\Program 
Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\lib\function_base.py", 
line 514, in average
# avg = a.mean(axis)
#   File "C:\Program 
Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\core\_methods.py", 
line 54, in _mean
# arr = asanyarray(a)
TypeError: 'NoneType' object is not callable


Remember that this error was fixed on its own just by restarting maya. Any 
idea what could be happening?

El sábado, 1 de mayo de 2021 a las 10:22:04 UTC+2, Juan Moraga escribió:

> I agree on what Marcus said, pip install Numpy is not reliable (from what 
> I have experienced in the past anyway), at least for Maya 2018.7 (and I can 
> imagine with MayaPy2.7 in general).
>
> Kind regards!
>
> On Sat, 1 May 2021, 07:40 Marcus Ottosson,  wrote:
>
>> > I can use it with no problem, it is just a rare issue that happens 
>> sometimes.
>>
>> Ah, ok. The reason I ask is because this sounds like the kind of problems 
>> you would get with a version compiled for a different Python. Random, 
>> subtle, memory related. I would double-check where you got it from, and 
>> make sure it was actually compiled for your version of Maya.
>>
>>
>> On Fri, 30 Apr 2021 at 23:51, Rudi Hammad  wrote:
>>
>>> sure, I will.
>>> I had a similar issue once at work. Not with numpy but with a unitest 
>>> when comparing matrices using MMatrix.isEquivalent(). In my computer all 
>>> the tests passed, so I pushed my code into the servered. But strangly 
>>> enough,
>>> in my colleague computer the same code didn't passed. So we reduce the 
>>> tolerance argument, and then it passed. Almost like my cpu could handle to 
>>> compare the float percision but his couldn't.
>>> So maybe it is maya messing thing is up depending on how the cpu is 
>>> feeling that day? I don't know
>>>
>>> El viernes, 30 de abril de 2021 a las 21:30:19 UTC+2, Alok Gandhi 
>>> escribió:
>>>
>>>> And as this is not reliably reproducible, and a restart seems to fix it 
>>>> for a while, I would not rule out any memory issues. Keep an eye on the 
>>>> memory next time it happens. 
>>>>
>>>> On Sat, May 1, 2021, 00:04 Marcus Ottosson  wrote:
>>>>
>>>>> Did you happen to get NumPy from PyPI, via pip install? There was a 
>>>>> thread here about it not long ago, but the bottom line is if you haven’t 
>>>>> got a version compiled specifically for your version of Maya, it won’t 
>>>>> behave.
>>>>>
>>>>> On Fri, 30 Apr 2021 at 18:20, Rudi Hammad  wrote:
>>>>>
>>>>>> I'll let you know when the error happens again, since I don't know 
>>>>>> how to cause it. I think it is something related to can't do what ever 
>>>>>> with 
>>>>>> None, or something referencing a built-in numpy method.
>>>>>> I know this doesn't help so when  it happens again, I'll post it.
>>>>>>
>>>>>> El viernes, 30 de abril de 2021 a las 17:34:22 UTC+2, Alok Gandhi 
>>>>>> escribió:
>>>>>>
>>>>>>> And what are the errors? Any logs?
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Apr 30, 2021 at 8:27 PM Rudi Hammad  
>>>>>>> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> has anyone experienced this type of behavior working with numpy? I 
>>>>>>>> know my code is correct because I unitest method and all tests pass. 
>>>>>>>> But 
>>>>>>>> from time to time, complety randomly, when i run the unitest I get 17 
>>>>>>>> errors all related to methods that use numpy.
>>>>>>>> When this happened the first time, I spent hours thinking what was 
>>>>>

Re: [Maya-Python] docstring on obvious functions

2021-05-02 Thread Rudi Hammad


El domingo, 2 de mayo de 2021 a las 21:51:11 UTC+2, Alok Gandhi escribió:

>  In that case, you might have to even be consistent and write docstrings 
> for every single function/class, for the sake of uniformity and making your 
> product look professional and polished, even if it seems redundant to do 
> so. 
>
 
yes, i document everything just for consistency, and sometimes i run into 
those simple methods that really don't need explanation, but since i use 
sphinx-doc to document my api I do it anyway. 

-- 
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/28848940-4c10-466d-b95d-0fe56a1c3d05n%40googlegroups.com.


Re: [Maya-Python] docstring on obvious functions

2021-05-02 Thread Rudi Hammad
Cool, thanks for your input.
Personnally I am not a big fan of python's 3 typing (at least yet). I 
understand that being a duck typed language, having the type of return and 
to the argument type in the same function definition could be useful, but 
they don't replace the docstring do they? You still have to wright 
docstrings because most of the time you want to a little description. Also 
the IDE, by just hovering over the function, it tells you what you wrote in 
the docstring. I don't know, i am not sure how to feel about that in python 
3. It seems adding redundancy in code.

So you don't docstring protected or private methods ( understanding that 
there is no 'protected' or 'private'  in python, but that's another 
discussion). Protected methods are meant to be used in subclasses so I 
think you probably want to docstring them too. Maybe just skip private's 
docstring then?

R

El domingo, 2 de mayo de 2021 a las 21:27:18 UTC+2, justin...@gmail.com 
escribió:

> My take is that I want to see docstrings on public functions (which as 
> you pointed out are different from comments). 
> One added benefit of writing a docstring is that doc generators like 
> sphinx, and IDEs, can produce helpful type linking and hinting. So if your 
> function takes a certain type and returns a certain type, you may be able 
> to get links to those types for more information. Also docstrings are 
> helpful for an IDE to perform type hinting in python2. I know that in 
> python3 we gain proper language-level type annotations, but for now we have 
> to do it through comments and docstrings in python2.
>
> It may be subjective for a developer to think 
> that calculate_inverse(matrix) "obviously" accepts a numpy ndarray as its 
> input type, and then chooses not to document it in a docstring. But what if 
> there are different types that could be considered a matrix object and it 
> is really not so obvious to someone reading the docs or the signatures and 
> only sees that your api expects a "matrix"? Better to just use the 
> appropriate docstring formats to add type information, until everything is 
> python3 and you can do it all via type annotations.
>
>
> On Mon, May 3, 2021 at 6:30 AM Rudi Hammad  wrote:
>
>>
>> This not strictly related to maya but I wonder how you feel about it.
>> In sumary, I found my self in similar situations as this:
>> docstring example 
>> <https://stackoverflow.com/questions/33019955/should-you-always-document-functions-even-if-redundant-specifically-python>
>>
>> I think the link above isn't really answering what is was asked.
>> He was asking about docstrings and people where responding to comments. I 
>> agree that unless necesarry your code shouldn't need any comments if you 
>> respect some programing princpiples. So you never find your self in long 
>> functions that requieres explanations with comments. 
>>
>> But what about the docstring in that example? If you are methodic in your 
>> documentation and document everything, you will end up many times writing 
>> docstrings longer than the functions it self. I don't think it is something 
>> bad,  just annoying.
>> Also some programs generate automatically documentation for your api. For 
>> instance I use sphinx-doc and all exisiting docstrings are parsed and 
>> nicely documented automatically.
>>
>> what is your take on this?
>>
>> R
>>
>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/01a95b10-0d22-424d-9d10-b8642efbfab9n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/01a95b10-0d22-424d-9d10-b8642efbfab9n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/fb391bd2-1019-4be7-9eae-07aa42d12589n%40googlegroups.com.


[Maya-Python] docstring on obvious functions

2021-05-02 Thread Rudi Hammad

This not strictly related to maya but I wonder how you feel about it.
In sumary, I found my self in similar situations as this:
docstring example 


I think the link above isn't really answering what is was asked.
He was asking about docstrings and people where responding to comments. I 
agree that unless necesarry your code shouldn't need any comments if you 
respect some programing princpiples. So you never find your self in long 
functions that requieres explanations with comments. 

But what about the docstring in that example? If you are methodic in your 
documentation and document everything, you will end up many times writing 
docstrings longer than the functions it self. I don't think it is something 
bad,  just annoying.
Also some programs generate automatically documentation for your api. For 
instance I use sphinx-doc and all exisiting docstrings are parsed and 
nicely documented automatically.

what is your take on this?

R

-- 
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/01a95b10-0d22-424d-9d10-b8642efbfab9n%40googlegroups.com.


  1   2   3   >