Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scene animations #3

Merged
merged 122 commits into from
Aug 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
94c4fbe
BokehShader2: Fixed glsl warnings.
mrdoob Aug 19, 2015
5a06da2
Added damping to OrbitControls
WestLangley Aug 19, 2015
1eebaf2
issue #6571
rfm1201 Aug 19, 2015
f56a873
Editor: Fixed collada.
mrdoob Aug 19, 2015
36fdac1
Updated builds.
mrdoob Aug 19, 2015
3ff2945
Editor: More useful BufferGeometry panel.
mrdoob Aug 19, 2015
5d2b443
WebGLObjects: Moved wireframe out of attributes.
mrdoob Aug 19, 2015
c2ca86c
Updated builds.
mrdoob Aug 19, 2015
22cb503
Merge pull request #7018 from rfm1201/dev_6571
mrdoob Aug 19, 2015
41b1555
WebGLObjects: Storing wireframe index in WebGLProperties instead (mul…
mrdoob Aug 19, 2015
44ce8c2
BufferGeometry: Removed unused function.
mrdoob Aug 19, 2015
d74af72
Added IndexBufferAttribute.
mrdoob Aug 19, 2015
c170af7
Added IndexBufferAttribute. Woops!
mrdoob Aug 19, 2015
a9f33e7
Updated builds.
mrdoob Aug 19, 2015
a4f75f3
WebGLGeometries: Delete wireframe indices.
mrdoob Aug 19, 2015
13fcba8
Updated builds.
mrdoob Aug 19, 2015
95ecaf2
Merge pull request #7016 from WestLangley/dev-orbit
WestLangley Aug 19, 2015
0555503
Removed unneeded WireframeGeometry from example.
mrdoob Aug 19, 2015
5458c75
remove GeometryLoader - it is broken and unused.
bhouston Aug 19, 2015
7c3e8c6
Merge pull request #7020 from bhouston/removeGeometryLoader
mrdoob Aug 19, 2015
c966c35
fix MorphBlendMesh start animation playing
dgolovin-dev Aug 20, 2015
c6d4f7a
Adding logic to assign material.program for MeshFaceMaterials
Aug 20, 2015
13d5cee
Add an else to make distinction between material and mesh face materi…
Aug 20, 2015
ff007f7
Merge pull request #7025 from box/meshfacematerial_program_fix
mrdoob Aug 20, 2015
e5420e6
WebGLRenderer: properties.get() always return an object, so we can as…
mrdoob Aug 20, 2015
3ed8a04
WebGLRenderer: Implemented MeshFaceMaterial/MultiMaterial.
mrdoob Aug 21, 2015
596dce9
Updated builds.
mrdoob Aug 21, 2015
8fb24b5
WebGLRenderer: Moved movelViewMatrix and normalMatrix to Object3D.
mrdoob Aug 21, 2015
9ab9f06
Updated builds.
mrdoob Aug 21, 2015
d383c8c
WebGLRenderer: Simplified WebGLObjects.
mrdoob Aug 21, 2015
fa8c551
SpritePlugin: Updated to modelMatrixView.
mrdoob Aug 21, 2015
db39a39
*NormalsHelper: Removed normalMatrix pollution (now collision).
mrdoob Aug 21, 2015
c626b32
WebGLObjects: Commented out timer.
mrdoob Aug 21, 2015
22f25c7
Updated builds.
mrdoob Aug 21, 2015
8d331de
Projector: drawcalls to groups (behaviour still broken though).
mrdoob Aug 21, 2015
045c3bd
Merge branch 'patch-1' of https://github.com/tormozok/three.js into dev
mrdoob Aug 21, 2015
f2491f3
Clean up.
mrdoob Aug 21, 2015
5c1f8ce
Updated builds.
mrdoob Aug 21, 2015
d306bec
WebGLRenderer: Clean up.
mrdoob Aug 21, 2015
5138b8a
Updated builds.
mrdoob Aug 21, 2015
95283e9
BufferGeometry/Loader: Renamed some drawcalls instances to groups.
mrdoob Aug 21, 2015
8594866
Editor: Fixed camera jump.
mrdoob Aug 21, 2015
20a81f1
Updated builds.
mrdoob Aug 21, 2015
72e3b59
Optimized Fresnel (see Epic talk at SIGGRAPH '13).
tschw Aug 21, 2015
0671faa
Let lighting info be fed in view space.
tschw Aug 21, 2015
b20e021
Merge pull request #7028 from tschw/PerPixelLighting
mrdoob Aug 22, 2015
45908e7
OrbitControls: renamed properties to avoid double-negatives
WestLangley Aug 24, 2015
ef67cef
Merge pull request #7039 from WestLangley/dev-orbit
mrdoob Aug 24, 2015
9f93c37
WebGLRenderer: Sort groups.
mrdoob Aug 24, 2015
9ad1129
WebGLRenderer: Minor tweaks.
mrdoob Aug 24, 2015
6907262
Single-scened logarithmicdepthbuffer example.
mrdoob Aug 24, 2015
0bca894
Updated builds.
mrdoob Aug 25, 2015
cade4c4
ShaderMaterial: Attributes no longer need to be defined here.
mrdoob Aug 25, 2015
34a2055
Fixed all custom attributes examples.
mrdoob Aug 25, 2015
09e32d6
Fixed shader warnings.
mrdoob Aug 25, 2015
5fa3f19
Removed unneeded addDrawCalls()s.
mrdoob Aug 25, 2015
fc2cb19
BufferGeometry: Fixed addAttribute backwards compatibility.
mrdoob Aug 25, 2015
1cb2882
Updated builds.
mrdoob Aug 25, 2015
272a858
Fixed materials wireframe example.
mrdoob Aug 25, 2015
846f953
DirectGeometry: Added computeGroups. Fixed webgl_objects_update example.
mrdoob Aug 25, 2015
c8c8edc
Updated builds.
mrdoob Aug 25, 2015
eb11883
Removed redundant example.
mrdoob Aug 25, 2015
495da76
Fixed webgl_shaders_vector example.
mrdoob Aug 25, 2015
16461a1
Fixed webgl_morphnormals first frame glitch.
mrdoob Aug 25, 2015
c82ff84
WebGLRenderer: Handle missing morphTargets/morphNormals a bit better.
mrdoob Aug 25, 2015
85c3921
WebGLDeferredRenderer fixes.
mrdoob Aug 26, 2015
5580d84
Updated builds.
mrdoob Aug 26, 2015
402f7b1
Fixed webgl_loader_md2_control shadow.
mrdoob Aug 26, 2015
d3a4e69
Using SphereBufferGeometry in some examples.
mrdoob Aug 26, 2015
a10e0ab
Editor: scaleLock enabled by default.
mrdoob Aug 26, 2015
f76bbe3
Editor: Produce MorphAnimMesh when loading md2.
mrdoob Aug 26, 2015
2123d28
Cleanup following OrbitControls property name changes
WestLangley Aug 26, 2015
38bc1ee
Mesh: Removed unused morphTargetForcedOrder.
mrdoob Aug 26, 2015
c397796
Editor: Support md2 animations.
mrdoob Aug 26, 2015
c01ebbf
Updated builds.
mrdoob Aug 26, 2015
503f2b0
InstancedBufferGroup: drawcalls to groups.
mrdoob Aug 26, 2015
efd8769
Whitespace clean up.
mrdoob Aug 26, 2015
8a28e77
Improved webgl_buffergeometry_instancing_billboards example.
mrdoob Aug 26, 2015
f970f6a
Updated builds.
mrdoob Aug 26, 2015
2a0c1bf
Removed DynamicBufferAttribute.
mrdoob Aug 26, 2015
9b9d5fe
Updated examples relying on DynamicBufferAttribute.
mrdoob Aug 26, 2015
69c1daf
*BufferAttribute/*InterleavedBuffer: Updated copy/clone.
mrdoob Aug 26, 2015
67ba9db
More ShaderMaterial.attributes clean up.
mrdoob Aug 26, 2015
e22e0fe
Fixed typo.
mrdoob Aug 26, 2015
5cfccb7
Updated builds.
mrdoob Aug 26, 2015
4cd17df
MD2Loader: Clean up.
mrdoob Aug 26, 2015
88bf596
Updated builds.
mrdoob Aug 26, 2015
6a20a41
MD2Loader: Fixed post-cleanup normals bug.
mrdoob Aug 26, 2015
9148308
Editor: Fixed pickers.
mrdoob Aug 27, 2015
c79254c
Editor: Using BufferGeometry for pickers.
mrdoob Aug 27, 2015
8465b81
Examples clean up.
mrdoob Aug 27, 2015
f4c0f65
More examples clean up.
mrdoob Aug 27, 2015
42a8efc
Example clean up.
mrdoob Aug 27, 2015
3b6caa5
Minor clean up.
mrdoob Aug 27, 2015
2073325
Indexed BoxHelper.
mrdoob Aug 27, 2015
c218395
Updated builds.
mrdoob Aug 27, 2015
4a7358b
Fixed webgl_buffergeometry_drawcalls example.
mrdoob Aug 27, 2015
094d6d5
WebGLRenderer: Deprecated supportsInstancedArray() and supportsVertex…
mrdoob Aug 27, 2015
45ad383
Updated instancing examples.
mrdoob Aug 27, 2015
28fd680
Updated builds.
mrdoob Aug 27, 2015
bb72081
Merge remote-tracking branch 'origin/sceneAnimations'
jackcaron Aug 27, 2015
f627040
Line: Nicer backwards compatibility for THREE.LinePieces.
mrdoob Aug 27, 2015
ddedfe2
Updated builds.
mrdoob Aug 27, 2015
0dbd4b3
Removed IndexBufferAttribute. Promoted index attribute to BufferGeome…
mrdoob Aug 27, 2015
4987c97
Updated builds.
mrdoob Aug 27, 2015
945f99a
Merge branch 'dev' of https://github.com/mrdoob/three.js into dev
mrdoob Aug 28, 2015
d0dae72
Updated builds.
mrdoob Aug 28, 2015
740b0ae
Merge pull request #7050 from WestLangley/dev-orbit_cleanup
mrdoob Aug 28, 2015
d014875
Set better defaults for DataTexture
gero3 Aug 28, 2015
451371d
cleanup nearestfilter
gero3 Aug 28, 2015
f81da6a
cleanup nearestFilter
gero3 Aug 28, 2015
aeb5710
cleanup nearestFilter
gero3 Aug 28, 2015
1f95ab2
Merge pull request #7063 from gero3/DataTextureDefaults
mrdoob Aug 28, 2015
99e3d99
Simplified setting material.program.
tschw Aug 24, 2015
0d9c08a
Merge pull request #7043 from tschw/dev
mrdoob Aug 28, 2015
651ccd4
Updated docs for DataTexture.
tschw Aug 28, 2015
7f4b563
Merge pull request #7065 from tschw/doc
mrdoob Aug 28, 2015
b29835c
Merge remote-tracking branch 'origin/dev'
jackcaron Aug 28, 2015
0feb6bd
Merge remote-tracking branch 'origin/sceneAnimations'
jackcaron Aug 28, 2015
aa44449
missing equal sign
jackcaron Aug 28, 2015
3b894ac
forgot the 'function'
jackcaron Aug 28, 2015
2d1745d
new track system, plus blend shapes
jackcaron Aug 28, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,103 changes: 550 additions & 553 deletions build/three.js

Large diffs are not rendered by default.

600 changes: 300 additions & 300 deletions build/three.min.js

Large diffs are not rendered by default.

17 changes: 5 additions & 12 deletions docs/api/objects/Mesh.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,22 @@ <h3>[property:Material material]</h3>

<div>An instance of [page:Material], defining the object's appearance. Default is a [page:MeshBasicMaterial] with wireframe mode enabled and randomised colour.</div>

<h3>[property:Array morphTargetForcedOrder]</h3>

<div>
An array of indices specifying the order that the morphs will be applied. Undefined by
default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
</div>

<h3>[property:Array morphTargetInfluences]</h3>

<div>
An array of weights typically from 0-1 that specify how much of the morph is applied.
Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
</div>

<h3>[property:Array morphTargetDictionary]</h3>

<div>
A dictionary of morphTargets based on the morphTarget.name property.
Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
</div>

<h3>[property:Integer morphTargetBase]</h3>

<div>
Specify the index of the morph that should be used as the base morph. Replaces the positions.
Undefined by default, but reset to -1 (non set) by [page:Mesh.updateMorphTargets updateMorphTargets].
Expand Down Expand Up @@ -97,7 +90,7 @@ <h3>[method:Array raycast]([page:Raycaster raycaster], [page:Array intersects])<
<div>
Get intersections between a casted ray and this mesh. [page:Raycaster.intersectObject] will call this method.
</div>

<h3>[method:Object3D clone]([page:Object3D object])</h3>
<div>
object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned Mesh Object.
Expand Down
38 changes: 15 additions & 23 deletions docs/api/textures/DataTexture.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,36 @@

<h1>[name]</h1>

<div class="desc">
Creates a texture directly from bitmapdata, width and height.
</div>
<div class="desc">Creates a texture directly from raw data, width and height.</div>


<h2>Constructor</h2>


<h3>[name]([page:ArraybufferView data], [page:Integer width], [page:Integer height], [page:number format], [page:number type], [page:number mapping], [page:number wrapS], [page:number wrapT], [page:number magFilter], [page:number minFilter], [page:number anisotropy])</h3>
<h3>[name]( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy )</h3>
<div>
data -- The data should be arraybufferview. It contains the data of image based on the type and format.<br />
width -- The width of the image. <br />
height -- The height of the image. <br />
format -- The default is THREE.RGBAFormat for the texture. Other formats are: THREE.AlphaFormat, THREE.RGBFormat, THREE.LuminanceFormat, and THREE.LuminanceAlphaFormat. There are also compressed texture formats, if the S3TC extension is supported: THREE.RGB_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT3_Format, and THREE.RGBA_S3TC_DXT5_Format.<br />
type -- The default is THREE.UnsignedByteType. Other valid types (as WebGL allows) are THREE.ByteType, THREE.ShortType, THREE.UnsignedShortType, THREE.IntType, THREE.UnsignedIntType, THREE.FloatType, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type, and THREE.UnsignedShort565Type.<br />
mapping -- How the image is applied to the object. An object type of THREE.UVMapping is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.<br />
wrapS -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
wrapT -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texel.<br />
minFilter -- How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipMapLinearFilter, which uses mipmapping and a trilinear filter. Other choices are THREE.NearestFilter, THREE.NearestMipMapNearestFilter, THREE.NearestMipMapLinearFilter, THREE.LinearFilter, and THREE.LinearMipMapNearestFilter. These vary whether the nearest texel or nearest four texels are retrieved on the nearest mipmap or nearest two mipmaps. Interpolation occurs among the samples retrieved.<br />
anisotropy -- The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
The data argument must be an ArrayBuffer or a typed array view.
Further parameters correspond to the properties inherited from [page:Texture], where both magFilter and minFilter default to THREE.NearestFilter. The properties flipY and generateMipmaps are intially set to false.
</div>
<div>
This loads a image through the bitmap values. The values are dependant on the type and format.
If the type is THREE.UnsignedByteType, a Uint8Array must be supplied. If it is THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type or THREE.UnsignedShort565Type, a Uint16Array must be supplied.<br />
If the format is THREE.RGBAFormat, data needs 4 values for 1 pixel. These are supplied in the Red,Green,Blue and alpha sequence. <br />
Except if the type is THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type or THREE.UnsignedShort565Type.
</div>
The interpretation of the data depends on type and format:
If the type is THREE.UnsignedByteType, a Uint8Array will be useful for addressing the texel data.
If the format is THREE.RGBAFormat, data needs four values for one texel; Red, Green, Blue and Alpha (typically the opacity). Similarly, THREE.RGBFormat specifies a format where only three values are used for each texel.<br />

For the packed types, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type or THREE.UnsignedShort565Type, all color components of one texel can be addressed as bitfields within an integer element of a Uint16Array.<br />

<h2>Properties</h2>
In order to use the types THREE.FloatType and THREE.HalfFloatType, the WebGL implementation must support the respective extensions OES_texture_float and OES_texture_half_float. In order to use THREE.LinearFilter for component-wise, bilinear interpolation of the texels based on these types, the WebGL extensions OES_texture_float_linear or OES_texture_half_float_linear must also be present.
</div>

<h2>Properties</h2>

<h3>[property:Image image]</h3>
<div>
Overridden with a record type holding data, width and height.
</div>

<h2>Methods</h2>



<h2>Source</h2>

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
Expand Down
2 changes: 1 addition & 1 deletion docs/scenes/bones-browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
document.body.appendChild( renderer.domElement );

orbit = new THREE.OrbitControls( camera, renderer.domElement );
orbit.noZoom = true;
orbit.enableZoom = false;

ambientLight = new THREE.AmbientLight( 0x000000 );
scene.add( ambientLight );
Expand Down
2 changes: 1 addition & 1 deletion docs/scenes/geometry-browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
document.body.appendChild( renderer.domElement );

var orbit = new THREE.OrbitControls( camera, renderer.domElement );
orbit.noZoom = true;
orbit.enableZoom = false;

var ambientLight = new THREE.AmbientLight( 0x000000 );
scene.add( ambientLight );
Expand Down
3 changes: 0 additions & 3 deletions editor/js/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ var Config = function () {
'project/renderer/antialias': true,
'project/vr': false,

'camera/position': [ 500, 250, 500 ],
'camera/target': [ 0, 0, 0 ],

'ui/sidebar/animation/collapsed': true,
'ui/sidebar/geometry/collapsed': true,
'ui/sidebar/material/collapsed': true,
Expand Down
10 changes: 4 additions & 6 deletions editor/js/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ var Editor = function () {

// actions

playAnimation: new SIGNALS.Signal(),
stopAnimation: new SIGNALS.Signal(),

// showDialog: new SIGNALS.Signal(),

// notifications
Expand Down Expand Up @@ -75,6 +72,8 @@ var Editor = function () {
this.loader = new Loader( this );

this.camera = new THREE.PerspectiveCamera( 50, 1, 1, 100000 );
this.camera.position.set( 500, 250, 500 );
this.camera.lookAt( new THREE.Vector3() );
this.camera.name = 'Camera';

this.scene = new THREE.Scene();
Expand Down Expand Up @@ -242,8 +241,8 @@ Editor.prototype = {

addHelper: function () {

var geometry = new THREE.SphereGeometry( 20, 4, 2 );
var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
var geometry = new THREE.SphereBufferGeometry( 20, 4, 2 );
var material = new THREE.MeshBasicMaterial( { color: 0xff0000, visible: false } );

return function ( object ) {

Expand Down Expand Up @@ -283,7 +282,6 @@ Editor.prototype = {
var picker = new THREE.Mesh( geometry, material );
picker.name = 'picker';
picker.userData.object = object;
picker.visible = false;
helper.add( picker );

this.sceneHelpers.add( helper );
Expand Down
18 changes: 10 additions & 8 deletions editor/js/Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,12 @@ var Loader = function ( editor ) {
var xml = parser.parseFromString( contents, 'text/xml' );

var loader = new THREE.ColladaLoader();
loader.parse( xml, function ( collada ) {
var collada = loader.parse( xml );

collada.scene.name = filename;
collada.scene.name = filename;

editor.addObject( collada.scene );
editor.select( collada.scene );

} );
editor.addObject( collada.scene );
editor.select( collada.scene );

}, false );
reader.readAsText( file );
Expand Down Expand Up @@ -192,9 +190,13 @@ var Loader = function ( editor ) {
var contents = event.target.result;

var geometry = new THREE.MD2Loader().parse( contents );
geometry.name = filename;
var material = new THREE.MeshPhongMaterial( {
morphTargets: true,
morphNormals: true
} );

var object = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
var object = new THREE.MorphAnimMesh( geometry, material );
object.name = filename;

editor.addObject( object );
editor.select( object );
Expand Down
29 changes: 22 additions & 7 deletions editor/js/Sidebar.Animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ Sidebar.Animation = function ( editor ) {

animations[ child.id ] = new THREE.Animation( child, child.geometry.animation );

} else if ( child instanceof THREE.MorphAnimMesh ) {

var animation = new THREE.MorphAnimation( child );
animation.duration = 30;

// temporal hack for THREE.AnimationHandler
animation._play = animation.play;
animation.play = function () {
this._play();
THREE.AnimationHandler.play( this );
};
animation.resetBlendWeights = function () {};
animation.stop = function () {
this.pause();
THREE.AnimationHandler.stop( this );
};

animations[ child.id ] = animation;

}

} );
Expand All @@ -60,27 +79,23 @@ Sidebar.Animation = function ( editor ) {

container.setDisplay( 'none' );

if ( object instanceof THREE.SkinnedMesh ) {
if ( object instanceof THREE.SkinnedMesh || object instanceof THREE.MorphAnimMesh ) {

animationsRow.clear();

var animation = animations[ object.id ];

var playButton = new UI.Button().setLabel( 'Play' ).onClick( function () {
var playButton = new UI.Button( 'Play' ).onClick( function () {

animation.play();

signals.playAnimation.dispatch( animation );

} );
animationsRow.add( playButton );

var pauseButton = new UI.Button().setLabel( 'Stop' ).onClick( function () {
var pauseButton = new UI.Button( 'Stop' ).onClick( function () {

animation.stop();

signals.stopAnimation.dispatch( animation );

} );
animationsRow.add( pauseButton );

Expand Down
40 changes: 9 additions & 31 deletions editor/js/Sidebar.Geometry.BufferGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,25 @@ Sidebar.Geometry.BufferGeometry = function ( signals ) {

var container = new UI.Panel();

// vertices

var verticesRow = new UI.Panel();
var vertices = new UI.Text().setFontSize( '12px' );

verticesRow.add( new UI.Text( 'Vertices' ).setWidth( '90px' ) );
verticesRow.add( vertices );

container.add( verticesRow );

// faces

var facesRow = new UI.Panel();
var faces = new UI.Text().setFontSize( '12px' );

facesRow.add( new UI.Text( 'Faces' ).setWidth( '90px' ) );
facesRow.add( faces );

container.add( facesRow );

//

var update = function ( object ) {
function update( object ) {

if ( object === null ) return;

var geometry = object.geometry;

if ( geometry instanceof THREE.BufferGeometry ) {
if ( geometry instanceof THREE.BufferGeometry ) {

container.clear();
container.setDisplay( 'block' );

vertices.setValue( ( geometry.attributes.position.array.length / 3 ).format() );

if ( geometry.attributes.index !== undefined ) {

faces.setValue( ( geometry.attributes.index.array.length / 3 ).format() );
var attributes = geometry.attributes;

} else {
for ( var name in attributes ) {

faces.setValue( ( geometry.attributes.position.array.length / 9 ).format() );
var panel = new UI.Panel();
panel.add( new UI.Text( name ).setWidth( '90px' ) );
panel.add( new UI.Text( ( attributes[ name ].count ).format() ).setFontSize( '12px' ) );
container.add( panel );

}

Expand Down
6 changes: 0 additions & 6 deletions editor/js/Sidebar.Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,6 @@ Sidebar.Material = function ( editor ) {

if ( material.vertexColors !== vertexColors ) {

if ( geometry instanceof THREE.Geometry ) {

geometry.groupsNeedUpdate = true;

}

material.vertexColors = vertexColors;
material.needsUpdate = true;

Expand Down
2 changes: 1 addition & 1 deletion editor/js/Sidebar.Object3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Sidebar.Object3D = function ( editor ) {
// scale

var objectScaleRow = new UI.Panel();
var objectScaleLock = new UI.Checkbox().setPosition( 'absolute' ).setLeft( '75px' );
var objectScaleLock = new UI.Checkbox( true ).setPosition( 'absolute' ).setLeft( '75px' );
var objectScaleX = new UI.Number( 1 ).setRange( 0.01, Infinity ).setWidth( '50px' ).onChange( updateScaleX );
var objectScaleY = new UI.Number( 1 ).setRange( 0.01, Infinity ).setWidth( '50px' ).onChange( updateScaleY );
var objectScaleZ = new UI.Number( 1 ).setRange( 0.01, Infinity ).setWidth( '50px' ).onChange( updateScaleZ );
Expand Down
Loading