I tested the transparency attribute and it works for me. What version
of Maya are you using?

On Sep 3, 1:40 pm, Praxis <[email protected]> wrote:
> Hi Ryan
>
> Thanks for your answer and sorry for the typo with the “=” sign.
> The problem with this script is, that you do not get an error when you
> load the plugin, as the error code is in a “try” “except” block.
> The difference to the normal imagePlane is, as I understood, that they
> try to create an extra attribute called transparency, which is not
> working. When I tried to fix the code I came this fare, but if I try
> to execute the code above I get following error:
>
> // Error: in method 'MScriptUtil_setUcharArray', argument 1 of type
> 'unsigned char *'
> # Traceback (most recent call last):
> #   File "C:/Dokumente und Einstellungen/Ruth/Eigene
> Dateien/maya/2010/scripts/myImagePlane.py", line 86, in loadImageMap
> #     scriptUtil.setUcharArray( alpha , (1.0 - self.fTransparency),
> alphaIndex )
> # TypeError: in method 'MScriptUtil_setUcharArray', argument 1 of type
> 'unsigned char *' //
>
> I can load the script and I can load a background picture but the
> transparency attribute is not working and I do not know how to fix the
> code properly. It would be great if somebody could help me out.
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> charPixelPtr = image.pixels()
> for i in range( 0, size, 4):
>      alphaIndex = (i*4)+3
>      alpha = scriptUtil.getUcharArrayItem(charPixelPrt, alphaIndex)
>      #Here it comes:
>      scriptUtil.setUcharArray( alpha*(1.0 – self.fTransparency),
> alphaIndex)
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> This is the code an I would like to know why:
>
>         scriptUtil.setUcharArray( alpha*(1.0 – self.fTransparency),
> alphaIndex)
>
> give the above error.
>
> Thanks for you help.
> Praxis
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to