Skip to content

Commit

Permalink
Fix problem with rename textools folder addon.
Browse files Browse the repository at this point in the history
  • Loading branch information
SavMartin authored Dec 12, 2020
1 parent bd48149 commit b2f9f6b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
6 changes: 5 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@
# UVSquares:
# <Uv Squares, Blender addon for reshaping UV vertices to grid.>
# Copyright (C) <2014> <Reslav Hollos>
# https://github.com/JoseConseco/UvSquares/blob/master/uv_squares.py
# https://github.com/JoseConseco/UvSquares/blob/master/uv_squares.py
#
# Current maintainers Sav Martin, FranMarz.
#
# Icons art. DavidRivera (activemotionpictures)
6 changes: 3 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
bl_info = {
"name": "TexTools",
"description": "Professional UV and Texture tools for Blender.",
"author": "renderhjs, (Port to 2.80 by Sav Martin)",
"version": (1, 3, 00),
"author": "renderhjs, (Port to 2.80 by Sav Martin), FranMarz",
"version": (1, 4, 00),
"blender": (2, 80, 0),
"category": "UV",
"location": "UV Image Editor > Tools > 'TexTools' panel",
Expand Down Expand Up @@ -157,7 +157,7 @@


class Panel_Preferences(bpy.types.AddonPreferences):
bl_idname = __name__
bl_idname = __package__

# Addon Preferences https://docs.blender.org/api/blender_python_api_2_67_release/bpy.types.AddonPreferences.html
swizzle_y_coordinate : bpy.props.EnumProperty(items=
Expand Down
25 changes: 10 additions & 15 deletions op_bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ def bake(self, mode, size, bake_single, sampling_scale, samples, ray_distance):
sampling_scale,
samples,
ray_distance,
len(set.objects_high) > 0,
obj_cage
len(set.objects_high) > 0,
obj_cage
)

# Bake Floaters seperate bake
# Bake Floaters separate bake
if len(set.objects_float) > 0:
bpy.ops.object.select_all(action='DESELECT')
for obj_high in (set.objects_float):
Expand Down Expand Up @@ -344,7 +344,7 @@ def setup_image(mode, name, width, height, path, is_clear):

if name not in bpy.data.images:
# Create new image with 32 bit float
is_float_32 = bpy.context.preferences.addons["textools"].preferences.bake_32bit_float == '32'
is_float_32 = bpy.context.preferences.addons[__package__].preferences.bake_32bit_float == '32'
image = bpy.data.images.new(name, width=width, height=height, float_buffer=is_float_32)
if "_normal_" in image.name:
image.colorspace_settings.name = 'Non-Color'
Expand Down Expand Up @@ -533,7 +533,7 @@ def cycles_bake(mode, padding, sampling_scale, samples, ray_distance, is_multi,
bpy.context.scene.render.bake.normal_r = 'POS_X'
bpy.context.scene.render.bake.normal_b = 'POS_Z'
# Adjust Y swizzle from Addon preferences
swizzle_y = bpy.context.preferences.addons["textools"].preferences.swizzle_y_coordinate
swizzle_y = bpy.context.preferences.addons[__package__].preferences.swizzle_y_coordinate
if swizzle_y == 'Y-':
bpy.context.scene.render.bake.normal_g = 'NEG_Y'
elif swizzle_y == 'Y+':
Expand All @@ -556,29 +556,24 @@ def cycles_bake(mode, padding, sampling_scale, samples, ray_distance, is_multi,
bpy.context.scene.render.bake.use_pass_color = True

if obj_cage is None:
# Bake with Cage
bpy.ops.object.bake(
type=modes[mode].type,
use_clear=False,
cage_extrusion=ray_distance,

use_selected_to_active=is_multi,
cage_extrusion=ray_distance,
normal_space=modes[mode].normal_space
)
else:
# Bake without Cage
bpy.ops.object.bake(
type=modes[mode].type,
use_clear=False,
cage_extrusion=ray_distance,

use_selected_to_active=is_multi,
normal_space=modes[mode].normal_space,

#Use Cage and assign object
use_cage=True,
cage_extrusion=ray_distance,
normal_space=modes[mode].normal_space,
use_cage=True,
cage_object=obj_cage.name
)

if modes[mode].invert:
bpy.ops.image.invert(invert_r=True, invert_g=True, invert_b=True)

Expand Down

0 comments on commit b2f9f6b

Please sign in to comment.