PDA

View Full Version : Box folding today, fastest method, best control etc..



prometheus
09-12-2015, 10:48 AM
So if I had to fold a 2d box in to 3d or a bit more complicated boxes with more segments to fold, what would be the best and perhaps fastest method today to use.
Making it unwelded and with weight maps? bones or simple morphing by using the axis rotate tool..use bones? does RRtools offer immeditate control for such things?

questionable wether to use unwelded geometry vs connected geometry?

Michael

ernpchan
09-12-2015, 10:54 AM
I would use bones so the rotations would be clean. I've kept the geo welded as my walls were thing so any collapsing on the corner wasn't noticeable. If you have thick walls I suppose you could use a morph to account for joint correction.

prometheus
09-12-2015, 10:57 AM
right now it is just plain flat parts without thickness..might need to work on thickened geometry though.
Using the newer axis rotate tool..no need to unweld, and picking first and second vertex along the edge then rotating within a morph works quite fast, if you first select the polypart that is to be rotated then use the axis rotate tool the way I mentioned...animation wise It might be better to use bones perhaps.

jeric_synergy
09-12-2015, 10:57 AM
The times I've had to do this the challenge was to get the 'hinge' parts to be nice and curved, rather than sharp.

How would unwelding help there?

prometheus
09-12-2015, 11:08 AM
The times I've had to do this the challenge was to get the 'hinge' parts to be nice and curved, rather than sharp.

How would unwelding help there?

It wonīt, in such case it would probably be good to use subdivided geo, and bones and weightmaps I reckon.

the box I am fiddling with now is extracted from a pdf document to get exact shape from that, it would impose a problem since it is only outlines and I would have to add additional geo..or divisions at the edges around the corners that would need to rotate/fold.

jeric_synergy
09-12-2015, 11:40 AM
Using the newer axis rotate tool..no need to unweld, and picking first and second vertex along the edge then rotating within a morph works quite fast...
So, you're not animating the folding?

In that case I'd think any tool would work, plus Thicken. --Got any RW sample pix of what they have you trying to do?

prometheus
09-12-2015, 11:55 AM
So, you're not animating the folding?

In that case I'd think any tool would work, plus Thicken. --Got any RW sample pix of what they have you trying to do?

what did you get that from? I do want to animate it, but you can do that with morphs and axis rotate..and without unwelding the geo, and without weight maps.

so many different ways..I havenīt worked much with it, but I do now there are ways to do it..so I am not completly lost..just trying to pin down the most apporpiate ways.

this is the artwork to be folded.

129709

jeric_synergy
09-12-2015, 11:57 AM
Axis Rotate is a modeling tool, correct? Normally, I'd avoid morphing in animating rigid folding, because morphing points move in straight lines, which is usually not desired nor convenient to get around.

prometheus
09-12-2015, 12:04 PM
Axis Rotate is a modeling tool, correct? Normally, I'd avoid morphing in animating rigid folding, because morphing points move in straight lines, which is usually not desired nor convenient to get around.

true...yes, with a simple box fold you would get the last fold closure distorted until it is closed, probably would have to work with several morps in such case.
and yes axis rotate is a modeling tool of later introduction to modeler, just select polygon part to fold, click on that parts (corner fold edge) first edge vertex and last vertex.. and then just rotate with the hud display, or numericaly 90 degree, only the selected polygon will rotate...and you do that in the morph layer you create of course.

the advantage might be itīs faster than going through weightmaps and bones setup, downside ..the control in the animation.

I added my artwork image to fold in my post above.

jeric_synergy
09-12-2015, 12:14 PM
Yeah, I think you'll find morphing won't make you happy. Go bones.

MonroePoteet
09-12-2015, 03:05 PM
IMO, definitely a job for bones. No need to unweld the geometry with weight maps. Here's a very rough scene, using weight maps and named bones (from skelegons drawn in Modeler). Missed a flap that needs folding, though.

mTp

shrox
09-12-2015, 03:54 PM
When I worked at Pizza Hut and Dominos, I could fold a pizza box in less than a second. Certainly would take me longer with this...

prometheus
09-13-2015, 08:38 AM
IMO, definitely a job for bones. No need to unweld the geometry with weight maps. Here's a very rough scene, using weight maps and named bones (from skelegons drawn in Modeler). Missed a flap that needs folding, though.

mTp


Thanks for testing out this based upon the 2d artwork, and yes, that is what I will go for too probably, I knew how to set it up though..but your sample confirms that what I had in mind works nicely too.
canīt use your model since it is a mockup and not accurate, but it will serve as a guide...thanks, you also got weird (non planar poly) and opengl errors on the same flap that I got, shows in open gl, and in render.

Thanks.

Michael

MonroePoteet
09-13-2015, 08:50 AM
Yes, this was intended only as a rough mock-up of your end goal and only took a few minutes to model and set up. A fun exercise, though.

