Mirror Modifier: UV-mirror offset option
Closed, ResolvedPublic

Description

Benefits: Artists can use the mirror modifiers mirror UV's option while sharing UV textures between models.

Description: The current mirror modifier would have a float option added, which defaults to zero (image center). which can be moved where -1.0 is the left side of the image and 1.0 is the right hand side.

Details

Type
Bug
Campbell Barton (campbellbarton) updated the task description. (Show Details)
Campbell Barton (campbellbarton) raised the priority of this task from to Normal.
Campbell Barton (campbellbarton) renamed this task from Mirror Modifier: UV offset option to Mirror Modifier: UV-mirror offset option.

Thanks for adding this, Campbell!

I'm the one who requested this, so I'll provide another usecase for it:

Some game engines and texture-baking software need overlapping uv-islands (as are often used in game art) to be offset by the width (or height) of the texture. This is what that'd look like: http://wiki.polycount.com/wiki/File:Normalmap_uvcoord_offset.jpg
The process is described in more detail here: http://wiki.polycount.com/wiki/Texture_Baking#UV_Coordinates

Would this offset be only for the U axis, or would there also be a corresponding offset for the V axis?

I think both would be best, and if possible: a toggle for Normalised coordinates (from the tooltip: 'Display UV Coordinates from 0.0 to 0.1 rather than in pixels) as in the UV editor would be great.

This way you could just enter 1 for the use I mention in my previous post, but you'd have an option to finetune it for things like other uses like unique texturing for each side of the mirror.

edit: Actually, moving it in pixels brings up what I think is an issue: where do we get the texture-size from? In the UV editor this is related to the texture that's mapped to the currently active component I believe, but given that the Uv editor might not be open, this could be confusing.

I've added fields for U and V offsets, which both work within normalized coordinates (as that is what the modifier sees), I think that pixel offsets for mirrored UVs should be their own issue.

Hey,

I submitted a patch for this a few days ago, mind having a look?

It's my understanding that I'd need to build Blender for this, right?
If so, I've never done that, and I'm not set up to do so. Any chance of a (Windows) Build to test?
If not, I'd gladly just screenshare or something if it's feedback on the implementation you're after moreso than testing stability.

Robert Fornof (amdbcg) claimed this task.EditedMar 5 2017, 5:18 AM
  1. I'll work on this for as long as I can, and try to hand it back if I can't complete the work.
  2. I'm a total noob at this, I'll just assume I ask questions on the dev mailing list , ask in #blendercoders , or bug someone via maniphest.
  3. I may comment extensively here.
  4. I may bug someone about getting stuck , and it may happen soon with something really simple...

I've checked the patch, https://developer.blender.org/D1844 and it looks like it mostly works.

@michael knubben (michaelknubben): Do you still need a windows build to test on/make sure its working?

1.5 minute walkthrough of this patch : https://www.youtube.com/watch?v=3_xoPrjWKAE&feature=youtu.be
Is there anything that needs modification?

This looks great!
This may be outside of the scope of this project, but would a vertex group/material mask be feasable?
The intended effect would be for only the masked area to be mirrored (with a possible invert function, as a few other modifiers have)