2d Cutout Image Import Script

Has anyone had issues with how images with alpha rendered out? Everything works great … including the transparency in 3D view but when I render I get jagged edges, even with an image that has huge resolution.

Is there anyway to minimize this? I’ve tried FULL OSA and just upping the OSA samples and neither did anything.

SOLVED

under the TEXTURE TAB where the image is loaded you must select Premul(tiply) and everything then appears as it should in the final render.

I had started to put together a tutorial on 2d in Blender (pre this script update), based on a short I am half working on, I thought I would post it now anyway (pre audio, pre editing (zoom in etc) and pre part two(adding bones)) http://meanwhile.beds.ac.uk/dav/tests/BlenderTutorial1.m4v Hope it makes some sense…this might not be the best place to post but as its not 100% finished then oh well

What would be cool is if you could import Anime Studio or Moho files into Blender, considering the nature of the programs and tool sets it wouldnt be hard to do

Thanks for the comments (saw this got blendernationed).

@comeinandburn: The unfortunate thing about this is that the premul option isn’t available through the Python API right now, so it can’t be set automagically. Textures can’t be duplicated via python either (well its the image object that really needs to be duplicated and modified), so that throws out the window the idea of “template” textures as a workaround. Its very easy to add the ability in the source (see an earlier post), so it can be set, but it hasn’t been done so yet.

@adamprocter: Interesting tutorial. This script might be useful in that initial part.

@pheonix123: I believe those are (likely) vector files, though, right? If so, it’d probably be better to modify the SVG import script to do it, like a batch SVG importer…

Oh boy!! This is just great, brilliant, awesome!
Thank you ever so much forTe

I have a quite specific issue with the alpha premul option. Blender (stop me if I’m wrong) doesn’t premul sequence of images, only stills.
Then, I found this post:

http://blenderartists.org/forum/showthread.php?t=80615

and I thought “Woa! Imagine those two scripts working together!”
Now,

OH MY GOD!
THIS IS UNBELIEVABLE!!!
I don’t know if your script has anything to do with it, but as i was typing this post, i did a render of a png sequence imported with 2d cut-out, and guess what, BLENDER DOES PREMUL SEQUENCE OF IMAGES.

sorry, for the capitals but this is just bonkers! I’ve spend sleepless nights trying to get it to work and… woa…

So, well, thank you ever ever ever so much.

hmmm the combination of the 2 scripts seems like they could lead to some more ease of use when animating certain 2d situations

Very handy little script ! Thanks a lot !

On the animating side, I wrote a small script link (its a little particular, but that could be expanded) a couple months ago that lets you use an IPO curve to change the currently showing image in an animation (essentially to ‘key’ images):

http://gamulabs.freepgs.com/blends/scripts/imageChanger.zip

I’ve been meaning to learn PyDrivers, maybe its time to finally do it and make that script link a little more robust.

That little script works fine Would be great to have it as part of the main script.
And imagine an “Offset” option so that the texture would cycle through the images as the object move a set amount on a chosen axis! I’m thinking 2d walkcycles and such.
Well maybe that’s a tad specific, I just happened to be animating just that right now.

thanks for sharing your script ForTe :slight_smile:

Thanks a lot, man!

This is just about the most useful script I have used yet!!! Thank you sooooo much!!!

Oh, by the way, if anyone is wondering, this script works on Mac OS 10.5.6. (Think about it, it’s Python. Why wouldn’t it? :stuck_out_tongue: )

Can someone PLEASE tell me how to use scripts?!

I haven’t a clue where to start.
The only thing I know how to do is download them from a site. (>_<)

SE…,

  1. Create a folder somewhere, where you can store all of your scripts.
  2. Put the script and any others you download in this folder from now on.
  3. Open Blender
  4. Under the preferences drag down menu, click the “File Paths” button.
  5. One of the paths you can set is called “Scripts”, click the file select button next to it and select the scripts folder you created earlier.
  6. Close the preferences window by dragging it back up and, then press Cntrl + U to save this as your default start-up.
  7. Close and reopen blender.
  8. Change one of the subwindows to the UV/Image type then click “Image” in the header of this window. You should now see the name of the script as one of the options in that menu…, click it, and now you should see the GUI for this script.

hi,
this script will be included in Blender 2.49.
Thanks to forTe, Ideasman_42.
Congratulations to forTe

thanks forTe!!!

great to hear this will be included in Blender!

I use this script daily and sing it’s praises to anyone that will listen. You’ve put me one step closer to making my workflow completely open source.

thanks again!

Thanks forTe!!! u re the best:-)

Got a problem guys.
Since my last post, I got the script to work. And thanks to 0knowledge I’ve finally been able to save my settings. Oddly thought, the Preview Window takes FOREVER to render the default box and lighting. Don’t know what’s up with that.

Anywho, that’s not the problem I was speaking of. I now have 2.49 and need to use the awesome script again. But when I render, the CutOuts still show the plane. The transparent parts are no longer transparent!!! This only happens in the Rendering process. :frowning:

Here’s a example:
http://img80.imageshack.us/i/2derror.png/

Turn ‘Alpha’ to 0.

This is awesome. I’ve been looking for EXACTLY this type of a script. Thanks for your good work.