mTp

objuan
09-13-2015, 01:08 PM
If your not going for curvaceous distorted corners, could well be that just having each side as it's own object layer and placing your centers properly could be the easiest way to go.

shrox
09-13-2015, 02:09 PM
When I worked at Pizza Hut and Dominos, I could fold a pizza box in less than a second. Certainly would take me longer with this...

That just made me remember that boxes have an embossed line for the fold, adding that might even help with the deformation.

prometheus
09-13-2015, 02:54 PM
Yes, this was intended only as a rough mock-up of your end goal and only took a few minutes to model and set up. A fun exercise, though.

mTp

Oops..I got enormous mess with weights her, I tried to copy your bones on to my model, then assign corresponding flap weights by setting skelegon weigths, but it only works on the side bones properly.

Then I tested your object model..and I canīt see your model set up in modeler with the weightmaps..only in layout, so that is probably get it all messed up.

The weird thing Is that I canīt get your model to work when just sending it to layout and trying to animate from scratch, even though I manually assign them in layout.

prometheus
09-13-2015, 03:53 PM
Ah..missed the parenting order too.

prometheus
09-13-2015, 06:54 PM
got the folding as it should be and with animation...but another issue, the artwork is drawn from top and I got two sides, the problem is when I extruded the geo to give som thickness, and the bottom part comes out as negative in text...I am sure some of you guys have encountered that before, itīs odd...I have tested flipping etc..but I donīt get it right on the outside..I should know this.

I made the inside surface uniqe as inside, and the outside unique as outside, and made uvīs planar.

jeric_synergy
09-13-2015, 08:00 PM
The image is backwards, you're saying? Scale by a negative value.

(Or just surrender and flip it in PShop.)

Wait, isn't that what Sensei's new free plugin does? Flip images in the Image Editor??

prometheus
09-13-2015, 09:29 PM
The image is backwards, you're saying? Scale by a negative value.

(Or just surrender and flip it in PShop.)

Wait, isn't that what Sensei's new free plugin does? Flip images in the Image Editor??

I have no need of flipping the images in image editor..could just as well flip it in photoshop or rotate it in surface editor...but..I
Canīt really flip the image by rotating in surface editor or flipping in photoshop, since the image itself isnīt quadratic, itīs the same as the artwork shape, so the outside would be completly wrong.
Canīt see any way to fix that with uvīs either...maybe unwelding and place each part individually, but not sure thatīs the best way.

I could also possible adjust the artwork in illustrator and only flip text, but there will still be the background image, I could also maybe just select the image part that isnīt outside edges and flip that..and then just expand the outside edges color.

hard for you guys to get a picture of it, I would need to post an image..which I can not do for this artwork, I could however create a similar one and post.

prometheus
09-13-2015, 10:31 PM
think I will solve it by first ajdust the image in photoshop so the edge flap parts are not shaped in the form of the artwork as they are now, I will just fill that out ..so it "bleeds" fully out in rectangular shape..then it should be quite simple to flip it and get it correct..I think, but I will have to do that much later..time to sleep now.

jaxtone
09-18-2015, 03:45 PM
Why not keep it simple and use morph targets?

jaxtone
09-18-2015, 04:25 PM
Why not keep it simple even with thickness and separate UV-maps for whatever you want?

If there are any questions I am here to answer!

Maybe this isn't advanced or based on scripts, nodes or time consuming brilliance, but this is the way I would have done it if there were a tight deadline to keep my customer happy!

Regards, Jack

jeric_synergy
09-18-2015, 04:54 PM
Cuz morphs only move in straight lines. Anytime you want a path to move on a curved line, you're boned. :D

prometheus
09-18-2015, 07:09 PM
Why not keep it simple even with thickness and separate UV-maps for whatever you want?

If there are any questions I am here to answer!

Maybe this isn't advanced or based on scripts, nodes or time consuming brilliance, but this is the way I would have done it if there were a tight deadline to keep my customer happy!

Regards, Jack

that will not look right, and your sample showcases that when you see the flaps to be sort of stretched while folding, a box donīt fold like that in real life, and you can see it also on the text stretching.

I went for weightmaps and bones...since I havenīt done it before..I ran in to a lot of issues..but that was a useful insight on how to approach it.
the main issues might really not have been setting bones and weight maps...rather how I aproached creating the artwork to be folded..I tried to go the fastest way..a cheap shot by exporting out the eps outlines from the provided pdf artwork, thus resulting
in not so clean point alignment ..and that messed up the surface shading, that is what caused issues, the rest was just a matter of understanding the parenting of the bones and take notes on which bones to rotate and fold.
I should have just used the artwork as backdrop and modeled from scratch and trace the shapes, to get clean geometry.

separate uv maps? yes most likely..that is another question and I will probably do that..though it wasnīt necessary for that moment, it will be later.


