Skip to content

Commit

Permalink
Editor: Cleaned up Add / Mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed May 7, 2024
1 parent cc9a249 commit c857c1e
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 81 deletions.
34 changes: 17 additions & 17 deletions editor/js/Menubar.Add.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function MenubarAdd( editor ) {
options.add( new UIHorizontalRule() );


// Mesh (submenu)
// Mesh

const meshSubmenuTitle = new UIRow().setTextContent( strings.getKey( 'menubar/add/mesh' ) ).addClass( 'option' ).addClass( 'submenu-title' );
meshSubmenuTitle.onMouseOver( function () {
Expand All @@ -67,7 +67,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/box' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/box' ) );
option.onClick( function () {

const geometry = new THREE.BoxGeometry( 1, 1, 1, 1, 1, 1 );
Expand All @@ -83,7 +83,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/capsule' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/capsule' ) );
option.onClick( function () {

const geometry = new THREE.CapsuleGeometry( 1, 1, 4, 8 );
Expand All @@ -100,7 +100,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/circle' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/circle' ) );
option.onClick( function () {

const geometry = new THREE.CircleGeometry( 1, 32, 0, Math.PI * 2 );
Expand All @@ -116,7 +116,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/cylinder' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/cylinder' ) );
option.onClick( function () {

const geometry = new THREE.CylinderGeometry( 1, 1, 1, 32, 1, false, 0, Math.PI * 2 );
Expand All @@ -132,7 +132,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/dodecahedron' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/dodecahedron' ) );
option.onClick( function () {

const geometry = new THREE.DodecahedronGeometry( 1, 0 );
Expand All @@ -148,7 +148,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/icosahedron' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/icosahedron' ) );
option.onClick( function () {

const geometry = new THREE.IcosahedronGeometry( 1, 0 );
Expand All @@ -164,7 +164,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/lathe' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/lathe' ) );
option.onClick( function () {

const geometry = new THREE.LatheGeometry();
Expand All @@ -180,7 +180,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/octahedron' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/octahedron' ) );
option.onClick( function () {

const geometry = new THREE.OctahedronGeometry( 1, 0 );
Expand All @@ -196,7 +196,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/plane' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/plane' ) );
option.onClick( function () {

const geometry = new THREE.PlaneGeometry( 1, 1, 1, 1 );
Expand All @@ -213,7 +213,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/ring' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/ring' ) );
option.onClick( function () {

const geometry = new THREE.RingGeometry( 0.5, 1, 32, 1, 0, Math.PI * 2 );
Expand All @@ -229,7 +229,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/sphere' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/sphere' ) );
option.onClick( function () {

const geometry = new THREE.SphereGeometry( 1, 32, 16, 0, Math.PI * 2, 0, Math.PI );
Expand All @@ -245,7 +245,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/sprite' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/sprite' ) );
option.onClick( function () {

const sprite = new THREE.Sprite( new THREE.SpriteMaterial() );
Expand All @@ -260,7 +260,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/tetrahedron' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/tetrahedron' ) );
option.onClick( function () {

const geometry = new THREE.TetrahedronGeometry( 1, 0 );
Expand All @@ -276,7 +276,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/torus' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/torus' ) );
option.onClick( function () {

const geometry = new THREE.TorusGeometry( 1, 0.4, 12, 48, Math.PI * 2 );
Expand All @@ -292,7 +292,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/torusknot' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/torusknot' ) );
option.onClick( function () {

const geometry = new THREE.TorusKnotGeometry( 1, 0.4, 64, 8, 2, 3 );
Expand All @@ -308,7 +308,7 @@ function MenubarAdd( editor ) {

option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/add/tube' ) );
option.setTextContent( strings.getKey( 'menubar/add/mesh/tube' ) );
option.onClick( function () {

const path = new THREE.CatmullRomCurve3( [
Expand Down
140 changes: 76 additions & 64 deletions editor/js/Strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,31 @@ function Strings( config ) {

'menubar/add': 'Add',
'menubar/add/group': 'Group',

'menubar/add/mesh': 'Mesh',
'menubar/add/plane': 'Plane',
'menubar/add/box': 'Box',
'menubar/add/capsule': 'Capsule',
'menubar/add/circle': 'Circle',
'menubar/add/cylinder': 'Cylinder',
'menubar/add/ring': 'Ring',
'menubar/add/sphere': 'Sphere',
'menubar/add/dodecahedron': 'Dodecahedron',
'menubar/add/icosahedron': 'Icosahedron',
'menubar/add/octahedron': 'Octahedron',
'menubar/add/tetrahedron': 'Tetrahedron',
'menubar/add/torus': 'Torus',
'menubar/add/tube': 'Tube',
'menubar/add/torusknot': 'TorusKnot',
'menubar/add/lathe': 'Lathe',
'menubar/add/sprite': 'Sprite',
'menubar/add/mesh/plane': 'Plane',
'menubar/add/mesh/box': 'Box',
'menubar/add/mesh/capsule': 'Capsule',
'menubar/add/mesh/circle': 'Circle',
'menubar/add/mesh/cylinder': 'Cylinder',
'menubar/add/mesh/ring': 'Ring',
'menubar/add/mesh/sphere': 'Sphere',
'menubar/add/mesh/dodecahedron': 'Dodecahedron',
'menubar/add/mesh/icosahedron': 'Icosahedron',
'menubar/add/mesh/octahedron': 'Octahedron',
'menubar/add/mesh/tetrahedron': 'Tetrahedron',
'menubar/add/mesh/torus': 'Torus',
'menubar/add/mesh/tube': 'Tube',
'menubar/add/mesh/torusknot': 'TorusKnot',
'menubar/add/mesh/lathe': 'Lathe',
'menubar/add/mesh/sprite': 'Sprite',

'menubar/add/pointlight': 'PointLight',
'menubar/add/spotlight': 'SpotLight',
'menubar/add/directionallight': 'DirectionalLight',
'menubar/add/hemispherelight': 'HemisphereLight',
'menubar/add/ambientlight': 'AmbientLight',

'menubar/add/perspectivecamera': 'PerspectiveCamera',
'menubar/add/orthographiccamera': 'OrthographicCamera',

Expand Down Expand Up @@ -431,28 +434,31 @@ function Strings( config ) {

'menubar/add': 'Ajouter',
'menubar/add/group': 'Groupe',

'menubar/add/mesh': 'Maille',
'menubar/add/plane': 'Plan',
'menubar/add/box': 'Cube',
'menubar/add/capsule': 'Capsule',
'menubar/add/circle': 'Cercle',
'menubar/add/cylinder': 'Cylindre',
'menubar/add/ring': 'Bague',
'menubar/add/sphere': 'Sphère',
'menubar/add/dodecahedron': 'Dodécaèdre',
'menubar/add/icosahedron': 'Icosaèdre',
'menubar/add/octahedron': 'Octaèdre',
'menubar/add/tetrahedron': 'Tétraèdre',
'menubar/add/torus': 'Torus',
'menubar/add/tube': 'Tube',
'menubar/add/torusknot': 'Noeud Torus',
'menubar/add/lathe': 'Tour',
'menubar/add/sprite': 'Sprite',
'menubar/add/mesh/plane': 'Plan',
'menubar/add/mesh/box': 'Cube',
'menubar/add/mesh/capsule': 'Capsule',
'menubar/add/mesh/circle': 'Cercle',
'menubar/add/mesh/cylinder': 'Cylindre',
'menubar/add/mesh/ring': 'Bague',
'menubar/add/mesh/sphere': 'Sphère',
'menubar/add/mesh/dodecahedron': 'Dodécaèdre',
'menubar/add/mesh/icosahedron': 'Icosaèdre',
'menubar/add/mesh/octahedron': 'Octaèdre',
'menubar/add/mesh/tetrahedron': 'Tétraèdre',
'menubar/add/mesh/torus': 'Torus',
'menubar/add/mesh/tube': 'Tube',
'menubar/add/mesh/torusknot': 'Noeud Torus',
'menubar/add/mesh/lathe': 'Tour',
'menubar/add/mesh/sprite': 'Sprite',

'menubar/add/pointlight': 'Lumière ponctuelle',
'menubar/add/spotlight': 'Projecteur',
'menubar/add/directionallight': 'Lumière directionnelle',
'menubar/add/hemispherelight': 'Lumière hémisphérique',
'menubar/add/ambientlight': 'Lumière ambiante',

'menubar/add/perspectivecamera': 'Caméra perspective',
'menubar/add/orthographiccamera': 'Caméra orthographique',

Expand Down Expand Up @@ -811,28 +817,31 @@ function Strings( config ) {

'menubar/add': '添加',
'menubar/add/group': '组',

'menubar/add/mesh': '网格',
'menubar/add/plane': '平面',
'menubar/add/box': '正方体',
'menubar/add/capsule': '胶囊',
'menubar/add/circle': '圆',
'menubar/add/cylinder': '圆柱体',
'menubar/add/ring': '环',
'menubar/add/sphere': '球体',
'menubar/add/dodecahedron': '十二面体',
'menubar/add/icosahedron': '二十面体',
'menubar/add/octahedron': '八面体',
'menubar/add/tetrahedron': '四面体',
'menubar/add/torus': '圆���体',
'menubar/add/torusknot': '环面纽结体',
'menubar/add/tube': '管',
'menubar/add/lathe': '酒杯',
'menubar/add/sprite': '精灵',
'menubar/add/mesh/plane': '平面',
'menubar/add/mesh/box': '正方体',
'menubar/add/mesh/capsule': '胶囊',
'menubar/add/mesh/circle': '圆',
'menubar/add/mesh/cylinder': '圆柱体',
'menubar/add/mesh/ring': '环',
'menubar/add/mesh/sphere': '球体',
'menubar/add/mesh/dodecahedron': '十二面体',
'menubar/add/mesh/icosahedron': '二十面体',
'menubar/add/mesh/octahedron': '八面体',
'menubar/add/mesh/tetrahedron': '四面体',
'menubar/add/mesh/torus': '圆环体',
'menubar/add/mesh/torusknot': '环面纽结体',
'menubar/add/mesh/tube': '管',
'menubar/add/mesh/lathe': '酒杯',
'menubar/add/mesh/sprite': '精灵',

'menubar/add/pointlight': '点光源',
'menubar/add/spotlight': '聚光灯',
'menubar/add/directionallight': '平行光',
'menubar/add/hemispherelight': '半球光',
'menubar/add/ambientlight': '环境光',

'menubar/add/perspectivecamera': '透视相机',
'menubar/add/orthographiccamera': '正交相机',

Expand Down Expand Up @@ -1191,28 +1200,31 @@ function Strings( config ) {

'menubar/add': '追加',
'menubar/add/group': 'グループ',

'menubar/add/mesh': 'メッシュ',
'menubar/add/plane': '平面',
'menubar/add/box': '直方体',
'menubar/add/capsule': 'カプセル',
'menubar/add/circle': '円',
'menubar/add/cylinder': '円柱',
'menubar/add/ring': 'リング',
'menubar/add/sphere': '球',
'menubar/add/dodecahedron': '十二面体',
'menubar/add/icosahedron': '二十面体',
'menubar/add/octahedron': '八面体',
'menubar/add/tetrahedron': '四面体',
'menubar/add/torus': 'トーラス',
'menubar/add/tube': 'チューブ',
'menubar/add/torusknot': 'ノットトーラス',
'menubar/add/lathe': '旋盤形',
'menubar/add/sprite': 'スプライト',
'menubar/add/mesh/plane': '平面',
'menubar/add/mesh/box': '直方体',
'menubar/add/mesh/capsule': 'カプセル',
'menubar/add/mesh/circle': '円',
'menubar/add/mesh/cylinder': '円柱',
'menubar/add/mesh/ring': 'リング',
'menubar/add/mesh/sphere': '球',
'menubar/add/mesh/dodecahedron': '十二面体',
'menubar/add/mesh/icosahedron': '二十面体',
'menubar/add/mesh/octahedron': '八面体',
'menubar/add/mesh/tetrahedron': '四面体',
'menubar/add/mesh/torus': 'トーラス',
'menubar/add/mesh/tube': 'チューブ',
'menubar/add/mesh/torusknot': 'ノットトーラス',
'menubar/add/mesh/lathe': '旋盤形',
'menubar/add/mesh/sprite': 'スプライト',

'menubar/add/pointlight': 'ポイントライト',
'menubar/add/spotlight': 'スポットライト',
'menubar/add/directionallight': 'ディレクショナルライト',
'menubar/add/hemispherelight': 'ヘミスフィアライト',
'menubar/add/ambientlight': 'アンビエントライト',

'menubar/add/perspectivecamera': '透視投影カメラ',
'menubar/add/orthographiccamera': '平行投影カメラ',

Expand Down

0 comments on commit c857c1e

Please sign in to comment.