Giter VIP home page Giter VIP logo

dreamuv's Introduction

DreamUV

About

DreamUV is a collection of tools that allow you to manipulate UVs in the 3D viewport. This toolset is designed to be used with reusable textures like tiling textures, trimsheets and texture atlases. Its intent is to allow you to texture your geometry without having to exit the 3D view, saving you time and improving flexibility.

screenshot

Installation

  • download as a zip and in user Preferences/Add-ons, use "Install from File..."
  • DreamUV should now be visible in the add-ons tab, in the UV category.
  • once activated, you can find DreamUV in the toolbar in Edit mode.

Using DreamUV

After installing, you can find the DreamUV toolset in the toolbar of the 3D viewport window. It'll appear when in edit mode.

screenshot

Viewport UV Tools

The Viewport UV Tools are a collection of tool to directly manipulate UV maps in the 3D Viewport. These tools are particularly useful when working with tiling or trim based materials.

The Move, Scale and Rotate tools allow you to transform your uvs in realtime just like you would be transforming a mesh. Some keyboard and mouse combos can be used while the tool is used. They have been set up to work similarly to the default Blender transform tools:

  • X: constrain translate/scale to x-axis
  • Y: constrain translate/scale to y-axis
  • MIDDLE MOUSE: hold and drag along the x or y axis to constrain the tool to that axis. Release to lock the constraint.
  • SHIFT: precision mode
  • CTRL: stepped mode
  • CTRL+SHIFT: stepped mode with smaller intervals

The Move, Scale and Rotate tools also have buttons to transform your UV by discrete steps, which can be set using the snap sizes.

The extend Tool will unwrap selected faces and attach them to the active face.

The Stitch Tool will stitch the uvs of two selected faces on their shared edge

The Cycle Tool will rotate the selected face's uvs by 90 degrees and keep it confined within its boundaries.

The Mirror Tools will mirror selected uvs while also keeping the uvs confined within its boundaries.

The Move to UV Edge will move the entire uv to the 0-1 uv boundary. This is useful to align a face to a texture's edge.

Unwrapping Tools:

Square Fit Unwrap will try to unwrap your selection fitted to a square. It's useful to unwrap patches, and is particularly useful when unwrapping pipes.

Blender Unwrap is the standard blender unwrap tool.

(more unwrapping tools are planned, like planar and box mapping options. Watch this space!)

UV Transfer Tool:

The UV Transfer Tool allows you to essentially copy paste a uv to a different spot. The top row are coordinates that represent a uv clipboard. You can type them in manually or use the grab from selection to save a UV boundary. The transfer to selection button will map the saved uv to your selection.

Hotspotting:

Hotspotting is a technique to quickly assign uv's to UV islands by referencing a predefined uv atlas. The DreamUV hotspot tool will attempt its best to find an appropriate sized rectangle on the atlas and fit it to the mesh geometry.

For the hotspotting tool to work correctly, an atlas needs to be created. This is simply a mesh consisting of a variety of different sized rectangles. For example: screenshot This is just one example layout, any layout should work.

Keep in mind to scale the atlas geometry to a similar scale you want to uv's to be applied to your final mesh. Also make sure that the atlas object scale is set to 1 to make sure the sizes are transferred correctly.

To hotspot a mesh, simply select the faces you want to hotspot and click the hotspot button. Clicking multiple times will make the tool cycle through different variations and uv placement. The mesh will be split into multiple uv islands that are hotspotted individually, using hard edges and seams. Its highly recommended to place extra seams manually to guide the tool and try to divide up your geometry into rectangular patches. screenshot

If you have any feedback you can just message me via twitter: @leukbaars

dreamuv's People

Contributors

chemikhazi avatar draise14 avatar enoravfx avatar leukbaars avatar machin3io avatar terzalo avatar thatasherguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dreamuv's Issues

feature request - texel density