Cuz morphs only move in straight lines. Anytime you want a path to move on a curved line, you're boned. :D

As I mentioned above and as we discussed earlier, you are right.

jaxtone
09-19-2015, 12:54 AM
You are definitely right! There are distortions and stretches that never will reach a good end result...

jeric_synergy
09-19-2015, 01:00 AM
what was the issue with the reversing image? I thought UV mapping would prevent that.

prometheus
09-19-2015, 12:56 PM
what was the issue with the reversing image? I thought UV mapping would prevent that.

I have dropped the project for now..it was just a draft sketch proposal that didnīt need to be finished.
But I am sure I went on mapping it wrong..but will look at it later again, probably just went all wrong with one uv map instead of splitting it as jaxtone mentioned.

Michael

jeric_synergy
09-19-2015, 09:31 PM
Well, boxes are PRINTED as one flat object: I'd think UV mapping would be a natural for that.

Greenlaw
09-20-2015, 01:16 AM
Many years ago I worked on a test for a commercial where I had to fold a paper towel into various origami shapes. During R&D, we tried non-linear morphs, bones, object replacement--you name it. For the final commercial, I believe the crew on that project wound up using a combination of bones and morphing but they also cheated quite a bit since the folding had to occur very quickly.

Sorry, I don't remember exactly how the final version was done; by that point, I must have been busy with the next project. However, in my test, I folded an origami crane using bones and non-linear morphing (at the time I used Colin Cohen's NLM plugin), and used one of the third party edge shaders to give the paper apparent thickness. I got the test to mostly work but we didn't use that method because it was too complicated and I didn't feel I could respond to client changes quickly enough with it. (This was probably back in Lightwave 8 days or earlier.)

Box folding should be much easier than origami folding though (far fewer folds and angles) and I think it could be done with bones alone. If it's absolutely necessary to see the cardboard bend properly up close, you might add some joint morphs.

G.

P.S., Oh, I just remember--the 'paper' for my test had to be sub-divided in a really crazy pattern to allow it to crease nicely. That should be a lot easier for a box though.

jeric_synergy
09-20-2015, 09:08 AM
Well, boxes are PRINTED as one flat object: I'd think UV mapping would be a natural for that.
Arghghg, what am I saying? ANY planar projection should work.

prometheus
09-20-2015, 09:22 AM
would have to post a sample later..but canīt use the artwork.
planar projection might work..I tried both, but when the artwork images consist of different colors following the same shape as the outline of the actual geometry..so if those color images and borders are following the shape correctly but not the text...then it can be tricky to scale or rotate it to get proper miror projection without screwing up the outline color shapes...or vice versa getting the text to be correct.

hard to explain, might have missed something when doing it..but it wasnīt as easy as I thought, but I donīt have time to revisit it right now..later.

prometheus
09-20-2015, 09:26 AM
Many years ago I worked on a test for a commercial where I had to fold a paper towel into various origami shapes. During R&D, we tried non-linear morphs, bones, object replacement--you name it. For the final commercial, I believe the crew on that project wound up using a combination of bones and morphing but they also cheated quite a bit since the folding had to occur very quickly.

Sorry, I don't remember exactly how the final version was done; by that point, I must have been busy with the next project. However, in my test, I folded an origami crane using bones and non-linear morphing (at the time I used Colin Cohen's NLM plugin), and used one of the third party edge shaders to give the paper apparent thickness. I got the test to mostly work but we didn't use that method because it was too complicated and I didn't feel I could respond to client changes quickly enough with it. (This was probably back in Lightwave 8 days or earlier.)

Box folding should be much easier than origami folding though (far fewer folds and angles) and I think it could be done with bones alone. If it's absolutely necessary to see the cardboard bend properly up close, you might add some joint morphs.

G.

P.S., Oh, I just remember--the 'paper' for my test had to be sub-divided in a really crazy pattern to allow it to crease nicely. That should be a lot easier for a box though.


regarding the folding...I simply followed monroepootet sample, with bones and weights, just got some errors when trying modify his sample..but creating it from scratch worked after some trial and errors.

jeric_synergy
09-20-2015, 09:27 AM
The box is printed flat, sooooo......

prometheus
09-20-2015, 09:28 AM
The box is printed flat, sooooo......

You donīt seem to get it...but I canīt really explain it either without a showcase..but letīs drop it till I have done so.

MonroePoteet
09-21-2015, 09:57 AM
If I understand the UV map problem you're having correctly, the basic issue is that the UV map is created from the Top, even if you select polygons in the Bottom view. So, when the box flaps are folded upward as in the previous scene I attached, the Bottom of the geometry ends up on the outside of the box and the UV Map is flipped. To fix this, you have to fold the box downward rather than upward so the Top of the geometry remains on the outside, as in the attached scene. To do so, I just inverted the Pitch channel on each bone from -90 to 90. Maybe I'm not understanding the issue, though.

mTp