Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-embree3
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-embree3
Commits
3c3c2cd5
Commit
3c3c2cd5
authored
11 years ago
by
Antony Riakiotakis
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue with texture painting: Tex slot scale was being applied twice.
parent
a89ef761
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/blender/blenkernel/intern/brush.c
+10
-21
10 additions, 21 deletions
source/blender/blenkernel/intern/brush.c
source/blender/editors/sculpt_paint/paint_cursor.c
+0
-6
0 additions, 6 deletions
source/blender/editors/sculpt_paint/paint_cursor.c
with
10 additions
and
27 deletions
source/blender/blenkernel/intern/brush.c
+
10
−
21
View file @
3c3c2cd5
...
@@ -561,11 +561,8 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
...
@@ -561,11 +561,8 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
x
/=
(
br
->
stencil_dimension
[
0
]);
x
/=
(
br
->
stencil_dimension
[
0
]);
y
/=
(
br
->
stencil_dimension
[
1
]);
y
/=
(
br
->
stencil_dimension
[
1
]);
x
*=
mtex
->
size
[
0
];
co
[
0
]
=
x
;
y
*=
mtex
->
size
[
1
];
co
[
1
]
=
y
;
co
[
0
]
=
x
+
mtex
->
ofs
[
0
];
co
[
1
]
=
y
+
mtex
->
ofs
[
1
];
co
[
2
]
=
0
.
0
f
;
co
[
2
]
=
0
.
0
f
;
hasrgb
=
externtex
(
mtex
,
co
,
&
intensity
,
hasrgb
=
externtex
(
mtex
,
co
,
&
intensity
,
...
@@ -621,11 +618,8 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
...
@@ -621,11 +618,8 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
y
=
flen
*
sinf
(
angle
);
y
=
flen
*
sinf
(
angle
);
}
}
x
*=
mtex
->
size
[
0
];
co
[
0
]
=
x
;
y
*=
mtex
->
size
[
1
];
co
[
1
]
=
y
;
co
[
0
]
=
x
+
mtex
->
ofs
[
0
];
co
[
1
]
=
y
+
mtex
->
ofs
[
1
];
co
[
2
]
=
0
.
0
f
;
co
[
2
]
=
0
.
0
f
;
hasrgb
=
externtex
(
mtex
,
co
,
&
intensity
,
hasrgb
=
externtex
(
mtex
,
co
,
&
intensity
,
...
@@ -985,8 +979,9 @@ unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side, bool use_sec
...
@@ -985,8 +979,9 @@ unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side, bool use_sec
{
{
unsigned
int
*
texcache
=
NULL
;
unsigned
int
*
texcache
=
NULL
;
MTex
*
mtex
=
(
use_secondary
)
?
&
br
->
mask_mtex
:
&
br
->
mtex
;
MTex
*
mtex
=
(
use_secondary
)
?
&
br
->
mask_mtex
:
&
br
->
mtex
;
TexResult
texres
=
{
0
};
float
intensity
;
int
hasrgb
,
ix
,
iy
;
float
rgba
[
4
];
int
ix
,
iy
;
int
side
=
half_side
*
2
;
int
side
=
half_side
*
2
;
if
(
mtex
->
tex
)
{
if
(
mtex
->
tex
)
{
...
@@ -1003,19 +998,13 @@ unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side, bool use_sec
...
@@ -1003,19 +998,13 @@ unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side, bool use_sec
/* This is copied from displace modifier code */
/* This is copied from displace modifier code */
/* TODO(sergey): brush are always cacheing with CM enabled for now. */
/* TODO(sergey): brush are always cacheing with CM enabled for now. */
hasrgb
=
multitex_ext
(
mtex
->
tex
,
co
,
NULL
,
NULL
,
0
,
&
texres
,
NULL
,
true
);
externtex
(
mtex
,
co
,
&
intensity
,
rgba
,
rgba
+
1
,
rgba
+
2
,
rgba
+
3
,
0
,
NULL
);
/* if the texture gave an RGB value, we assume it didn't give a valid
* intensity, so calculate one (formula from do_material_tex).
* if the texture didn't give an RGB value, copy the intensity across
*/
if
(
hasrgb
&
TEX_RGB
)
texres
.
tin
=
rgb_to_grayscale
(
&
texres
.
tr
);
((
char
*
)
texcache
)[(
iy
*
side
+
ix
)
*
4
]
=
((
char
*
)
texcache
)[(
iy
*
side
+
ix
)
*
4
]
=
((
char
*
)
texcache
)[(
iy
*
side
+
ix
)
*
4
+
1
]
=
((
char
*
)
texcache
)[(
iy
*
side
+
ix
)
*
4
+
1
]
=
((
char
*
)
texcache
)[(
iy
*
side
+
ix
)
*
4
+
2
]
=
((
char
*
)
texcache
)[(
iy
*
side
+
ix
)
*
4
+
2
]
=
((
char
*
)
texcache
)[(
iy
*
side
+
ix
)
*
4
+
3
]
=
(
char
)(
texres
.
tin
*
255
.
0
f
);
((
char
*
)
texcache
)[(
iy
*
side
+
ix
)
*
4
+
3
]
=
(
char
)(
intensity
*
255
.
0
f
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
source/blender/editors/sculpt_paint/paint_cursor.c
+
0
−
6
View file @
3c3c2cd5
...
@@ -238,12 +238,6 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
...
@@ -238,12 +238,6 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
y
=
len
*
sinf
(
angle
);
y
=
len
*
sinf
(
angle
);
}
}
x
*=
mtex
->
size
[
0
];
y
*=
mtex
->
size
[
1
];
x
+=
mtex
->
ofs
[
0
];
y
+=
mtex
->
ofs
[
1
];
if
(
col
)
{
if
(
col
)
{
float
rgba
[
4
];
float
rgba
[
4
];
...
...
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