When using the "blender unwrap mode" the object face should have a uniform texel density (pixel/world meter) in width & height, however it is currently not possible to get it, set it (which would be very useful to quickly apply the same density between multiple surfaces), or to rotate UVs while preserving X/Y density, on non-square textures.

I realize rotation might be an absolute pain, but having it, even just for 90ยฐ increments would be immensely useful already.

Error while trying to unwrap to Hotspot

Python: Traceback (most recent call last):
File "C:\Users\username\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\DreamUV-master\DUV_HotSpot.py", line 500, in execute
main(context)
File "C:\Users\username\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\DreamUV-master\DUV_HotSpot.py", line 75, in main
bpy.ops.object.shade_smooth_by_angle(angle=0.523599)
File "D:\PROGRAMS\BLENDER\4.0\scripts\modules\bpy\ops.py", line 109, in call
ret = _op_call(self.idname_py(), kw)
AttributeError: Calling operator "bpy.ops.object.shade_smooth_by_angle" error, could not be found

Python error in 3.0.0

https://user-images.githubusercontent.com/20190653/125646285-313bb39c-3016-4b3a-9adf-5fc84bb4318a.mp4
Removing the 2 last arguments works as a fix, but still thought I would report it :)

Move:

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\blender-3.0.0-alpha+master.49a363f0e0d8-windows.amd64-release\3.0\scripts\addons\DreamUV-master\DUV_UVTranslate.py", line 219, in modal
    bmesh.update_edit_mesh(self.mesh, False, False)
TypeError: update_edit_mesh() takes at most 1 positional argument (3 given)

location: <unknown location>:-1

Scale:

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\blender-3.0.0-alpha+master.49a363f0e0d8-windows.amd64-release\3.0\scripts\addons\DreamUV-master\DUV_UVScale.py", line 193, in modal
    bmesh.update_edit_mesh(self.mesh, False, False)
TypeError: update_edit_mesh() takes at most 1 positional argument (3 given)

location: <unknown location>:-1

Rotate:

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\blender-3.0.0-alpha+master.49a363f0e0d8-windows.amd64-release\3.0\scripts\addons\DreamUV-master\DUV_UVRotate.py", line 128, in modal
    bmesh.update_edit_mesh(self.mesh, False, False)
TypeError: update_edit_mesh() takes at most 1 positional argument (3 given)

location: <unknown location>:-1

Mirror:

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\blender-3.0.0-alpha+master.49a363f0e0d8-windows.amd64-release\3.0\scripts\addons\DreamUV-master\DUV_UVMirror.py", line 61, in execute
    bmesh.update_edit_mesh(mesh, False, False)
TypeError: update_edit_mesh() takes at most 1 positional argument (3 given)

location: <unknown location>:-1

image

Hotspot Tool Results are Rotated by 180 degrees from Center

Hey there !
Thanks for this absolutely amazing Addon !
Especially the Hot Spot Tool is pure magic :)
But sometimes the results are rotated by 180 from the center.
I used your example atlas.
Do you have any idea how i can prevent that from happening ?
Thanks

Multi selection of faces interpreted as individual islands in not flat surfaces

Hello there and first of all, thank you for this amazing tool.
I am running into some issue that makes in a cylindrical shape faces, to get interpreted as individual UV Islands. In cubes and flat surfaces works fine, but is it there any threshold that's is causing this? I remember testing it a year ago in a previous version and was working fine,

Screenshot 2023-07-05 160854

Hotspot appears to Mirror UVs about 0,0 regardless of whether duv_usemirror* is checked

As title says, in 2.92 it appears that the resulting hotspot UVs are sometimes mirrored about 0,0 (same behavior as CTRL+M with pivot set to 2d cursor at 0,0).

This happens regardless of whether the flags are checked:
duv_useorientation
duv_usemirrorx
duv_usemirrory

or any other flag for that matter, including texture size.

Images:
image
image

