Skip to content

Commit

Permalink
Release v0.0.9 (#418)
Browse files Browse the repository at this point in the history
* Update workflow

* Fix README link

* Handle None location_3d_to_region_2d
  • Loading branch information
carson-katri authored Dec 15, 2022
1 parent 395141a commit 8700071
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- name: Install dependencies into target
shell: bash
run: 'python -m pip install -r requirements/win-linux-cuda.txt --no-cache-dir --target .python_dependencies'
working-directory: dream_textures
- name: Archive Release
uses: thedoctor0/zip-release@main
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Create textures, concept art, and more with text prompts. Learn how to use the v

![A graphic showing each step of the image generation process](docs/assets/image_generation.png)

## [Texture Projection](docs/TEXTURE_PROJECT.md)
## [Texture Projection](docs/TEXTURE_PROJECTION.md)
Texture entire models and scenes with depth to image.

![A graphic showing each step of the texture projection process](docs/assets/texture_projection.png)
Expand Down
7 changes: 6 additions & 1 deletion operators/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,18 @@ def step_progress_update(self, context):
mesh.verts.index_update()
def vert_to_uv(v):
screen_space = view3d_utils.location_3d_to_region_2d(context.region, context.space_data.region_3d, obj.matrix_world @ v.co)
if screen_space is None:
return None
return (screen_space[0] / context.region.width, screen_space[1] / context.region.height)
uv_layer = mesh.loops.layers.uv[0] if len(mesh.loops.layers.uv) > 0 else mesh.loops.layers.uv.new("Projected UVs")
mesh.faces.ensure_lookup_table()
for face in mesh.faces:
if face.select:
for loop in face.loops:
loop[uv_layer].uv = vert_to_uv(mesh.verts[loop.vert.index])
uv = vert_to_uv(mesh.verts[loop.vert.index])
if uv is None:
continue
loop[uv_layer].uv = uv
face.material_index = material_index
bmesh.update_edit_mesh(obj.data)

Expand Down

0 comments on commit 8700071

Please sign in to comment.