Re: [Maya-Python] ImageMagick and subprocess

2016-08-30 Thread Mahmoodreza Aarabi
so i should get stderr in subprocess.
ok thanks guy
i will test and say about it

On Tue, Aug 30, 2016 at 11:48 PM, Justin Israel 
wrote:

> Yes, OpenImageIO comes with python bindings. We use them at Weta in
> python, C++,  Go, and command line form.
>
> And yea, that output you are seeing from the ImageMagick binary is a
> warning on stderr
>
> Justin
>
> On Wed, 31 Aug 2016, 5:57 AM Robert White 
> wrote:
>
>> If you're running this from python, take a look at
>> http://docs.wand-py.org/en/0.4.3/ .
>> I've not used it myself, but I've had a few people I trust recommend it.
>>
>>
>> On Tuesday, August 30, 2016 at 8:16:53 AM UTC-5, Cesar Saez wrote:
>>>
>>> Hi,
>>> You have check imagemagick/whatever-app return codes by getting its
>>> stdin/stdout/stderr pipes (check subprocess docs, it is straight forward).
>>>
>>> Cheers!
>>>
>> --
>> 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/0b50b86f-511c-4e3f-aa84-
>> 498cecfdbbd6%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/CAPGFgA2ZVL98BuyHfzgFtHaoFznah
> wjPgMWvUhmFJgwX5_t7oA%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 


Bests,
madoodia

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


[Maya-Python] Retrieving data from DataBlock bottleneck

2016-08-30 Thread Kaine van Gemert
Hi!

I'm writing a custom deformer using the C++ API (I hope it's okay to post 
that here!) that operates on many individual meshes. I've found that one of 
my biggest bottlenecks is simply reading the data from my inputs.

As an example, if I create a deformer that does nothing but get the value 
of a single plug:

MStatus MyDeformer::deform(MDataBlock& data, MItGeometry& itGeo,
const MMatrix& localToWorldMatrix, unsigned int geomIndex)
{
MStatus status;

MMatrix inputMatrix = data.inputValue(aInputMatrix).asMatrix();

return MS::kSuccess;
}

and then in my Maya scene, if I plug 20 meshes into this deformer, or plug 
20 meshes into 20 of these deformers (the performance seems to be 
equivalent) and constantly change the input matrix (locators world matrix 
in my tests) I get an increase in CPU usage
of around 19% compared to if these deformers were not present.

To test, I created 20 DistanceDimension nodes, which at the very least have 
to read the two inputs from the data block for the start and end positions, 
do a calculation and finally do some drawing in the viewport for the 
display, and I only get an increase of 6%, compared to my 19%! :(

(I've also tried changing the matrix attribute to a double3 in case getting 
matrices were just particularly slow)

Is there a way to optimize this? How do these in-built nodes read the data 
so efficiently? My node has several attributes that is has to get and just 
reading these inputs is destroying my CPU..

Thanks!
Kaine

-- 
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/eff3a7ee-ed63-40b3-8169-6251c3cc3f3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Selects only the group nodes

2016-08-30 Thread Justin Israel
On Wed, Aug 31, 2016 at 10:24 AM Marcus Ottosson 
wrote:

> I am only expecting groups
>
> I think the reason Justin was asking this, was because in Maya, there is
> no concept of “group”, only “transforms without shape”. You can prove this
> to yourself, by deleting the shape from any transform, such as a sphere or
> locator and witness it become what you refer to as “group”.
>

Yep, that was my intent. Thanks Marcus!


> ​
>
> On 30 August 2016 at 23:16, likage  wrote:
>
>> @justin
>> I am only expecting groups, and hence I am not expecting any pSphere1 or
>> locator1 in this case.
>>
>> @Kurian
>> That works great! Just wanted to ask is using *list* and *set* necessary?
>> I tried removing them and they worked too
>>
>> --
>> 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/e7323b1f-84f1-40cc-859b-25b4d5737ff5%40googlegroups.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> *Marcus Ottosson*
> konstrukt...@gmail.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_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOA%2B2q%2B-k%3D_Ta%2B9JvW_z6kX3VfzZX87z07m1a2_kdoQihw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1D0bMTaXWbD7UHbVTRw_uZ0rTGCtkxoaiDHe0ekZELSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Selects only the group nodes

2016-08-30 Thread Marcus Ottosson
I am only expecting groups

I think the reason Justin was asking this, was because in Maya, there is no
concept of “group”, only “transforms without shape”. You can prove this to
yourself, by deleting the shape from any transform, such as a sphere or
locator and witness it become what you refer to as “group”.
​

On 30 August 2016 at 23:16, likage  wrote:

> @justin
> I am only expecting groups, and hence I am not expecting any pSphere1 or
> locator1 in this case.
>
> @Kurian
> That works great! Just wanted to ask is using *list* and *set* necessary?
> I tried removing them and they worked too
>
> --
> 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/e7323b1f-84f1-40cc-859b-
> 25b4d5737ff5%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
konstrukt...@gmail.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_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOA%2B2q%2B-k%3D_Ta%2B9JvW_z6kX3VfzZX87z07m1a2_kdoQihw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Selects only the group nodes

2016-08-30 Thread Justin Israel
On Wed, Aug 31, 2016 at 10:16 AM likage  wrote:

> @justin
> I am only expecting groups, and hence I am not expecting any pSphere1 or
> locator1 in this case.
>

Right. So your original solution would not work correctly in this case,
because it would return transforms for other objects as well


>
> @Kurian
> That works great! Just wanted to ask is using *list* and *set* necessary?
> I tried removing them and they worked too
>

While there would not be duplicate items in this approach, there could be
duplicate names at different parts of the hierarchy (depending on whether
you are asking for full paths or not)


> --
> 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/e7323b1f-84f1-40cc-859b-25b4d5737ff5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2OQe0YfGx4U-%2BpqPXQupfjD%3DW%2BtagAg3yakO0TZq%2B-wQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Selects only the group nodes

2016-08-30 Thread likage
@justin
I am only expecting groups, and hence I am not expecting any pSphere1 or 
locator1 in this case.

@Kurian
That works great! Just wanted to ask is using *list* and *set* necessary?
I tried removing them and they worked too

-- 
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/e7323b1f-84f1-40cc-859b-25b4d5737ff5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] ImageMagick and subprocess