Steps to recreate are uncertain, it seems to happen depending on how many objects are present in the scene, I can't quite pinpoint when it starts falling apart or why. As such sharing a stripped down version of the .blend file is not feasible.

IE. I have taken the exact problematic object and hotspotted it in an empty .blend file only to achieve the desired result...

Example .blend file available privately upon request.

dream uvs menu lacking options and both buttons throw errors

Blender versions 3.2.1

image

if I press either Move or the ^ arrow buttons this error is thrown:

Python: Traceback (most recent call last):
  File "C:\Users\Carl\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\DreamUV-master\__init__.py", line 102, in draw
    op.direction="up"
AttributeError: 'VIEW3D_OT_dreamuv_uvtranslatestep' object has no attribute 'direction'

Version 3.6 / 4.0

Is there any work in progress to update DreamUV to version 3.6 or 4.0?

[Blender 2.93] DreamUV not working in 2.93

DreamUV is not working in 2.93.

I am assuming this is to this to the updates to the API in 2.93 and is related to Python being upgraded in Blender 2.93 tp version 3.9.1?

Panel crash on entirely blank scene

When the scene is entirely blank, without any object at all the View3D panel crashes.

An idea for a fix:

class DREAMUV_PT_uv(bpy.types.Panel):
    ...
    @classmethod
    def poll(cls, context):
        return len(context.scene.objects) > 0

Consider atlas face normals when HotSpotting

An idea I have is to prepare an atlas that has segments for walls, floors and ceilings. By making the atlas in the form of a cube I could tell DreamUV what face normals each part of my atlas should use.
This way DreamUV could for example properly map a bunch of corridors and rooms, identyfying walls, floors and ceilings.

Performance Increase for Meshes with many seams?

Hi,

Any chance for an increase in performance for Dream Uvs when used on a mesh with a lot of seams? Most times it would take not less than 6 hours for it to calculate. Most times I have to break the mesh into multiple parts for it to work faster.

Would appreciate any improvement in the time it takes to hotspot meshes with a lot of seams.

Also UV sync selection affects UVs when hotspotting.

Also thanks for making this addon available for others to use.

{Feature} Make Hotspot Objects a property of the Material

I think it would be cool if the hotspot object was directly tied to the material some how. This way we wouldn't need to constantly pick the object all the time.

Maybe in such a way that such a material was portable between .blend projects? ie appending the data would bring the hotspot object along for the ride.

Crash: Clicking Hotspot when selected faces surround ngon

DreamUV_crash

Selecting faces as seen in the image above and then clicking Hotspot will crash Blender.

I have noticed that deselecting the triangle that makes part of the inner square and clicking Hotspot will not crash Blender.

This is 100% reproduction for me.

Strange/flipped faces/normals

Hello, this tool is amazing, so I just started to test it out and I don't know how to fix the first issue already:

image

As soon I press HotSpot, the faces are flipped?

My first idea was to simply flip normals, but it doesn't help:

image

Anyone knows whats going on and how to fix this?

[Feature Request] Pseudo-Material Hotspotting

