2D Cutout Image Import Script - no alpha in render

Hi,

I’m playing with the 2D Cutout Image Import Script but I just can’t get it working right. It might just be because of my lack of blender knowledge.

It shows the alpha just fine in the viewport, but isn’t it supposed to render with alpha too out of the box?

This is what I get :frowning:

http://img92.imageshack.us/img92/5009/blenderalpharenderqx4.th.png

You need to set alpha to zero.

I changed the setting back in this version so it better reflected the materials panels. I’ll look into seeing which setting (0 or 1) is better in the next version when I revamp the GUI.

I’ve noticed another issue with repeat versus extend set for the texture. I’ll have to play with it some more to work out what’s best (or do the GUI redesign sooner than I though, so I can incorporate that option).

Just to be sure, you mean the “A”-slider in the Material panel - right?

Then I do get alpha alright, but it still doesn’t resemble the nice smooth alpha values I can see in the viewport. I’ts like it only accepts 100% alpha or nothing at all :confused:

http://img66.imageshack.us/img66/732/strangealpharender2yj3.th.jpg

So its a .png?

I have never used the “2D cutout import script.”
Does it create a “cutout” mesh of the image?
If not, there are other ways of showing transparencies in blender.

Yes its the A-Slider.

I believe this jaggedness issue (at least in my tests) is caused by the resolution of the image. You can smooth out some of it with the filter option in textures (but not all of it). Image textures will do this aliasing thing if you try to render them at a larger resolution that they are (or essentially one pixel of your image texture fills up more than one pixel of your render).

And before you ask, those lines on the left and top of your plane are caused by having the image set to repeat or the UV coordinates being slightly off (though, they didn’t change between the two versions of the script, so not sure what’s going on, if its just round off error or what…) (it can be fixed by setting the image texture to extend, though). I’ll have to play around with it to see whats going on.

Does the script create a mesh according to the image?
is this script preloaded with blender?

I think this script was intended for images with less smooth falloff of transparency.

Actually the texture is larger (640x640) than the plane on the rendered image. Also, the main problem is that the rendered image doesn’t show all the alpha values in between 0%alpha and 100% alpha.

Just look at the original texture - it was made with a very smooth brush:
http://img511.imageshack.us/img511/6015/alphatestqm5.th.png

And if you look at the first picture again, you can see that all the alpha values looks perfect in blenders viewport. But when it’s rendered it looks, uhmmm, not as good.

Yes.

It creates a plane and assigns the image as a texture. Its actually a really cool script :slight_smile:

You can download it at forTe’s site: http://gamulabs.freepgs.com/blends/scripts/

Well, the script “just” makes a plane and assigns a material and a texture to it. So if anything, it’s blender that doesn’t support the smooth falloff of the transparency.

Hey maybe you can help me here. I tryed to make a new thread but it does not showing up for hours now.
I try to do the same thing like OP. I did not use the script though I followed this tutorial
http://wiki.blender.org/index.php/Tutorials/Textures/Use_Alpha_for_Object_Transparency

It’s all worked out fine but when I rendered video I saw that planes are still visible… They create some kind of distortion, looks like thin glass or something. And because I have a wood texture on the background it’s really visible, especialy when they are moving.
Can you help me with this one please…

As I haven’t used that particular script yet I only can make a suggestion. My experience is with alpha in images that if an image uses an alpha channel it is the best to use the ‘premul’ button in the texture buttons window. This should allow you to use also images with soft brushes and alpha (see screenshot).

Attachments


Ah, thanks. That helped a little :yes:

However there are still a few strange things going on:
http://img399.imageshack.us/img399/4849/stillstrangerenderid4.th.png

I made a little test with the script (cool script) and found the import settings of the scripts as shown in the screen shot. It seems to work in the way you’d expect it. I used your image from this thread. For the material settings I have attached the blend file as well.

Attachments


transpTest2DCutout.blend (198 KB)

Okay this is really strange. I downloaded the blend file (and changed the path for the texture to where I have the png file on my computer), and this is what I get:

http://img206.imageshack.us/img206/1415/macosxstrangeai5.th.png

The only difference I can see is that I use Mac OS X, and you use Linux (judging from the “home/” in the texture path) :confused:

I will see if I can get my Ubuntu computer up and running and test the file on that mashine.

Well, that is indeed strange! Just to be sure: when I looked at your screenshot the script settings seem to differ from the ones in my screenshot. I assume that you have set the script settings accordingly before pressing the ‘Single Image’ button to load the image. I’ll give it a test on WIN XP as well (unfortunately I don’t have a Mac here to check).

EDIT: test on Win XP is fine. I had to pack the image into the file which I did not do with the blend file posted as I thought to remember that the premul option wouldn’t work with packed i ages. As the render was OK I have attached the packed file to this post.

You are right that I did the test on linux (ubuntu 7.10), sorry to not have mentioned that explicitly.

Attachments

transpTest2DCutout_packed.blend (412 KB)

I didn’t run the script, I only changed the path to the texture. However I DO know what went wrong! When you change the path to a texture, blender automatically turns off the “Premul”-button. I didn’t notice that. If I turn it on again, the render looks like yours.

But I still don’t know what went wrong with my first render when I turned on Premul, and I’m not really sure I want to know now. I think I’ve had enough of this adventure already…

I will like to thank everyone who have helped me in this little quest :slight_smile: