UV packing

(ambi) #283

Are you using 2.79 or 2.80 version of the addon? Try setting pruning ratio to 0.0. There’s a bug in the simplification algorithm that cuts some corners, it’s already fixed but hasn’t been pushed to Gumroad yet. You can also try using the “Select broken UV islands” operator in Shotpacker Tools, if it shows anything. I’m also happy to look at the .blend if that is available.

(ambi) #284

If I’m understanding you right, you can just use the “Island selection behavior” set to “ignore”, select the islands you want to pack, pack them, then just move them 1.0 UV coordinates to the right.

(mathieu) #285

I was speaking about the mesh itself in the 3D view, no UV. I guess your algorithm can work with everything that is 2D? So I was asking if it would be possible to use this algorithm to pack flat loose parts of a mesh object. It would help to minimize material lost when sending data to a CNC machine.

(ambi) #286

That’s an interesting use case. I’m just not very familiar with it. You would have to point me to examples of exactly what you’re doing and how. Is it just flat polygons you’re trying to pack? Some sort of file output from the UV packer that saves .json of the polygons wouldn’t be too difficult to implement. Then you could have an external script to generate G-code out of that. Of course, any complex object and the process would fail. This would work only on completely flat objects that can be projected to 2D with no overlapping geometry.

(mathieu) #287

It’s to cut out height lines in cardboard, to build height models out of it. At the moment, we can either print one height-line per cardboard, having a lot of losses or manually rotate and place each height line to minimize losses, which is very time consuming for big models. But as your algorithm does exactly that, I thought it would be easy to port it so that it moves the polygons instead of the UV islands. We need it to work on the mesh itself as UV doesn’t keep the real size. Of course, it’s all 2D as it’s only height lines. You don’t even need to project as it’s already the case. Only rotate and translate in 2D to pack it all nicely.

(Dzmitry) #288

I use 2.79b and texture atlas addon to unwrap multiple objects at same time. After some messing around it solved it self, but here is copy of file with problem present.

1 Like
(ambi) #289

You can project from view to get the UV from the mesh. Then use Shotpacker “Lock” setting in Shotpacker Options panel to not scale anything. Then you can use TexTools Mesh Texture feature (Create UV Mesh operator) to convert the UV back to mesh. TexTools makes some shape keys for the created mesh, it’s probably best to delete those to avoid any complications. This seems to maintain the scale.

(mathieu) #290

will try it thanks :slight_smile:

(Leon) #291

Hi there, I’m working with Blender 2.8 and I have the problem, that if I unwrap multiple objects at once Shotpacker (latest version installed) only seems to consider the UVs of the active object rather than all the selected objects. Is there already a solution to this problem or is it new?
Best regards and kudos to your otherwise awesome addon :smile:

(ambi) #292

It’s not a new problem, and I’m working on it. There are many updates and improvements on my plate currently and it might take a while until I get everything to a state that it can be released.

(ambi) #293

I uploaded shotpacker_2.0-alpha2-b2.80 to Gumroad. It removes old Python packing functionality and only uses compiled, accelerated modules.

Anyone with MacOS willing to give it a shot and tell if it works ok? I’m only able to build and test it from command line, but Blender doesn’t run inside a Mac inside a virtual machine.

It’s not out yet officially as there are still couple of things I want to get done and some bugs out to be squished.

1 Like
(bedlam) #294

Hey @ambi, just did a quick test since I´m on a Mac at work.
the pip installation code isnt working:

When i tried running your code manually it seems to work:

bpy.app.binary_path_python returns this path (made it relative here).

when executing that file from commandline it seems to work fine (ensurepip, install cffi, install pyclipper all works).

And after this shotpacker recognises that all dependencies are installed and seems to be working fine (just did a quick “Start pack” on a poorly unwrapped model :slight_smile: )

edit: I had a n issue with DECALmachine not installing PIL aswell, but after I ran the steps above it seems to have “fixed” the DECAL machine issue aswell.

1 Like
(ambi) #295

Thank you for testing it out. I’ll try to see if I can also make the Mac install one click, but still going to push the release if I can’t make that happen.

(bedlam) #296

By the way, I don´t know if this has been mentioned, but packing in multi-edit-mode does not seem to work (in this release or the ones prior). It would be REALLY awesome to get that working. It does seem to be working now with blenders normal packing

edit: hmm, my bad, it seems to be working sometimes… i´ll get back to you if I find any kind of pattern as to when it doesn´t work

1 Like
(ambi) #297

Yeah there was a bug where if you had different objects with the same mesh (linked), it didn’t pack them right. It’s already fixed. Only a couple of things left to do and then I can push beta (that will include the fix).

(ambi) #298

Shotpacker 2.0 beta1 is up (shotpacker_2.0-beta1-b2.80.zip)

  • Overlapping should work for all cases with no issues, chaining islands, different shapes. As long as they overlap at some point.

  • Faster initialization, much faster packing

  • Automatic stacking of identical UV islands

  • Optional pixel based margin setting (can be changed to old version from preferences)

  • Many bugs squished

  • Acceleration should work on all 64-bit Windows, Linux, Mac.

I’ll do some testing and possibly some documentation and videos and then push for the full release.

(colkai) #299

I’m getting odd results with an object using multiple materials. If I isolate the material to it’s own object, shotpacker will act as expected. If left in the main object, it throws the islands outside of the 1x1 UV grid and tends to overlap them quite badly. Using 2.79 with the latest version of shotpacker. Depending on if I have “selected” active, it actually crashed out after seemign to “hang” for a while.
Once separated, it is a lot faster and always keeps the UVs as expected, in order to get the result I wanted, I had to resort to separating by material, running shotpacker on the various bits and then re-joining them.

(ambi) #300

Thanks for letting me know. I’ll look into that.

edit: It should be fixed now, at least in my tests. It was actually two separate bugs. One was the crash and other was overlap functionality acting strange. Unfortunately there’s a ton of work between the 2.80 and 2.79 versions of the addon, so the process of this bug fix is beta-2 for 2.80, then 2.80 v2, then I can look into converting all the work done in 2.80 to 2.79.

(ambi) #301

Shotpacker 2.0 beta2 is up (shotpacker_2.0-beta2-b2.80.zip)

Basically a lot of bugfixing. All features should be fully functional and the addon in working state. If you have any issues, please let me know.

(zloy.tux) #302

Great update!
but … I downloaded from gumroad last update and there is no window UV squares (
what am I doing wrong?