Something that I keep coming back to in my mind is some sort of way to represent multiple materials on a single atlas, or as part of a trim sheet workflow. One way to do that would be to have the faces of your atlas object assigned different materials (custom face data would be ideal, but I don't know if Blender's API allows for that. Then you can add an option to the Hotspot operator to pick a material index which will limit the faces to those with the correct material. That way you can have a more complex material in a single atlas, ie. sheet metal with or without bolts, seams, emossing, etc. that only uses a single in-game material on your final atlas.

Update for Blender 3.0?

@leukbaars Hi, hope you are doing well.
Any chance we could pls pls get an update for Blender 3.0? This addon is so useful.

Thanks so much for this addon

Cheers,

randomly distributing planks

hey love the tool, use it all the time! ๐Ÿ’ฏ โค๏ธ

i'm hoping we can add a feature to randomize the distribution of uv's onto atlas parts of similar size

i think these screenshots will help illustrate the request

  1. here is my atlas object
    image
  2. here is the atlas in wireframe, see how I have 5 planks of roughly the same size?
    image
  3. these are the planks I want to hotspot
    image
  4. โš ๏ธ the issue is that all of the planks are allocated to the same part of the atlas
    image
  5. ๐Ÿ’ก i'm hoping we can add some way to incorporate randomness to these uv allocations during hotspotting

this would really speed up my workflow and I think people would appreciate it ๐Ÿ‘

i have some coders on my team, and maybe i could persuade them to contribute, if you could offer some pointers on how we could make a good pull request for this ๐Ÿค

thanks! ๐Ÿ‘‹

2.8 compatibility?

Hey Bram,

Any chance you're still using this, and you'd share your updated code?
There's an alternative in Magic UV but I prefer the way this one functions!

[Feature Request] "Alpha Edges" a secondary UV mapping for Edges

Having an interesting food for thought: What if DreamUV utilized a separate texture that uses an alpha so then it can be mapped on a separate material and UV to wrap details such as edge wear, etc on the edges?

I'm sure you're aware of this but figure it may be something to point out, mostly cause of round edges:
image

The Circle UV island fits perfectly but leaves part of the UV Edge Wear out. So when I meant a separate texture with alpha for edges, I was thinking of this:

(Original):
image

(Alpha Texture for Edges):
image
Not the best texture example, but nonetheless...

So then using the alpha texture, DreamUV could calculate the edges where to bake the edges on an another material alongside the original atlas texture material. While also utilizing a secondary UV map:

image
image

I do imagine that the theoretical idea sounds difficult to implement but figure I mention this idea, just for curiousity. ๐Ÿ˜„

Trim Tool

I see by the commit history, it looks like a brand new tool/feature, but do you have any documentation on how it works? Can I use the same geometry as the Atlas Object? How do I define the trim index and cap index? Thank you, it's a great tool!

Version 0.9.1 / Blender 3.0 - Error when unwrapping mesh with triangles in

Hello! I've been using this plugin for a while and I really love it.

Recently, I've noticed an issue where I get an error if I try to unwrap meshes that have triangles in them instead of quads. For instance if I take a cube and bevel its edges, there will be triangles at each corner, and if I try to unwrap it with DreamUV, I get an error. If I select each face except for the triangles, it unwraps without issue. I think this may be a Blender 3.0 related issue because in earlier versions I seem to recall DreamUV would try to fit the triangles into the hotspot map anyways, and wouldn't give errors. Here is the error it gives me:

DUV_HotSpot.py, line 184, in execute is_rect = DUV_utils.square_fit(context)

DUV_Utils.py, line 617, in square_fit bmesh.updated_edit_mesh(me, True)

TypeError: update_edit_mesh() takes at most 1 positional argument (2 given)

I tried this also with ngons, and got the same error. It seems to give this error when there are any faces that are not quads, which seems new to this version of the plugin (at least as far as I can recall).

All in all it's a fairly minor problem as it is easy enough to only select the quads for unwrapping in most cases, but I thought you should be aware of it.

[Feature Request] UV Sculpting

Not sure how feasible this is, but I'm trying to see if there might be a way to do uv sculpting (Grab, Relax, Pinch) in 3D view. I'm currently using Blender for adjusting uv flows to create a faux flow map.

It'll allow some of this functionality w/o needing to create an actual map. Right now I do the same thing, but in uv view, so there is some guessing involved. More importantly, it'll eventually cause some tears in the uv border.

feature request - support multi-object editing

This might be too niche of an approach, but I use geometry nodes and collection Boolean to mimic CSG brush modeling in blender, and as a result, I tend to have structures built with a lot of loose cubes that are fused into a single mesh later.

Currently, DreamUV doesn't appear to allow editing multiple objects at the same time and to extend UVs between those objects.

Would it be possible to have the relevant tools support selecting faces from multiple objects?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.