Skip to content

Commit a6fcf5b

Browse files
committed
Revert "Removed material.skinning references. See #10754."
This reverts commit 0b3497f.
1 parent 5617c05 commit a6fcf5b

10 files changed

+24
-1
lines changed

src/loaders/MaterialLoader.js

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Object.assign( MaterialLoader.prototype, {
8181
if ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth;
8282
if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap;
8383
if ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin;
84+
if ( json.skinning !== undefined ) material.skinning = json.skinning;
8485
if ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets;
8586

8687
// for PointsMaterial

src/materials/Material.js

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ Object.assign( Material.prototype, EventDispatcher.prototype, {
232232
if ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap;
233233
if ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin;
234234

235+
data.skinning = this.skinning;
235236
data.morphTargets = this.morphTargets;
236237

237238
// TODO: Copied from Object3D.toJSON

src/materials/MeshBasicMaterial.js

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { Color } from '../math/Color';
3333
* wireframe: <boolean>,
3434
* wireframeLinewidth: <float>,
3535
*
36+
* skinning: <bool>,
3637
* morphTargets: <bool>
3738
* }
3839
*/
@@ -67,6 +68,7 @@ function MeshBasicMaterial( parameters ) {
6768
this.wireframeLinecap = 'round';
6869
this.wireframeLinejoin = 'round';
6970

71+
this.skinning = false;
7072
this.morphTargets = false;
7173

7274
this.lights = false;
@@ -108,6 +110,7 @@ MeshBasicMaterial.prototype.copy = function ( source ) {
108110
this.wireframeLinecap = source.wireframeLinecap;
109111
this.wireframeLinejoin = source.wireframeLinejoin;
110112

113+
this.skinning = source.skinning;
111114
this.morphTargets = source.morphTargets;
112115

113116
return this;

src/materials/MeshDepthMaterial.js

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function MeshDepthMaterial( parameters ) {
3232

3333
this.depthPacking = BasicDepthPacking;
3434

35+
this.skinning = false;
3536
this.morphTargets = false;
3637

3738
this.map = null;
@@ -63,6 +64,7 @@ MeshDepthMaterial.prototype.copy = function ( source ) {
6364

6465
this.depthPacking = source.depthPacking;
6566

67+
this.skinning = source.skinning;
6668
this.morphTargets = source.morphTargets;
6769

6870
this.map = source.map;

src/materials/MeshLambertMaterial.js

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { Color } from '../math/Color';
3434
* wireframe: <boolean>,
3535
* wireframeLinewidth: <float>,
3636
*
37+
* skinning: <bool>,
3738
* morphTargets: <bool>,
3839
* morphNormals: <bool>
3940
* }
@@ -73,6 +74,7 @@ function MeshLambertMaterial( parameters ) {
7374
this.wireframeLinecap = 'round';
7475
this.wireframeLinejoin = 'round';
7576

77+
this.skinning = false;
7678
this.morphTargets = false;
7779
this.morphNormals = false;
7880

@@ -117,6 +119,7 @@ MeshLambertMaterial.prototype.copy = function ( source ) {
117119
this.wireframeLinecap = source.wireframeLinecap;
118120
this.wireframeLinejoin = source.wireframeLinejoin;
119121

122+
this.skinning = source.skinning;
120123
this.morphTargets = source.morphTargets;
121124
this.morphNormals = source.morphNormals;
122125

src/materials/MeshNormalMaterial.js

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { Vector2 } from '../math/Vector2';
2121
* wireframe: <boolean>,
2222
* wireframeLinewidth: <float>
2323
*
24+
* skinning: <bool>,
2425
* morphTargets: <bool>,
2526
* morphNormals: <bool>
2627
* }
@@ -48,6 +49,7 @@ function MeshNormalMaterial( parameters ) {
4849
this.fog = false;
4950
this.lights = false;
5051

52+
this.skinning = false;
5153
this.morphTargets = false;
5254
this.morphNormals = false;
5355

@@ -77,6 +79,7 @@ MeshNormalMaterial.prototype.copy = function ( source ) {
7779
this.wireframe = source.wireframe;
7880
this.wireframeLinewidth = source.wireframeLinewidth;
7981

82+
this.skinning = source.skinning;
8083
this.morphTargets = source.morphTargets;
8184
this.morphNormals = source.morphNormals;
8285

src/materials/MeshPhongMaterial.js

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import { Color } from '../math/Color';
4747
* wireframe: <boolean>,
4848
* wireframeLinewidth: <float>,
4949
*
50+
* skinning: <bool>,
5051
* morphTargets: <bool>,
5152
* morphNormals: <bool>
5253
* }
@@ -98,6 +99,7 @@ function MeshPhongMaterial( parameters ) {
9899
this.wireframeLinecap = 'round';
99100
this.wireframeLinejoin = 'round';
100101

102+
this.skinning = false;
101103
this.morphTargets = false;
102104
this.morphNormals = false;
103105

@@ -154,6 +156,7 @@ MeshPhongMaterial.prototype.copy = function ( source ) {
154156
this.wireframeLinecap = source.wireframeLinecap;
155157
this.wireframeLinejoin = source.wireframeLinejoin;
156158

159+
this.skinning = source.skinning;
157160
this.morphTargets = source.morphTargets;
158161
this.morphNormals = source.morphNormals;
159162

src/materials/MeshStandardMaterial.js

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import { Color } from '../math/Color';
4747
* wireframe: <boolean>,
4848
* wireframeLinewidth: <float>,
4949
*
50+
* skinning: <bool>,
5051
* morphTargets: <bool>,
5152
* morphNormals: <bool>
5253
* }
@@ -102,6 +103,7 @@ function MeshStandardMaterial( parameters ) {
102103
this.wireframeLinecap = 'round';
103104
this.wireframeLinejoin = 'round';
104105

106+
this.skinning = false;
105107
this.morphTargets = false;
106108
this.morphNormals = false;
107109

@@ -162,6 +164,7 @@ MeshStandardMaterial.prototype.copy = function ( source ) {
162164
this.wireframeLinecap = source.wireframeLinecap;
163165
this.wireframeLinejoin = source.wireframeLinejoin;
164166

167+
this.skinning = source.skinning;
165168
this.morphTargets = source.morphTargets;
166169
this.morphNormals = source.morphNormals;
167170

src/materials/ShaderMaterial.js

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { UniformsUtils } from '../renderers/shaders/UniformsUtils';
1616
*
1717
* lights: <bool>,
1818
*
19+
* skinning: <bool>,
1920
* morphTargets: <bool>,
2021
* morphNormals: <bool>
2122
* }
@@ -42,6 +43,7 @@ function ShaderMaterial( parameters ) {
4243
this.lights = false; // set to use scene lights
4344
this.clipping = false; // set to use user-defined clipping planes
4445

46+
this.skinning = false; // set to use skinning attribute streams
4547
this.morphTargets = false; // set to use morph targets
4648
this.morphNormals = false; // set to use morph normals
4749

@@ -98,6 +100,8 @@ ShaderMaterial.prototype.copy = function ( source ) {
98100
this.lights = source.lights;
99101
this.clipping = source.clipping;
100102

103+
this.skinning = source.skinning;
104+
101105
this.morphTargets = source.morphTargets;
102106
this.morphNormals = source.morphNormals;
103107

src/renderers/webgl/WebGLShadowMap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
307307

308308
}
309309

310-
var useSkinning = object.isSkinnedMesh;
310+
var useSkinning = object.isSkinnedMesh && material.skinning;
311311

312312
var variantIndex = 0;
313313

0 commit comments

Comments
 (0)