Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Pages: 1 [2]

Author Topic: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)  (Read 3560 times)

neirao

  • Sr. Member
  • ****
  • Posts: 570
  • Neirao
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #15 on: October 21, 2016, 05:16:52 am »

wow thanks Raxx! you are a genius!! :)
i wake-up only for try it :)

no need auto create the texture! only this is very usefull.

Thanks!!!

i find only a problem(in this script version) is because we dont can select
the objects separately...

example:
there 3 objects(like a character "1 face" with "2 eyes") in stage...
and i need create for the eyes "outline thickness  value: 0.5"
and  the face  "outline thickness  value: 1.0" this is not possible in atual script
because he select ALL OBJECTS in SAME TIME!

is possible we can choose separate objets and apply the script?

thanks :)





« Last Edit: October 21, 2016, 05:30:15 am by neirao »
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #16 on: October 21, 2016, 05:38:41 am »

I chose to go the parametric shape route because it is easiest for the user to create and scale the outlines. In order to allow per-shape outline widths, I can offer two options:
  • The user appends "_###" (such as mesh01_1.25) to the name of a shape to set the exact width of the outline for that shape.
  • I change it to a command script, where you select a shape and then go to Scripts->Create Outline. Then to change the outline width, you go to Object->Attributes and find the float attribute that's named "mesh01_outlineWidth" and set the outline width there. Then you go to Scripts->Update Outlines to update the changes
#1 is easier for the user, in my opinion. I can also add an auto-width parameter to the parametric shape, where if you enable it then it makes the width of the outline related to the size of its bounding box. So smaller shapes would have smaller outlines, and bigger shapes would have bigger outlines.
Logged

neirao

  • Sr. Member
  • ****
  • Posts: 570
  • Neirao
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #17 on: October 21, 2016, 05:54:09 am »

nice Raxx,
right, i try using "_noOutline" in the mesh name works very well
and i agree:  using the "_###" is more easy. :)

but think with me, using the "_noOutline" in sequence(separate objects groups)
we need "every time" "put"' and "remove" this information, because the script will get all previous outlined objects...and create
outline again if we no remove/put this information...

if the script works "only in objects selecteds with mouse" this is time saved!

i dont know about the complex made this in this new change in script! ::)  :)

« Last Edit: October 21, 2016, 01:55:36 pm by neirao »
Logged

daniel99

  • Sr. Member
  • ****
  • Posts: 312
  • Me : Anim8or RULLZ \m/
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #18 on: October 21, 2016, 06:05:46 am »

Just a question about somethin' might be a problem sometimes, Raxx.
1 is the original mesh - lowpoly subdivided but not converted to mesh.
2 is the outline shape - subdivided converted to mesh.
When animating, the shapes bend differently because they're different poly count. (3)

Is there a way to correct this? (4) Maybe the script could generate the same type of mesh or maybe there's a technique?

Same problem I have when, for example, I apply fur (with Phur) to a mesh. Because the body mesh and the fur mesh have different polycounts. Any solution for such a problem?
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #19 on: October 21, 2016, 02:30:57 pm »

Ah, yes. I forgot about that issue. There's no way to access the control mesh via ASL, nor to convert the control mesh to a subdivision mesh within a parametric shape. I think I brought this up a few times in the past but these features have yet to be added.

The only real option would be to put the inner shapes to subdivision 0, update the CelShadurr shape, convert the CelShadurr shape to subdivided, and then revert the inner shapes back to their original subdivisions. Or else you could convert the inner shapes to mesh in their subdivided form. Same for PHUR.

It'd be nice if there was mesh generation and access in the Scene Editor...then I could just make the outline conform to the rigged/skinned/animated shapes. Same with PHUR (with more dynamic effects available).
Logged

daniel99

  • Sr. Member
  • ****
  • Posts: 312
  • Me : Anim8or RULLZ \m/
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #20 on: October 21, 2016, 04:50:48 pm »

Raxx. Oh, yeah! Good advice. Strange I didn't think about it. It solves all the problems for CelShadurr.
But I'm not sure it works for Phur, the reason being the fur is made of many hair meshes, and they will react to the bones the same way, subdivided or not. If I generate the fur on the unsubdivided body, the hairs will keep their original positions after subdivision of the body, so they won't match. Some of them will float in the air, in convex surfaces of the body, and some will be deep into the skin, in concave areas or the body...
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #21 on: October 21, 2016, 07:20:19 pm »

Yeah, PHUR is a little tricky. To get the best results you'd have to convert the body subdivision mesh to mesh so as to permanently make it subdivided. This way the PHUR will much more accurately stick to the mesh when it's all being deformed.

So when dealing with PHUR, I recommend trying your best to use weighted envelopes instead of painted weights. This way you can have an object containing your "working" version (non-converted-to-mesh shapes), and an object containing your "final" version (converted-to-mesh shapes). Then you skin the final version using envelopes and if you need to make changes you can edit the "working" version and replace the "final" version's contents with a copy of the "working" version.

Then, when you're 10000% sure your model is final, you can change over to painted weights and do some good quality weight painting.
« Last Edit: October 21, 2016, 07:22:44 pm by Raxx »
Logged

daniel99

  • Sr. Member
  • ****
  • Posts: 312
  • Me : Anim8or RULLZ \m/
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #22 on: October 21, 2016, 11:49:18 pm »