2016-08-30 Thread Justin Israel
Yes, OpenImageIO comes with python bindings. We use them at Weta in python,
C++,  Go, and command line form.

And yea, that output you are seeing from the ImageMagick binary is a
warning on stderr

Justin

On Wed, 31 Aug 2016, 5:57 AM Robert White  wrote:

> If you're running this from python, take a look at
> http://docs.wand-py.org/en/0.4.3/ .
> I've not used it myself, but I've had a few people I trust recommend it.
>
>
> On Tuesday, August 30, 2016 at 8:16:53 AM UTC-5, Cesar Saez wrote:
>>
>> Hi,
>> You have check imagemagick/whatever-app return codes by getting its
>> stdin/stdout/stderr pipes (check subprocess docs, it is straight forward).
>>
>> Cheers!
>>
> --
> 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/0b50b86f-511c-4e3f-aa84-498cecfdbbd6%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2ZVL98BuyHfzgFtHaoFznahwjPgMWvUhmFJgwX5_t7oA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] ImageMagick and subprocess

2016-08-30 Thread Robert White
If you're running this from python, take a look 
at http://docs.wand-py.org/en/0.4.3/ .
I've not used it myself, but I've had a few people I trust recommend it.

On Tuesday, August 30, 2016 at 8:16:53 AM UTC-5, Cesar Saez wrote:
>
> Hi, 
> You have check imagemagick/whatever-app return codes by getting its 
> stdin/stdout/stderr pipes (check subprocess docs, it is straight forward).
>
> Cheers! 
>

-- 
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/0b50b86f-511c-4e3f-aa84-498cecfdbbd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] ImageMagick and subprocess

2016-08-30 Thread Cesar Saez
Hi,
You have check imagemagick/whatever-app return codes by getting its
stdin/stdout/stderr pipes (check subprocess docs, it is straight forward).

Cheers!

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


[Maya-Python] ImageMagick and subprocess

2016-08-30 Thread Mahmoodreza Aarabi


Hello guys

There is a command based software for converting images and formats named 
ImageMagick

i created an ui to give artist to use commands of imageMagick easily, when 
i run command for converting my images, it works until a file has problem, 
in this way magick give an error that i can’t get it as an exception to 
handle it.
error: magick: Incompatible type for "RichTIFFIPTC"; tag 
ignored.TIFFFetchNormalTag’ 
@ warning/tiff.c/TIFFWarnings/905.`

there is any experience to help?
or using other modules is better than this?
for example OpenImageIO of sony picture, it have module for python?

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/68ddbea8-63a6-4a68-9e70-407e22bfc177%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.