Re: [Maya-Python] V Crypt System

2021-09-13 Thread Justin Israel
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"
>>
>> 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 

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 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 

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 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() 

 
  

 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 

Re: [Maya-Python] V Crypt System

2021-09-13 Thread Reza Aarabi
agreed!

On Mon, Sep 13, 2021 at 10:07 AM Justin Israel 
wrote:

> 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 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()

 

 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 

Re: [Maya-Python] V Crypt System

2021-09-13 Thread Justin Israel
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 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()
>>>
>>> 
>>>
>>> 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 

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() 
>>
>> 
>>  
>>
>> 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 

Re: [Maya-Python] V Crypt System

2021-09-13 Thread Juan Moraga
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()
>
> 
>
> 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 

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() 

 
  

 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