Yes, subdividing the body usually does the trick, but sometimes I need to keep it unconverted to mesh. Anyhow, with great care I kinda solve this problem, using precise movements and camera angles.
But you made some amazing scripts so far, so you really have my respect, sir.
Thanks, Raxx! :D
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #23 on: October 22, 2016, 06:09:33 am »

Raxx writes fantastic scripts, if you ask me. Nice work.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #24 on: October 22, 2016, 07:14:44 am »

Thanks :)

So here's quite possibly the last update to this script, until double sided materials gets implemented in ASL at least.

I'll make this the official release post for now.



CelShadurr, the script that doesn't actually shade anything

What it is
This is a parametric shape script that creates an outline around all mesh geometry in the object, kind of. You have to add a double-sided material to actually get the outline effect. But still....

Instructions
  • Install the script in your script directory and start Anim8or
  • The button will appear in the left-hand toolbar in the Object Editor. Click it
  • Click and drag in the workspace. You'll notice that all the meshes get covered by the parametric shape
  • Keep dragging until you get your desired thickness. Apply a double-sided material with the front side transparent.
  • To customize the outline...
    • You can change the thickness of the outline using the uniform scale tool, or otherwise by customizing its "Outline Thickness" parameter.
    • To customize the outline thickness on a per-shape basis, either append "_noOutline" for no outline on that shape, or "_####" where #### is the desired thickness in Anim8or units. For example, "mesh01_noOutline" would have no outline, and "mesh01_0.23" would have an outline that is 0.23 units thick
    • You can set Auto Width to 1 to enable the experimental auto width. Smaller shapes get smaller outlines and larger ones get larger outlines. This feature needs more effort on my end.
  • Note that the shape gets put in Layer 7 automatically, to make it super easy to hide and/or lock the outline.

Only tested in Anim8or dev release 1247
Logged

daniel99

  • Sr. Member
  • ****
  • Posts: 312
  • Me : Anim8or RULLZ \m/
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #25 on: October 22, 2016, 07:40:02 am »

Cool. Too bad you've changed the icon. It was funny and I was getting use to it :D
Logged

neirao

  • Sr. Member
  • ****
  • Posts: 570
  • Neirao
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #26 on: October 22, 2016, 04:33:02 pm »

Thanks again Raxx!

how i say before:
if the script works "only in objects selecteds with mouse" this is time saved!
with it, no need the "_noOutline" parameter! :)
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #27 on: October 22, 2016, 07:45:48 pm »

daniel99, yeah I liked it too, but the script was getting to be less turd-ly so I figured I'd change it. It's commented out in the script, so if you reeeeallly want it then you can change

ASL Snippet
  1. /*#button(26, 26, 2, 0x00000000, 0x00410200, 0x00420100, 0x00422108, 0x00206110, 0x0010e210, 0x0020c010, 0x0221b808, 0x0203fc08, 0x0107fc08, 0x0107cf00, 0x001f8040, 0x003e03a0, 0x007c3ff0, 0x00787ff8, 0x00fdfffc, 0x01fffffc, 0x01fffffe, 0x01fffffe, 0x01fffff6, 0x01ffffe2, 0x01ffff04, 0x00ffc008, 0x007ffff0, 0x00000000, 0x00000000);*/
  2. #button(32, 32, 2, 0xfffffffffe000000, 0xffffffffffc00000, 0xfffffffffff80000, 0xfffffffffffc0000, 0x01fe0000, 0x007f8000, 0x001fc000, 0x1007f000, 0x3803f800, 0x5400fc00, 0x10007e00, 0x101c3f00, 0x000c1f80, 0xfffffffff8140fc0, 0xffffffffaf2007c0, 0x55c003e0, 0xffffffffaaa001e0, 0x555001f0, 0xffffffffaaa838f8, 0x55541878, 0xffffffffa22a287c, 0x4881403c, 0xffffffffa20a803e, 0x2820801e, 0x4402401f, 0x1080421f, 0xffffffff8004a10f, 0x00002f8f, 0x00001107, 0x00009207, 0x00001007, 0x00001007);

to
ASL Snippet
  1. #button(26, 26, 2, 0x00000000, 0x00410200, 0x00420100, 0x00422108, 0x00206110, 0x0010e210, 0x0020c010, 0x0221b808, 0x0203fc08, 0x0107fc08, 0x0107cf00, 0x001f8040, 0x003e03a0, 0x007c3ff0, 0x00787ff8, 0x00fdfffc, 0x01fffffc, 0x01fffffe, 0x01fffffe, 0x01fffff6, 0x01ffffe2, 0x01ffff04, 0x00ffc008, 0x007ffff0, 0x00000000, 0x00000000);


In a text editor.

neirao, sadly a parametric shape deselects all other shapes before it is created, so there's no way for the script to determine what was selected or not. I submitted a feature request that would fix this. I have v0.4 ready and waiting with it already implemented, on the off chance that Steve can get to it.
Logged

neirao

  • Sr. Member
  • ****
  • Posts: 570
  • Neirao
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #28 on: October 22, 2016, 11:40:12 pm »

all right, :)
I understand the programming limitations.
your script is already very good, very helpful! only I asked about the change even if it is not possible to be able to go on record here in the forum! :)
thank you anyway!
Logged

daniel99

  • Sr. Member
  • ****
  • Posts: 312
  • Me : Anim8or RULLZ \m/
    • View Profile
Re: SCRIPT REQUEST! - 2D cell shading (AUTO GENERATOR)
« Reply #29 on: October 24, 2016, 03:31:07 am »

Raxx: I was thinking to look for that! :D Thanks, bro! Great job!
Logged
Pages: 1 [2]