Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
bb0e3a4e
Commit
bb0e3a4e
authored
12 years ago
by
Michael Williamson
Browse files
Options
Downloads
Patches
Plain Diff
bump maps now default to float
parent
1f7b14b9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
texture_paint_layer_manager.py
+8
-6
8 additions, 6 deletions
texture_paint_layer_manager.py
with
8 additions
and
6 deletions
texture_paint_layer_manager.py
+
8
−
6
View file @
bb0e3a4e
...
@@ -349,14 +349,14 @@ def main(context,tn):
...
@@ -349,14 +349,14 @@ def main(context,tn):
for
f
in
me
.
polygons
:
for
f
in
me
.
polygons
:
if
f
.
material_index
==
m_id
:
if
f
.
material_index
==
m_id
:
uvtex
[
f
.
index
].
image
=
img
uvtex
[
f
.
index
].
image
=
img
print
(
'
if
'
)
else
:
else
:
for
f
in
me
.
polygons
:
for
f
in
me
.
polygons
:
if
f
.
material_index
==
m_id
:
if
f
.
material_index
==
m_id
:
uvtex
[
f
.
index
].
image
=
None
uvtex
[
f
.
index
].
image
=
None
print
(
'
else
'
)
me
.
update
()
me
.
update
()
...
@@ -384,7 +384,7 @@ class set_active_paint_layer(bpy.types.Operator):
...
@@ -384,7 +384,7 @@ class set_active_paint_layer(bpy.types.Operator):
def
add_image_kludge
(
iname
=
'
grey
'
,
iwidth
=
256
,
iheight
=
256
,
def
add_image_kludge
(
iname
=
'
grey
'
,
iwidth
=
256
,
iheight
=
256
,
icolor
=
(
0.5
,
0.5
,
0.5
,
1.0
)):
icolor
=
(
0.5
,
0.5
,
0.5
,
1.0
)
,
nfloat
=
False
):
#evil kludge to get index of new image created using bpy.ops
#evil kludge to get index of new image created using bpy.ops
#store current images
#store current images
tl
=
[]
tl
=
[]
...
@@ -395,7 +395,7 @@ def add_image_kludge(iname = 'grey', iwidth = 256, iheight = 256,
...
@@ -395,7 +395,7 @@ def add_image_kludge(iname = 'grey', iwidth = 256, iheight = 256,
#create a new image
#create a new image
bpy
.
ops
.
image
.
new
(
name
=
iname
,
width
=
iwidth
,
height
=
iheight
,
bpy
.
ops
.
image
.
new
(
name
=
iname
,
width
=
iwidth
,
height
=
iheight
,
color
=
icolor
)
color
=
icolor
,
float
=
nfloat
)
#find its creation index
#find its creation index
it
=
0
it
=
0
...
@@ -411,10 +411,12 @@ def add_paint(context, size =2048, typ = 'NORMAL'):
...
@@ -411,10 +411,12 @@ def add_paint(context, size =2048, typ = 'NORMAL'):
ob
=
bpy
.
context
.
object
ob
=
bpy
.
context
.
object
mat
=
ob
.
active_material
mat
=
ob
.
active_material
ts
=
mat
.
texture_slots
.
add
()
ts
=
mat
.
texture_slots
.
add
()
ifloat
=
False
if
typ
==
'
NORMAL
'
:
if
typ
==
'
NORMAL
'
:
color
=
(
0.5
,
0.5
,
0.5
,
1.0
)
color
=
(
0.5
,
0.5
,
0.5
,
1.0
)
iname
=
'
Bump
'
iname
=
'
Bump
'
ifloat
=
True
elif
typ
==
'
COLOR
'
:
elif
typ
==
'
COLOR
'
:
iname
=
'
Color
'
iname
=
'
Color
'
color
=
(
1.0
,
1.0
,
1.0
,
0.0
)
color
=
(
1.0
,
1.0
,
1.0
,
0.0
)
...
@@ -435,7 +437,7 @@ def add_paint(context, size =2048, typ = 'NORMAL'):
...
@@ -435,7 +437,7 @@ def add_paint(context, size =2048, typ = 'NORMAL'):
tex
=
bpy
.
data
.
textures
.
new
(
name
=
iname
,
type
=
'
IMAGE
'
)
tex
=
bpy
.
data
.
textures
.
new
(
name
=
iname
,
type
=
'
IMAGE
'
)
ts
.
texture
=
tex
ts
.
texture
=
tex
img
=
add_image_kludge
(
iname
=
typ
,
img
=
add_image_kludge
(
iname
=
typ
,
iwidth
=
size
,
iheight
=
size
,
icolor
=
color
)
iwidth
=
size
,
iheight
=
size
,
icolor
=
color
,
nfloat
=
ifloat
)
tex
.
image
=
img
tex
.
image
=
img
if
typ
==
'
COLOR
'
:
if
typ
==
'
COLOR
'
:
...
@@ -446,7 +448,7 @@ def add_paint(context, size =2048, typ = 'NORMAL'):
...
@@ -446,7 +448,7 @@ def add_paint(context, size =2048, typ = 'NORMAL'):
ts
.
use_map_normal
=
True
ts
.
use_map_normal
=
True
ts
.
use_map_color_diffuse
=
False
ts
.
use_map_color_diffuse
=
False
ts
.
normal_factor
=
-
1
ts
.
normal_factor
=
-
1
ts
.
bump_method
=
'
BUMP_
ORIGINAL
'
ts
.
bump_method
=
'
BUMP_
MEDIUM_QUALITY
'
ts
.
bump_objectspace
=
'
BUMP_OBJECTSPACE
'
ts
.
bump_objectspace
=
'
BUMP_OBJECTSPACE
'
elif
typ
==
'
SPECULAR
'
:
elif
typ
==
'
SPECULAR
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment