Normand Briere
2019-07-27 1af7d3700724834e40ad8636bc9a56cdc3b19b15
GroupEditor.java
....@@ -60,6 +60,12 @@
6060 this.copy = this.group = group;
6161 //selectees = this.group.selectees;
6262
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6369 if(ui)
6470 SetupUI(objEditor);
6571 }
....@@ -74,16 +80,28 @@
7480 this.copy = this.group = copy;
7581 //selectees = this.group.selectees;
7682
77
- SetupMenu2(objEditor);
83
+ SetupMenu2(this); //objEditor);
7884 SetupUI2(objEditor);
7985 objEditor.SetupUI(true);
8086 SetupViews(objEditor);
8187
8288 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
89
+
90
+ if (copy.versions == null)
91
+ {
92
+ copy.versions = new byte[100][];
93
+ copy.versionindex = -1;
94
+
95
+ Save(true);
96
+ }
8397 }
8498
8599 void CloneSelection(boolean supports)
86100 {
101
+ if (Globals.REPLACEONMAKE)
102
+ Save();
103
+ boolean keep = Globals.REPLACEONMAKE;
104
+ Globals.REPLACEONMAKE = false;
87105 // Object3D keep = GrafreeD.clipboard;
88106 //Object3D obj;
89107 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,18 +112,19 @@
94112
95113 makeSomething(clone, i==group.selection.size()-1);
96114 }
115
+ Globals.REPLACEONMAKE = keep;
97116 }
98117
99118 void CloneClipboard(boolean supports)
100119 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
120
+ assert(Grafreed.clipboard.parent == null);
121
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
122
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
123
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
124
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106125 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
126
+ makeSomething(CloneObject(Grafreed.clipboard, false));
127
+ Grafreed.clipboard.get(0).parent = keepparent;
109128 }
110129
111130 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +138,7 @@
119138 // obj.support = null;
120139 if (!supports)
121140 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
141
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123142 obj.parent = parent;
124143 // obj.support = support;
125144 // clone.support = support; // aout 2013
....@@ -148,30 +167,29 @@
148167
149168 //JTextField nameField;
150169
151
- void SetupMenu2(ObjEditor oe)
170
+ void SetupMenu2(GroupEditor oe)
152171 {
153
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
156
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
157
- oe.cameraMenu.add("-");
158
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
159
- openWindowItem.addActionListener(this);
160
- editLeafItem.addActionListener(this);
161
- lookAtItem.addActionListener(this);
162
- //lookFromItem.addActinoListener(this);
163
- //switchItem.addActionListener(this);
172
+ oe.jTree = new cTree();
173
+
164174 Menu menu;
165175 oe.menuBar.add(menu = new Menu("Edit"));
166176 //editItem = menu.add(new MenuItem("Edit"));
167177 //editItem.addActionListener(this);
168
- duplicateItem = menu.add(new MenuItem("Duplicate"));
178
+
179
+// undoItem = menu.add(new MenuItem("Undo"));
180
+// undoItem.addActionListener(this);
181
+// redoItem = menu.add(new MenuItem("Redo"));
182
+// redoItem.addActionListener(this);
183
+// menu.add("-");
184
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
169185 duplicateItem.addActionListener(this);
170
- menu.add("-");
171186 cloneItem = menu.add(new MenuItem("Clone"));
172187 cloneItem.addActionListener(this);
188
+ if (Globals.ADVANCED)
189
+ {
173190 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174191 cloneSupportItem.addActionListener(this);
192
+ }
175193 menu.add("-");
176194 cutItem = menu.add(new MenuItem("Cut"));
177195 cutItem.addActionListener(this);
....@@ -179,27 +197,123 @@
179197 copyItem.addActionListener(this);
180198 pasteItem = menu.add(new MenuItem("Paste"));
181199 pasteItem.addActionListener(this);
200
+
201
+ menu.add("-");
202
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
203
+ pasteIntoItem.addActionListener(this);
182204 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183205 pasteLinkItem.addActionListener(this);
184206 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185207 pasteCloneItem.addActionListener(this);
186208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187209 // pasteExpandItem.addActionListener(this);
188
- clearItem = menu.add(new MenuItem("Clear"));
189
- clearItem.addActionListener(this);
210
+ menu.add("-");
211
+ deleteItem = menu.add(new MenuItem("Delete"));
212
+ deleteItem.addActionListener(this);
213
+
214
+ if (Globals.ADVANCED)
215
+ {
216
+ // Deletes the cameras...
190217 clearAllItem = menu.add(new MenuItem("Clear All"));
191218 clearAllItem.addActionListener(this);
219
+ }
220
+
221
+ menuBar.add(cameraMenu = new Menu("View"));
222
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
223
+ //zBufferItem.addActionListener(this);
224
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
225
+ //normalLensItem.addActionListener(this);
226
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
227
+ restoreCameraItem.addActionListener(this);
228
+
229
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
230
+// toggleFullScreenItem.addItemListener(this);
231
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
232
+// cameraMenu.add("-");
233
+//
234
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
235
+// toggleTextureItem.addItemListener(this);
236
+// toggleTextureItem.setState(CameraPane.textureon);
237
+//
238
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
239
+// toggleSwitchItem.addItemListener(this);
240
+// toggleSwitchItem.setState(CameraPane.SWITCH);
241
+
242
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
243
+ toggleHandleItem.addItemListener(this);
244
+ toggleHandleItem.setState(CameraPane.HANDLES);
245
+
246
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
247
+ togglePaintItem.addItemListener(this);
248
+ togglePaintItem.setState(CameraPane.PAINTMODE);
249
+
250
+ if (Globals.ADVANCED)
251
+ {
252
+ cameraMenu.add("-");
253
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
254
+ toggleLiveItem.addItemListener(this);
255
+ toggleLiveItem.setState(Globals.isLIVE());
192256
257
+ cameraMenu.add(stepItem = new MenuItem("Step"));
258
+ stepItem.addActionListener(this);
259
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
260
+ // toggleDLItem.addItemListener(this);
261
+ // toggleDLItem.setState(false);
262
+
263
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
264
+ toggleRenderItem.addItemListener(this);
265
+ toggleRenderItem.setState(!CameraPane.frozen);
266
+
267
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
268
+ toggleDebugItem.addItemListener(this);
269
+ toggleDebugItem.setState(Globals.DEBUG);
270
+
271
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
272
+ toggleFrustumItem.addItemListener(this);
273
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
274
+
275
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
276
+ toggleFootContactItem.addItemListener(this);
277
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
278
+
279
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
280
+ toggleTimelineItem.addItemListener(this);
281
+ }
282
+
283
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
284
+// toggleRootItem.addItemListener(this);
285
+// toggleRootItem.setState(false);
286
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
287
+// animationItem.addItemListener(this);
288
+// animationItem.setState(CameraPane.ANIMATION);
289
+ cameraMenu.add("-");
290
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
291
+ editCameraItem.addActionListener(this);
292
+
293
+ if (Globals.ADVANCED)
294
+ {
295
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
296
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
297
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
298
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
299
+ oe.cameraMenu.add("-");
300
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
301
+ openWindowItem.addActionListener(this);
302
+ editLeafItem.addActionListener(this);
303
+ lookAtItem.addActionListener(this);
304
+ //lookFromItem.addActinoListener(this);
305
+ //switchViewItem.addActionListener(this);
306
+ }
307
+
193308 oe.menuBar.add(menu = new Menu("Setting"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
309
+ if (Globals.ADVANCED)
310
+ {
198311 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199312 revertMeshItem.addActionListener(this);
200313 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201314 resetreferencesItem.addActionListener(this);
202315 menu.add("-");
316
+ }
203317 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204318 overwriteGeoItem.addActionListener(this);
205319 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,79 +325,104 @@
211325 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212326 overwriteUVItem.addActionListener(this);
213327 menu.add("-");
328
+ if (Globals.ADVANCED)
329
+ {
214330 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215331 generateMeshItem.addActionListener(this);
216332 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217333 poseMeshItem.addActionListener(this);
218334 menu.add("-");
335
+ }
219336 resetsupportItem = menu.add(new MenuItem("Reset support"));
220337 resetsupportItem.addActionListener(this);
221338 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222339 linkverticesItem.addActionListener(this);
223340 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224341 relinkverticesItem.addActionListener(this);
342
+
343
+ if (Globals.ADVANCED)
344
+ {
225345 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226346 setMasterItem.addActionListener(this);
347
+ }
227348
228349 oe.menuBar.add(menu = new Menu("Group"));
229
- grabItem = menu.add(new MenuItem("Grab"));
230
- grabItem.addActionListener(this);
350
+// grabItem = menu.add(new MenuItem("Grab"));
351
+// grabItem.addActionListener(this);
231352 backItem = menu.add(new MenuItem("Back"));
232353 backItem.addActionListener(this);
233354 frontItem = menu.add(new MenuItem("Front"));
234355 frontItem.addActionListener(this);
235
- compositeItem = menu.add(new MenuItem("Composite"));
236
- compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
356
+// compositeItem = menu.add(new MenuItem("Composite"));
357
+// compositeItem.addActionListener(this);
358
+
359
+ if (Globals.ADVANCED)
360
+ {
361
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238362 hideItem.addActionListener(this);
363
+ }
239364 ungroupItem = menu.add(new MenuItem("Ungroup"));
240365 ungroupItem.addActionListener(this);
241
- menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
243
- randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
366
+
367
+// menu.add("-");
368
+//
369
+// switchItem = menu.add(new MenuItem("Switch node"));
370
+// switchItem.addActionListener(this);
371
+ if (Globals.ADVANCED)
372
+ {
248373 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249374 switchGeoItem.addActionListener(this);
250375 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251376 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
377
+ morphItem = menu.add(new MenuItem("Morph Group"));
253378 morphItem.addActionListener(this);
379
+
380
+ menu.add("-");
381
+ physicsItem = menu.add(new MenuItem("Physics"));
382
+ physicsItem.addActionListener(this);
383
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
384
+ frameselectorItem.addActionListener(this);
254385 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255386 scriptNodeItem.addActionListener(this);
256
- cameraItem = menu.add(new MenuItem("Camera"));
257
- cameraItem.addActionListener(this);
387
+ }
258388
259389 oe.menuBar.add(menu = new Menu("Object"));
260
- textureItem = menu.add(new MenuItem("Texture"));
261
- textureItem.addActionListener(this);
390
+// textureItem = menu.add(new MenuItem("Texture"));
391
+// textureItem.addActionListener(this);
262392 billboardItem = menu.add(new MenuItem("Billboard"));
263393 billboardItem.addActionListener(this);
264394 csgItem = menu.add(new MenuItem("CSG"));
265395 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
396
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267397 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
398
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269399 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
400
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271401 shadowZItem.addActionListener(this);
402
+ attributeItem = menu.add(new MenuItem("Attribute"));
403
+ attributeItem.addActionListener(this);
404
+
405
+ if (Globals.ADVANCED)
406
+ {
407
+ menu.add("-");
272408 linkerItem = menu.add(new MenuItem("Linker"));
273409 linkerItem.addActionListener(this);
274410 templateItem = menu.add(new MenuItem("Template"));
275411 templateItem.addActionListener(this);
276
- attributeItem = menu.add(new MenuItem("Attribute"));
277
- attributeItem.addActionListener(this);
278412 pointflowItem = menu.add(new MenuItem("Point Flow"));
279413 pointflowItem.addActionListener(this);
414
+ }
280415 menu.add("-");
281416 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282417 resetTransformItem.addActionListener(this);
283418 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284419 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
420
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
421
+ resetCentroidXZItem.addActionListener(this);
422
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
423
+ transformGeometryItem.addActionListener(this);
424
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
425
+ transformChildrenItem.addActionListener(this);
287426
288427 oe.menuBar.add(menu = new Menu("Geometry"));
289428 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +433,11 @@
294433 genNormalsCADItem.addActionListener(this);
295434 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296435 genNormalsMESHItem.addActionListener(this);
297
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
436
+ if (Globals.ADVANCED)
437
+ {
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
298439 genNormalsMINEItem.addActionListener(this);
440
+ }
299441 stripifyItem = menu.add(new MenuItem("Stripify"));
300442 stripifyItem.addActionListener(this);
301443 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +459,34 @@
317459 reduce34MeshItem.addActionListener(this);
318460 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319461 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322462 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323463 clipMeshItem.addActionListener(this);
464
+
465
+ if (Globals.ADVANCED)
466
+ {
467
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
468
+ smoothMeshItem.addActionListener(this);
469
+ }
324470
325471 oe.menuBar.add(menu = new Menu("Attributes"));
326472 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327473 clearMaterialsItem.addActionListener(this);
474
+ resetAllItem = menu.add(new MenuItem("Reset All"));
475
+ resetAllItem.addActionListener(this);
476
+ stepAllItem = menu.add(new MenuItem("Step All"));
477
+ stepAllItem.addActionListener(this);
328478 menu.add("-");
329479 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330480 liveleavesItem.addActionListener(this);
331481 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332482 unliveleavesItem.addActionListener(this);
483
+ if (Globals.ADVANCED)
484
+ {
333485 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334486 supportleavesItem.addActionListener(this);
335487 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336488 unsupportleavesItem.addActionListener(this);
489
+ }
337490 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338491 hideleavesItem.addActionListener(this);
339492 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +495,14 @@
342495 markleavesItem.addActionListener(this);
343496 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344497 unmarkleavesItem.addActionListener(this);
498
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
499
+ rewindleavesItem.addActionListener(this);
500
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
501
+ unrewindleavesItem.addActionListener(this);
502
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
503
+ randomleavesItem.addActionListener(this);
504
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
505
+ unrandomleavesItem.addActionListener(this);
345506 menu.add("-");
346507 flipVItem = menu.add(new MenuItem("Flip V"));
347508 flipVItem.addActionListener(this);
....@@ -367,45 +528,56 @@
367528 attachBumpItem.addActionListener(this);
368529 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
369530 pigmentBumpItem.addActionListener(this);
531
+ //embedTexturesItem
370532 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
371533 detachPigmentItem.addActionListener(this);
372534 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
373535 detachBumpItem.addActionListener(this);
536
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
537
+ embedTexturesItem.addActionListener(this);
538
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
539
+ deEmbedTexturesItem.addActionListener(this);
374540 menu.add("-");
375541 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
376542 sortbysizeItem.addActionListener(this);
377543 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378544 sortbynameItem.addActionListener(this);
379545 menu.add("-");
546
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
547
+ shareGeometriesItem.addActionListener(this);
548
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
549
+ mergeGeometriesItem.addActionListener(this);
550
+ if (Globals.ADVANCED)
551
+ {
552
+ // Pretty much the same as duplicate and clone.
380553 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381554 extractGeometriesItem.addActionListener(this);
382555 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383556 cloneGeometriesItem.addActionListener(this);
384
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
- shareGeometriesItem.addActionListener(this);
386
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
- mergeGeometriesItem.addActionListener(this);
557
+ }
388558
389559 oe.menuBar.add(menu = new Menu("Insert"));
390560 buildCreateMenu(menu);
391561
392
-
393
- oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
399
- importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
401
- import3DSItem.addActionListener(this);
402
-
403562 oe.menuBar.add(menu = new Menu("Tools"));
404563 buildToolsMenu(menu);
405564 }
406565
566
+
407567 void SetupUI2(ObjEditor oe)
408568 {
569
+ // June 2019
570
+ if (oe == null)
571
+ {
572
+ //super.SetupUI2(this);
573
+ //return;
574
+ }
575
+
576
+ if (copy != group)
577
+ {
578
+ //super.SetupUI2(this);
579
+ }
580
+
409581 //new Exception().printStackTrace();
410582
411583 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -434,96 +606,230 @@
434606 oe.radioPanel.add(dummyButton);
435607 oe.buttonGroup.add(dummyButton);
436608 */
609
+ cGridBag copyOptionsPanel = new cGridBag();
610
+
611
+ copyOptionsPanel.preferredHeight = 1;
612
+
437613 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438614
439
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
441
- liveCB.addItemListener(this);
442
-
443
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444
- fastCB.setToolTipText("Fast mode");
445
- fastCB.addItemListener(this);
446
-
447
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
448
- trackCB.setToolTipText("Enable tracking");
449
- trackCB.addItemListener(this);
450
-
451
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
615
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ //minButton.setToolTipText("Minimize window");
617
+ //minButton.addActionListener(this);
618
+
619
+ if (Globals.ADVANCED)
620
+ {
621
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ maxButton.setToolTipText("Maximize window");
623
+ maxButton.addActionListener(this);
624
+ }
625
+
626
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
627
+ fullButton.setToolTipText("Full-screen window");
628
+ fullButton.addActionListener(this);
629
+
630
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
452631 screenfitButton.setToolTipText("Screen fit");
453632 screenfitButton.addActionListener(this);
454633
634
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ restoreCameraButton.setToolTipText("Restore viewpoint");
636
+ restoreCameraButton.addActionListener(this);
637
+
638
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ saveButton.setToolTipText("New version");
640
+ saveButton.addActionListener(this);
641
+
642
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643
+ undoButton.setToolTipText("Previous version");
644
+ undoButton.addActionListener(this);
645
+ undoButton.setEnabled(false);
646
+
647
+ cGridBag updown = new cGridBag().setVertical(true);
648
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ restoreButton.setToolTipText("Restore current");
650
+ restoreButton.addActionListener(this);
651
+ restoreButton.setEnabled(false);
652
+
653
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ replaceButton.setToolTipText("Replace current");
655
+ replaceButton.addActionListener(this);
656
+ replaceButton.setEnabled(false);
657
+
658
+ copyOptionsPanel.add(updown);
659
+
660
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ redoButton.setToolTipText("Next version");
662
+ redoButton.addActionListener(this);
663
+ redoButton.setEnabled(false);
664
+
665
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
666
+ liveCB.setToolTipText("Enable animation");
667
+ liveCB.addItemListener(this);
668
+
669
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ oneStepButton.setToolTipText("Animate one step forward");
671
+ oneStepButton.addActionListener(this);
672
+
673
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
674
+ fastCB.setToolTipText("Fast mode");
675
+ fastCB.addItemListener(this);
676
+
677
+ //oe.toolboxPanel.Return();
678
+
679
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
680
+// trackCB.setToolTipText("Enable tracking");
681
+// trackCB.addItemListener(this);
682
+
455683 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
456684 // screenfitpointButton.addActionListener(this);
457
-// oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
459
- snapobjectButton.addActionListener(this);
460
- snapobjectButton.setToolTipText("Snap Object");
461
- oe.aConstraints.gridx += 1;
462685
463
- //aConstraints.gridx = 0;
464
- //aConstraints.gridy += 1;
465
- oe.aConstraints.weighty = 0;
466
- oe.aConstraints.gridwidth = 1;
467
-
468
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
469
- flashSelectionButton.setToolTipText("Show selection");
470
- flashSelectionButton.addActionListener(this);
471
-
472
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
473
-
474
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
475
- twoButton.setToolTipText("Show center view only");
476
- twoButton.addActionListener(this);
477
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
686
+ if (Globals.ADVANCED)
687
+ {
688
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
689
+ snapobjectButton.addActionListener(this);
690
+ snapobjectButton.setToolTipText("Snap Object");
691
+
692
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
478693 fourButton.addActionListener(this);
479
- fourButton.setToolTipText("Show left panel only");
480
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
481
- sixButton.setToolTipText("2-column layout left");
482
- sixButton.addActionListener(this);
483
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
484
- threeButton.setToolTipText("2-column layout right");
694
+ fourButton.setToolTipText("Show control panel only");
695
+ }
696
+
697
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
698
+
699
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ twoButton.setToolTipText("Show 3D view only");
701
+ twoButton.addActionListener(this);
702
+ this.fullscreenLayout = twoButton;
703
+
704
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
705
+ threeButton.setToolTipText("Show controls and 3D view");
485706 threeButton.addActionListener(this);
486
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
487
- sevenButton.setToolTipText("3-column layout");
488
- sevenButton.addActionListener(this);
707
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ sixButton.setToolTipText("Show 3D view and controls");
709
+ sixButton.addActionListener(this);
710
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+// sevenButton.setToolTipText("3-column layout");
712
+// sevenButton.addActionListener(this);
489713 //
490714
491
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
- rootButton.setToolTipText("Edit selection in new tab");
715
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
716
+ rootButton.setToolTipText("Open selection in new tab");
493717 rootButton.addActionListener(this);
494718
495
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
719
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
496720 closeButton.setToolTipText("Close tab");
497721 closeButton.addActionListener(this);
498722 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
499723 //clearButton.addActionListener(this);
500
-
501
- cGridBag commandsPanel = new cGridBag();
724
+
725
+ // INSERT
726
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ gridButton.setToolTipText("Create grid");
728
+ gridButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ boxButton.setToolTipText("Create box");
732
+ boxButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ sphereButton.setToolTipText("Create sphere");
736
+ sphereButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ coneButton.setToolTipText("Create cone");
740
+ coneButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ torusButton.setToolTipText("Create torus");
744
+ torusButton.addActionListener(this);
745
+
746
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
747
+ superButton.setToolTipText("Create superellipsoid");
748
+ superButton.addActionListener(this);
749
+
750
+ if (Globals.ADVANCED)
751
+ {
752
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
753
+ kleinButton.setToolTipText("Create Klein bottle");
754
+ kleinButton.addActionListener(this);
755
+ }
502756
503
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
- editButton.setToolTipText("Edit selection");
757
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
758
+ particlesButton.setToolTipText("Create particle system");
759
+ particlesButton.addActionListener(this);
760
+
761
+ oe.toolboxPanel.Return();
762
+
763
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ groupButton.setToolTipText("Create group");
765
+ groupButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ compositeButton.setToolTipText("Create composite");
769
+ compositeButton.addActionListener(this);
770
+
771
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
772
+ switchButton.setToolTipText("Create item switcher");
773
+ switchButton.addActionListener(this);
774
+
775
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
776
+ loopButton.setToolTipText("Create loop");
777
+ loopButton.addActionListener(this);
778
+
779
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ textureButton.setToolTipText("Create texture");
781
+ textureButton.addActionListener(this);
782
+
783
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
784
+ overlayButton.setToolTipText("Create overlay");
785
+ overlayButton.addActionListener(this);
786
+
787
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
788
+ lightButton.setToolTipText("Create light");
789
+ lightButton.addActionListener(this);
790
+
791
+ for (int i=6; --i>=0;)
792
+ {
793
+ oe.toolboxPanel.Return();
794
+ oe.toolboxPanel.add(new cGridBag());
795
+ oe.toolboxPanel.add(new cGridBag());
796
+ oe.toolboxPanel.add(new cGridBag());
797
+ oe.toolboxPanel.add(new cGridBag());
798
+ oe.toolboxPanel.add(new cGridBag());
799
+ oe.toolboxPanel.add(new cGridBag());
800
+ oe.toolboxPanel.add(new cGridBag());
801
+ }
802
+
803
+ // EDIT panel
804
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ editButton.setToolTipText("Pin selection controls");
505806 editButton.addActionListener(this);
506807
507
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
- uneditButton.setToolTipText("Unedit selection");
808
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ uneditButton.setToolTipText("Remove selection controls");
509810 uneditButton.addActionListener(this);
510811
511
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
812
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
813
+ allParamsButton.setToolTipText("Show all controle");
814
+ allParamsButton.addActionListener(this);
815
+
816
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512817 clearPanelButton.setToolTipText("Clear edit panel");
513818 clearPanelButton.addActionListener(this);
514819
515
- commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
- allParamsButton.setToolTipText("All params??");
517
- allParamsButton.addActionListener(this);
518
-
519
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
820
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520821 unselectButton.setToolTipText("Unselect");
521822 unselectButton.addActionListener(this);
522823
523
- commandsPanel.preferredHeight = 1;
824
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
825
+ flashSelectionButton.setToolTipText("Highlight selection");
826
+ flashSelectionButton.addActionListener(this);
524827
525
- oe.treePanel.add(commandsPanel);
526
- oe.treePanel.Return();
828
+ editCommandsPanel.preferredHeight = 1;
829
+
830
+ SetPinStates(false);
831
+// oe.treePanel.add(commandsPanel);
832
+// oe.treePanel.Return();
527833
528834 // oe.aConstraints.gridx += 1;
529835 // oe.aConstraints.weighty = 0;
....@@ -540,29 +846,17 @@
540846
541847 JScrollPane jSP;
542848 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
543
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
849
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
544850 ResetModel();
545851
546852 oe.treePanel.add(jSPPanel);
547853 oe.treePanel.Return();
548854
549
- cGridBag copyOptionsPanel = new cGridBag();
550
-
551
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
552
- colorCB.setToolTipText("Copy color when dropped");
553
- colorCB.addItemListener(this);
554
-
555
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
556
- materialCB.setToolTipText("Copy material when dropped");
557
- materialCB.addItemListener(this);
558
-
559
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
560
- textureCB.setToolTipText("Copy texture when dropped");
561
- textureCB.addItemListener(this);
562
-
563
- copyOptionsPanel.preferredHeight = 1;
564855 oe.treePanel.add(copyOptionsPanel);
565856 oe.treePanel.Return();
857
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
858
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
859
+ sliderPane.preferredHeight = 1;
566860
567861 // mainPanel.setDividerLocation(0.5); //1.0);
568862 // mainPanel.setResizeWeight(0.5);
....@@ -585,19 +879,49 @@
585879 dgr.addDragGestureListener(this);
586880 }catch(Exception e) {}
587881 */
588
- radio.layout = sevenButton;
882
+ radio.layout = sixButton; // sevenButton;
589883 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
590884 }
591885
592886 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
593887 {
594
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
595
- supportCB.setToolTipText("Enabled rigging");
596
- supportCB.addItemListener(this);
888
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
889
+ colorCB.setToolTipText("Copy color when dropped");
890
+ colorCB.addItemListener(this);
891
+
892
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
893
+ materialCB.setToolTipText("Copy material when dropped");
894
+ materialCB.addItemListener(this);
895
+
896
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
897
+ textureCB.setToolTipText("Copy texture when dropped");
898
+ textureCB.addItemListener(this);
899
+
900
+ panel.Return();
901
+
902
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
903
+ boxCB.setToolTipText("Display bounding boxes");
904
+ boxCB.addItemListener(this);
905
+
906
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
907
+ zoomBoxCB.setToolTipText("Display only for wheel");
908
+ zoomBoxCB.addItemListener(this);
909
+
910
+ if (true) // Globals.ADVANCED)
911
+ {
912
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
913
+// supportCB.setToolTipText("Enable rigging");
914
+// supportCB.addItemListener(this);
915
+
916
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
917
+ freezeCB.setToolTipText("Fast moving camera");
918
+ freezeCB.addItemListener(this);
597919
598920 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
599921 // localCB.addItemListener(this);
600922
923
+ panel.Return();
924
+
601925 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
602926 crowdCB.setToolTipText("Used for crowds");
603927 crowdCB.addItemListener(this);
....@@ -610,18 +934,12 @@
610934 slowCB.setToolTipText("Smooth interpolation");
611935 slowCB.addItemListener(this);
612936
613
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
614
- boxCB.setToolTipText("Display bounding boxes");
615
- boxCB.addItemListener(this);
616
-
617
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
618
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
619
- zoomBoxCB.addItemListener(this);
620
-
621937 // constraints.gridy += 1;
622938 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
623939 // speakerMocapCB.addItemListener(this);
624940
941
+ panel.Return();
942
+
625943 if (false)
626944 {
627945 // handled in scripts
....@@ -636,40 +954,85 @@
636954 //constraints.gridy += 1;
637955 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
638956 smoothfocusCB.addItemListener(this);
957
+ panel.Return();
639958 }
640959
641960 //constraints.gridx += 1;
642961 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
643962 // debugCB.addItemListener(this);
644963
964
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
965
+ trackCB.setToolTipText("Enable tracking target");
966
+ trackCB.addItemListener(this);
967
+
645968 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
969
+ oeilCB.setToolTipText("Move camera when tracking");
646970 oeilCB.addItemListener(this);
647971
972
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
973
+ shadowCB.setToolTipText("When live compute shadows");
974
+ shadowCB.addItemListener(this);
975
+
976
+ panel.Return();
977
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
978
+ toggleTextureCB.setToolTipText("Load textures");
979
+ toggleTextureCB.addItemListener(this);
980
+
981
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
982
+ toggleSwitchCB.setToolTipText("Choose a single item");
983
+ toggleSwitchCB.addItemListener(this);
984
+
985
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
986
+ autokeepCB.setToolTipText("On structure change");
987
+ autokeepCB.addItemListener(this);
988
+
989
+ panel.Return();
990
+ if (Globals.ADVANCED)
991
+ {
648992 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
649993 lookAtCB.setToolTipText("Look-at target");
650994 lookAtCB.addItemListener(this);
995
+ }
996
+
997
+ }
651998
652999 cGridBag fill = new cGridBag();
653
-
6541000 fill.preferredHeight = 200;
1001
+ cGridBag fill2 = new cGridBag();
1002
+ fill2.preferredHeight = 200;
1003
+ cGridBag fill3 = new cGridBag();
1004
+ fill3.preferredHeight = 200;
6551005
6561006 panel.add(fill);
1007
+ panel.add(fill2);
1008
+ panel.add(fill3);
6571009
6581010 }
6591011
6601012 void EditObject(Object3D obj)
6611013 {
6621014 cRadio radioButton = new cRadio(obj.name);
1015
+
1016
+ // June 2019. Patch to avoid bug with transparency.
1017
+ radioButton.hadMaterial = obj.material != null;
1018
+ if (!radioButton.hadMaterial)
1019
+ {
1020
+ obj.material = new cMaterial();
1021
+ }
1022
+
6631023 radioButton.SetObject(obj);
664
- radioButton.layout = sevenButton;
1024
+ radioButton.layout = sixButton; // sevenButton;
6651025 radioButton.SetCamera(cameraView.renderCamera, false);
6661026 radioButton.addActionListener(this);
6671027 radioPanel.add(radioButton);
6681028 buttonGroup.add(radioButton);
6691029 radioButton.doClick();
6701030 }
1031
+
6711032 void SetupViews(ObjEditor oe)
6721033 {
1034
+ theFrame = this;
1035
+
6731036 oe.SetupViews();
6741037
6751038 System.out.println("SetupViews");
....@@ -678,23 +1041,28 @@
6781041 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6791042 }
6801043
681
- JCheckBox liveCB;
682
- JCheckBox supportCB;
683
- JCheckBox localCB;
684
- JCheckBox crowdCB;
685
- JCheckBox smoothCB;
686
- JCheckBox fastCB;
687
- JCheckBox slowCB;
688
- JCheckBox boxCB;
689
- JCheckBox zoomBoxCB;
690
- JCheckBox trackCB;
691
- JCheckBox smoothfocusCB;
1044
+ cToggleButton liveCB;
1045
+ cCheckBox supportCB;
1046
+ cCheckBox localCB;
1047
+ cCheckBox crowdCB;
1048
+ cCheckBox smoothCB;
1049
+ cToggleButton fastCB;
1050
+ cCheckBox slowCB;
1051
+ cCheckBox boxCB;
1052
+ cCheckBox zoomBoxCB;
1053
+ cCheckBox freezeCB;
1054
+ //cToggleButton trackCB;
1055
+ cCheckBox trackCB;
1056
+ cCheckBox smoothfocusCB;
6921057 // JCheckBox speakerMocapCB;
693
- JCheckBox speakerCameraCB;
694
- JCheckBox speakerFocusCB;
695
- JCheckBox debugCB;
696
- JCheckBox oeilCB;
697
- JCheckBox lookAtCB;
1058
+ cCheckBox speakerCameraCB;
1059
+ cCheckBox speakerFocusCB;
1060
+ cCheckBox debugCB;
1061
+
1062
+ cCheckBox oeilCB;
1063
+ cCheckBox shadowCB;
1064
+ cCheckBox autokeepCB;
1065
+ cCheckBox lookAtCB;
6981066
6991067 // static int COLOR = 1;
7001068 // static int MATERIAL = 2;
....@@ -702,9 +1070,9 @@
7021070
7031071 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7041072
705
- JCheckBox colorCB;
706
- JCheckBox materialCB;
707
- JCheckBox textureCB;
1073
+ cCheckBox colorCB;
1074
+ cCheckBox materialCB;
1075
+ cCheckBox textureCB;
7081076
7091077 public void itemStateChanged(ItemEvent e)
7101078 {
....@@ -732,6 +1100,7 @@
7321100 } else if(e.getSource() == liveCB)
7331101 {
7341102 cameraView.ToggleLive();
1103
+ refreshContents(false);
7351104 }
7361105 else if(e.getSource() == supportCB)
7371106 {
....@@ -796,6 +1165,18 @@
7961165 {
7971166 cameraView.ToggleOeil();
7981167 }
1168
+ else if(e.getSource() == shadowCB)
1169
+ {
1170
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1171
+ }
1172
+ else if(e.getSource() == freezeCB)
1173
+ {
1174
+ Globals.FREEZEONMOVE ^= true;
1175
+ }
1176
+ else if(e.getSource() == autokeepCB)
1177
+ {
1178
+ Globals.REPLACEONMAKE ^= true;
1179
+ }
7991180 else if(e.getSource() == lookAtCB)
8001181 {
8011182 cameraView.ToggleLookAt();
....@@ -812,7 +1193,8 @@
8121193
8131194 /**/
8141195 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
815
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1196
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1197
+ TreePath path = objEditor.jTree.getSelectionPath();
8161198 if ((path == null) || (path.getPathCount() <= 1)) {
8171199 // We can't move the root node or an empty selection
8181200 return;
....@@ -875,8 +1257,6 @@
8751257 }
8761258 }
8771259
878
- String string = (String) object;
879
-
8801260 System.out.println("Transfer = " + object + "; drop : " + target);
8811261 // if( object instanceof java.io.File[])
8821262 // {
....@@ -884,7 +1264,11 @@
8841264 // objEditor.DropFile((java.io.File[]) object, true);
8851265 // return;
8861266 // }
887
- if (string.charAt(0) == '/')
1267
+
1268
+ String string = object.toString();
1269
+
1270
+ // File path for Mac and Windows
1271
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8881272 {
8891273 // file(s)
8901274 String[] names = string.split("\n");
....@@ -911,7 +1295,7 @@
9111295
9121296 flashIt = false;
9131297 CameraPane pane = (CameraPane) target;
914
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1298
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9151299 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9161300
9171301 if (group.selection.size() == 1)
....@@ -927,23 +1311,33 @@
9271311
9281312 assert target == objEditor.jTree;
9291313 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1314
+ Object3D destinationLeaf;
9301315 try {
931
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1316
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9321317 } catch (Exception e) {
9331318 System.out.println("destinationPath : " + destinationPath);
9341319 return;
9351320 }
9361321
937
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1322
+ for (int i=group.selection.size(); --i>=0;)
9381323 {
1324
+ Object3D child = (Object3D)group.selection.elementAt(i);
1325
+
1326
+ // Cannot move into itself
1327
+ if (child == destinationLeaf)
1328
+ return;
1329
+ }
1330
+
1331
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1332
+// {
9391333 loadClipboard(true);
9401334 objEditor.jTree.setSelectionPath(destinationPath);
941
- pasteInto(false);
942
- } else {
943
- loadClipboard(false);
944
- objEditor.jTree.setSelectionPath(destinationPath);
945
- pasteInto(false); // true); // ???
946
- }
1335
+ pasteInto(false, false);
1336
+// } else {
1337
+// loadClipboard(false);
1338
+// objEditor.jTree.setSelectionPath(destinationPath);
1339
+// pasteInto(false, false); // true); // ???
1340
+// }
9471341 }
9481342 public void dropActionChanged(DropTargetDragEvent dtde)
9491343 // Called if the user has modified the current drop gesture
....@@ -1048,54 +1442,71 @@
10481442 {
10491443 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10501444 //heightFieldItem.addActionListener(this);
1051
- gridItem = menu.add(new MenuItem("Grid"));
1052
- gridItem.addActionListener(this);
1053
- rectoidItem = menu.add(new MenuItem("Box"));
1054
- rectoidItem.addActionListener(this);
1055
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1056
- ellipsoidItem.addActionListener(this);
1057
- coneItem = menu.add(new MenuItem("Cone"));
1058
- coneItem.addActionListener(this);
1059
- torusItem = menu.add(new MenuItem("Torus"));
1060
- torusItem.addActionListener(this);
1061
- superItem = menu.add(new MenuItem("Superellipsoid"));
1062
- superItem.addActionListener(this);
1445
+// gridItem = menu.add(new MenuItem("Grid"));
1446
+// gridItem.addActionListener(this);
1447
+// rectoidItem = menu.add(new MenuItem("Box"));
1448
+// rectoidItem.addActionListener(this);
1449
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1450
+// ellipsoidItem.addActionListener(this);
1451
+// coneItem = menu.add(new MenuItem("Cone"));
1452
+// coneItem.addActionListener(this);
1453
+// torusItem = menu.add(new MenuItem("Torus"));
1454
+// torusItem.addActionListener(this);
1455
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1456
+// superItem.addActionListener(this);
1457
+
1458
+ cameraItem = menu.add(new MenuItem("Camera"));
1459
+ cameraItem.addActionListener(this);
1460
+
1461
+ if (!Globals.ADVANCED)
1462
+ {
10631463 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10641464 kleinItem.addActionListener(this);
1065
- particleItem = menu.add(new MenuItem("Particle system"));
1066
- particleItem.addActionListener(this);
1465
+ }
1466
+
1467
+// particleItem = menu.add(new MenuItem("Particle system"));
1468
+// particleItem.addActionListener(this);
1469
+ if (Globals.ADVANCED)
1470
+ {
10671471 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10681472 ragdollItem.addActionListener(this);
10691473 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10701474 ragdoll2Item.addActionListener(this);
1475
+ }
10711476 menu.add("-");
1072
- meshItem = menu.add(new MenuItem("Mesh"));
1477
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10731478 meshItem.addActionListener(this);
10741479 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10751480 // meshGroupItem.addActionListener(this);
1481
+ if (Globals.ADVANCED)
1482
+ {
10761483 springItem = menu.add(new MenuItem("Spring"));
10771484 springItem.addActionListener(this);
10781485 flagItem = menu.add(new MenuItem("Flag"));
10791486 flagItem.addActionListener(this);
1080
- bezierItem = menu.add(new MenuItem("Patch"));
1081
- bezierItem.addActionListener(this);
1082
- checkerItem = menu.add(new MenuItem("Checker"));
1083
- checkerItem.addActionListener(this);
10841487 blobItem = menu.add(new MenuItem("Blob"));
10851488 blobItem.addActionListener(this);
10861489 latheItem = menu.add(new MenuItem("Lathe"));
10871490 latheItem.addActionListener(this);
1088
- lightItem = menu.add(new MenuItem("Light"));
1089
- lightItem.addActionListener(this);
1491
+ }
1492
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1493
+ bezierItem.addActionListener(this);
1494
+// overlayItem = menu.add(new MenuItem("Overlay"));
1495
+// overlayItem.addActionListener(this);
1496
+// lightItem = menu.add(new MenuItem("Light"));
1497
+// lightItem.addActionListener(this);
10901498 menu.add("-");
10911499 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10921500 //superLoopItem.addActionListener(this);
1093
- loopItem = menu.add(new MenuItem("Loop"));
1094
- loopItem.addActionListener(this);
1501
+// loopItem = menu.add(new MenuItem("Loop"));
1502
+// loopItem.addActionListener(this);
10951503 doubleItem = menu.add(new MenuItem("Fork"));
10961504 doubleItem.addActionListener(this);
1505
+ if (Globals.ADVANCED)
1506
+ {
10971507 tripleItem = menu.add(new MenuItem("Trident"));
10981508 tripleItem.addActionListener(this);
1509
+ }
10991510 }
11001511
11011512 void buildToolsMenu(Menu menu)
....@@ -1104,29 +1515,34 @@
11041515 animationItem.addItemListener(this);
11051516 animationItem.setState(Globals.ANIMATION);
11061517
1518
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1519
+ archiveItem.addActionListener(this);
1520
+
11071521 menu.add("-");
11081522 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11091523 parseverticesItem.addActionListener(this);
11101524 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11111525 textureFieldItem.addActionListener(this);
1112
- alignItem = menu.add(new MenuItem("Align"));
1526
+ alignItem = menu.add(new MenuItem("Align Objects"));
11131527 alignItem.addActionListener(this);
1114
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1115
- mirrorItem.addActionListener(this);
11161528 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11171529 reduceMorphItem.addActionListener(this);
11181530 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11191531 reduce34MorphItem.addActionListener(this);
1120
-
1121
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1122
- computeAOItem.addActionListener(this);
11231532 menu.add("-");
1124
-
11251533 menu.add(memoryItem = new MenuItem("Memory Usage"));
11261534 memoryItem.addActionListener(this);
1535
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1536
+ computeAOItem.addActionListener(this);
1537
+
1538
+ if (Globals.ADVANCED)
1539
+ {
1540
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1541
+ mirrorItem.addActionListener(this);
1542
+ menu.add("-");
11271543 menu.add(analyzeItem = new MenuItem("Analyze"));
11281544 analyzeItem.addActionListener(this);
1129
- menu.add(dumpItem = new MenuItem("Dump"));
1545
+ menu.add(dumpItem = new MenuItem("Print"));
11301546 dumpItem.addActionListener(this);
11311547 // menu.add(pathItem = new MenuItem("From-to path"));
11321548 // pathItem.addActionListener(this);
....@@ -1144,6 +1560,7 @@
11441560 menu.add("-");
11451561 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11461562 editScriptItem.addActionListener(this);
1563
+ }
11471564 }
11481565
11491566 void ScreenFit()
....@@ -1266,9 +1683,34 @@
12661683 shadow.material = new cMaterial(obj.material);
12671684 shadow.material.diffuse = 0.0001f;
12681685 shadow.material.specular = 0.0001f;
1686
+ //shadow.projectedVertices[1].x = 300;
12691687
12701688 makeSomething(shadow);
12711689 }
1690
+
1691
+ private void ClearUnpinned()
1692
+ {
1693
+ //for (Object3D obj : listUI)
1694
+ for (int i=listUI.size(); --i>=0;)
1695
+ {
1696
+ Object3D obj = listUI.elementAt(i);
1697
+ if (!obj.pinned)
1698
+ {
1699
+ obj.CloseUI();
1700
+ listUI.remove(i);
1701
+ }
1702
+ }
1703
+ }
1704
+
1705
+ private void EditElement(Object3D elem, boolean newWindow)
1706
+ {
1707
+ // if (!(elem instanceof Composite))
1708
+ // newWindow = false;
1709
+ listUI.add(elem);
1710
+ elem.openEditWindow(this, newWindow); //, false);
1711
+ System.out.println("edit : " + elem);
1712
+ elem.editWindow.refreshContents(true); // ? new
1713
+ }
12721714
12731715 /**
12741716 * applyExample
....@@ -1472,9 +1914,9 @@
14721914
14731915 void Overwrite(int mask)
14741916 {
1475
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14761918 {
1477
- Object3D content = GrafreeD.clipboard.get(0);
1919
+ Object3D content = Grafreed.clipboard.get(0);
14781920
14791921 if (content instanceof cGroup && ((cGroup)content).transientlink )
14801922 content = ((cGroup)content).get(0);
....@@ -1513,7 +1955,7 @@
15131955 {
15141956 ScreenFit();
15151957 } else
1516
- if (source == switchItem)
1958
+ if (source == switchViewItem)
15171959 {
15181960 cVector v1 = new cVector();
15191961 cVector v2 = new cVector();
....@@ -1522,11 +1964,11 @@
15221964 objEditor.cameraView.renderCamera.setAim(v2, v1);
15231965 objEditor.cameraView.repaint();
15241966 } else
1525
- if (source == rectoidItem)
1967
+ if (source == rectoidItem || source == boxButton)
15261968 {
15271969 makeSomething(new Box());
15281970 } else
1529
- if (source == particleItem)
1971
+ if (source == particleItem || source == particlesButton)
15301972 {
15311973 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15321974 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1605,27 +2047,27 @@
16052047
16062048 makeSomething(obj);
16072049 } else
1608
- if (source == gridItem)
2050
+ if (source == gridItem || source == gridButton)
16092051 {
16102052 makeSomething(new Grid());
16112053 } else
1612
- if (source == ellipsoidItem)
2054
+ if (source == ellipsoidItem || source == sphereButton)
16132055 {
16142056 makeSomething(new Sphere());
16152057 } else
1616
- if (source == coneItem)
2058
+ if (source == coneItem || source == coneButton)
16172059 {
16182060 makeSomething(new Cone());
16192061 } else
1620
- if (source == torusItem)
2062
+ if (source == torusItem || source == torusButton)
16212063 {
16222064 makeSomething(new Torus());
16232065 } else
1624
- if (source == superItem)
2066
+ if (source == superItem || source == superButton)
16252067 {
16262068 makeSomething(new Superellipsoid());
16272069 } else
1628
- if (source == kleinItem)
2070
+ if (source == kleinItem || source == kleinButton)
16292071 {
16302072 makeSomething(new Klein());
16312073 } else
....@@ -1645,7 +2087,7 @@
16452087 {
16462088 makeSomething(new BezierSurface());
16472089 } else
1648
- if (source == checkerItem)
2090
+ if (source == overlayItem || source == overlayButton)
16492091 {
16502092 /*
16512093 Object3D obj = new BezierSurface(5,8);
....@@ -1693,7 +2135,7 @@
16932135 s.setup();
16942136 makeSomething(s);
16952137 } else
1696
- if (source == lightItem)
2138
+ if (source == lightItem || source == lightButton)
16972139 {
16982140 makeSomething(new Light());
16992141 } else
....@@ -1743,30 +2185,30 @@
17432185
17442186 group(g);
17452187 } else
1746
- if (source == loopItem)
2188
+ if (source == loopItem || source == loopButton)
17472189 {
17482190 Composite csg = new GroupLeaf();
17492191 csg.count = 5;
17502192 group(csg);
1751
- Composite child = new cGroup();
2193
+ Composite child = new cGroup("Branch");
17522194 csg.addChild(child);
17532195 child.addChild(csg);
17542196 } else
17552197 if (source == doubleItem)
17562198 {
1757
- Composite csg = new GroupLeaf();
2199
+ Composite csg = new GroupLeaf("Fork");
17582200 csg.count = 5;
17592201 group(csg);
1760
- Composite child = new cGroup();
2202
+ Composite child = new cGroup("Branch A");
17612203 csg.addChild(child);
17622204 child.addChild(csg);
1763
- child = new cGroup();
2205
+ child = new cGroup("Branch B");
17642206 csg.addChild(child);
17652207 child.addChild(csg);
17662208 } else
17672209 if (source == tripleItem)
17682210 {
1769
- Composite csg = new GroupLeaf();
2211
+ Composite csg = new GroupLeaf("Trident");
17702212 csg.count = 4;
17712213 group(csg);
17722214 Composite child = new cGroup();
....@@ -1778,23 +2220,6 @@
17782220 child = new cGroup();
17792221 csg.addChild(child);
17802222 child.addChild(csg);
1781
- } else
1782
-
1783
- if (source == importGFDItem)
1784
- {
1785
- ImportGFD();
1786
- } else
1787
- if (source == importVRMLX3DItem)
1788
- {
1789
- ImportVRMLX3D();
1790
- } else
1791
- if (source == import3DSItem)
1792
- {
1793
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1794
- } else
1795
- if (source == importOBJItem)
1796
- {
1797
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17982223 } else
17992224 if (source == computeAOItem)
18002225 {
....@@ -1814,7 +2239,7 @@
18142239 if (source == invariantsItem)
18152240 {
18162241 System.out.println("Invariants:");
1817
- GrafreeD.grafreeD.universe.invariants();
2242
+ Grafreed.grafreeD.universe.invariants();
18182243 } else
18192244 if (source == memoryItem)
18202245 {
....@@ -1833,19 +2258,61 @@
18332258 {
18342259 DumpObject();
18352260 } else
2261
+ if (source == minButton)
2262
+ {
2263
+ Minimize();
2264
+ } else
2265
+ if (source == maxButton)
2266
+ {
2267
+ Maximize();
2268
+ } else
2269
+ if (source == fullButton)
2270
+ {
2271
+ ToggleFullScreen();
2272
+ } else
2273
+ if (source == undoButton)
2274
+ {
2275
+ // Go to previous version
2276
+ //if (!Undo())
2277
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2278
+ Undo();
2279
+ } else
2280
+ if (source == restoreButton)
2281
+ {
2282
+ // Restore current version
2283
+ Restore();
2284
+ } else
2285
+ if (source == replaceButton)
2286
+ {
2287
+ // Overwrite current version
2288
+ Replace();
2289
+ } else
2290
+ if (source == redoButton)
2291
+ {
2292
+ // Go to next version
2293
+ Redo();
2294
+ } else
2295
+ if (source == saveButton)
2296
+ {
2297
+ // Save a new version
2298
+ if (!Save(true))
2299
+ java.awt.Toolkit.getDefaultToolkit().beep();
2300
+ } else
2301
+ if (source == oneStepButton)
2302
+ {
2303
+ Globals.ONESTEP = true;
2304
+ cameraView.repaint();
2305
+ } else
18362306 if (source == screenfitButton)
18372307 {
1838
- //Reload(lastConverter, lastFilename, true);
18392308 ScreenFit();
18402309 } else
18412310 if (source == screenfitpointButton)
18422311 {
1843
- //Reload(lastConverter, lastFilename, true);
18442312 ScreenFitPoint();
18452313 } else
18462314 if (source == snapobjectButton)
18472315 {
1848
- //Reload(lastConverter, lastFilename, true);
18492316 SnapObject();
18502317 } else
18512318 // if (event.getSource() == recompileButton)
....@@ -1882,12 +2349,20 @@
18822349 {
18832350 loadClipboard(true);
18842351 } else
2352
+ if (source == undoItem)
2353
+ {
2354
+ Undo();
2355
+ } else
2356
+ if (source == redoItem)
2357
+ {
2358
+ Redo();
2359
+ } else
18852360 if (source == duplicateItem)
18862361 {
1887
- Object3D keep = GrafreeD.clipboard;
2362
+ Object3D keep = Grafreed.clipboard;
18882363 loadClipboard(false);
18892364 paste(false);
1890
- GrafreeD.clipboard = keep;
2365
+ Grafreed.clipboard = keep;
18912366 } else
18922367 if (source == cloneItem)
18932368 {
....@@ -1905,13 +2380,17 @@
19052380 {
19062381 paste(false);
19072382 } else
2383
+ if (source == pasteIntoItem)
2384
+ {
2385
+ pasteInto(true, false);
2386
+ } else
19082387 if (source == pasteLinkItem)
19092388 {
1910
- pasteInto(false);
2389
+ pasteInto(false, false);
19112390 } else
19122391 if (source == pasteCloneItem)
19132392 {
1914
- pasteInto(true);
2393
+ pasteInto(true, true);
19152394 } else
19162395 if (source == pasteExpandItem)
19172396 {
....@@ -2103,9 +2582,9 @@
21032582 // group.selection.get(0).setMasterThis(content); // should be identity
21042583 // refreshContents();
21052584 // }
2106
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2585
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21072586 {
2108
- Object3D content = GrafreeD.clipboard.get(0);
2587
+ Object3D content = Grafreed.clipboard.get(0);
21092588
21102589 if (content instanceof cGroup && ((cGroup)content).transientlink )
21112590 content = ((cGroup)content).get(0);
....@@ -2113,11 +2592,11 @@
21132592 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21142593 for (int i=0; i<group.selection.size(); i++)
21152594 {
2116
- boolean random = CameraPane.RANDOM;
2117
- CameraPane.RANDOM = false; // parse all random nodes
2595
+ boolean random = CameraPane.SWITCH;
2596
+ CameraPane.SWITCH = false; // parse all random nodes
21182597 group.selection.get(i).linkVerticesThis(content);
21192598 // group.selection.get(i).setMasterThis(content); // should be identity
2120
- CameraPane.RANDOM = random;
2599
+ CameraPane.SWITCH = random;
21212600 }
21222601 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21232602 refreshContents();
....@@ -2127,20 +2606,20 @@
21272606 {
21282607 for (int i=0; i<group.selection.size(); i++)
21292608 {
2130
- boolean random = CameraPane.RANDOM;
2131
- CameraPane.RANDOM = false; // parse all random nodes
2609
+ boolean random = CameraPane.SWITCH;
2610
+ CameraPane.SWITCH = false; // parse all random nodes
21322611 group.selection.get(i).linkVerticesThis(null);
2133
- CameraPane.RANDOM = random;
2612
+ CameraPane.SWITCH = random;
21342613 }
21352614
21362615 refreshContents();
21372616 } else
21382617 if (source == relinkverticesItem)
21392618 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
2619
+ boolean random = CameraPane.SWITCH;
2620
+ CameraPane.SWITCH = false; // parse all random nodes
21422621 group.selection.RelinkToSupport();
2143
- CameraPane.RANDOM = random;
2622
+ CameraPane.SWITCH = random;
21442623
21452624 refreshContents();
21462625 } else
....@@ -2155,9 +2634,9 @@
21552634 } else
21562635 if (source == setMasterItem)
21572636 {
2158
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2637
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21592638 {
2160
- Object3D content = GrafreeD.clipboard.get(0);
2639
+ Object3D content = Grafreed.clipboard.get(0);
21612640
21622641 if (content instanceof cGroup && ((cGroup)content).transientlink )
21632642 content = ((cGroup)content).get(0);
....@@ -2170,9 +2649,9 @@
21702649 {
21712650 if (group.selection.size() == 1)
21722651 {
2173
- if (GrafreeD.clipboard.size() == 1)
2652
+ if (Grafreed.clipboard.size() == 1)
21742653 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2654
+ Object3D content = Grafreed.clipboard.get(0);
21762655
21772656 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782657 content = ((cGroup)content).get(0);
....@@ -2189,7 +2668,7 @@
21892668 {
21902669 RevertMeshes();
21912670 } else
2192
- if (source == resetMeshItem)
2671
+ if (source == resetAllItem)
21932672 {
21942673 ResetAll();
21952674 } else
....@@ -2197,7 +2676,7 @@
21972676 {
21982677 StepAll();
21992678 } else
2200
- if (source == clearItem) // || event.getSource() == clearButton)
2679
+ if (source == deleteItem) // || event.getSource() == clearButton)
22012680 {
22022681 //int indices[] = jList.getSelectedIndices();
22032682 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2209,9 +2688,9 @@
22092688 {
22102689 ClearSelection(true);
22112690 } else
2212
- if (source == grabItem)
2691
+ if (source == grabItem || source == groupButton)
22132692 {
2214
- group(new cGroup(), true);
2693
+ group(new cGroup(), false); // true);
22152694 } else
22162695 if (source == hideItem)
22172696 {
....@@ -2229,16 +2708,16 @@
22292708 {
22302709 makeSomething(new Camera());
22312710 } else
2232
- if (source == compositeItem)
2711
+ if (source == compositeItem || source == compositeButton)
22332712 {
22342713 group(new Composite());
22352714 } else
2236
- if (source == randomItem)
2715
+ if (source == switchItem || source == switchButton)
22372716 {
22382717 RandomNode random = new RandomNode();
22392718 group(random);
22402719 if (random.size() > 0)
2241
- random.name = random.get(0).name + "Rnd";
2720
+ random.name = random.get(0).name + "Switch";
22422721 } else
22432722 if (source == physicsItem)
22442723 {
....@@ -2335,7 +2814,7 @@
23352814 {
23362815 group(new cLinker());
23372816 } else
2338
- if (source == textureItem)
2817
+ if (source == textureItem || source == textureButton)
23392818 {
23402819 group(new TextureNode());
23412820 } else
....@@ -2355,17 +2834,30 @@
23552834 {
23562835 CastShadow(2);
23572836 } else
2358
- if (source == ungroupItem)
2837
+ if (source == ungroupItem || source == ungroupButton)
23592838 {
2360
- //ungroup();
2839
+ boolean hasRoot = false;
2840
+
23612841 for (int i=0; i<group.selection.size(); i++)
23622842 {
2363
- Ungroup(group.selection.get(i));
2843
+ if (group.selection.get(i) == group)
2844
+ {
2845
+ hasRoot = true;
2846
+ break;
2847
+ }
23642848 }
23652849
2366
- ClearSelection(false);
2367
-
2368
- refreshContents();
2850
+ if (!hasRoot)
2851
+ {
2852
+ for (int i=0; i<group.selection.size(); i++)
2853
+ {
2854
+ Ungroup(group.selection.get(i));
2855
+ }
2856
+
2857
+ ClearSelection(false);
2858
+
2859
+ refreshContents();
2860
+ }
23692861 } else
23702862 if (source == genUVItem)
23712863 {
....@@ -2377,7 +2869,7 @@
23772869 } else
23782870 if (source == genNormalsMESHItem)
23792871 {
2380
- GenNormals(true); // TODO
2872
+ GenNormalsMESH();
23812873 } else
23822874 if (source == genNormalsORGANItem)
23832875 {
....@@ -2442,6 +2934,22 @@
24422934 if (source == unmarkleavesItem)
24432935 {
24442936 MarkLeaves(false);
2937
+ } else
2938
+ if (source == rewindleavesItem)
2939
+ {
2940
+ RewindLeaves(true);
2941
+ } else
2942
+ if (source == unrewindleavesItem)
2943
+ {
2944
+ RewindLeaves(false);
2945
+ } else
2946
+ if (source == randomleavesItem)
2947
+ {
2948
+ RandomLeaves(true);
2949
+ } else
2950
+ if (source == unrandomleavesItem)
2951
+ {
2952
+ RandomLeaves(false);
24452953 } else
24462954 if (source == flipVItem)
24472955 {
....@@ -2527,9 +3035,13 @@
25273035 {
25283036 SmoothMesh();
25293037 } else
2530
- if (source == transformgeometryItem)
3038
+ if (source == transformGeometryItem)
25313039 {
25323040 TransformGeometry();
3041
+ } else
3042
+ if (source == transformChildrenItem)
3043
+ {
3044
+ TransformChildren();
25333045 } else
25343046 if (source == resetTransformItem)
25353047 {
....@@ -2537,7 +3049,11 @@
25373049 } else
25383050 if (source == resetCentroidItem)
25393051 {
2540
- ResetCentroid();
3052
+ ResetCentroid(true);
3053
+ } else
3054
+ if (source == resetCentroidXZItem)
3055
+ {
3056
+ ResetCentroid(false);
25413057 } else
25423058 if (source == resetParentItem)
25433059 {
....@@ -2642,7 +3158,7 @@
26423158 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26433159 {
26443160 obj = (Object3D)e.nextElement();
2645
- obj.SetBumpTexture(null);
3161
+ obj.ResetBumpTexture();
26463162 }
26473163
26483164 refreshContents();
....@@ -2658,6 +3174,31 @@
26583174
26593175 refreshContents();
26603176 } else
3177
+ if (source == embedTexturesItem)
3178
+ {
3179
+ Object3D obj;
3180
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3181
+ {
3182
+ obj = (Object3D)e.nextElement();
3183
+ obj.EmbedTextures(true);
3184
+ }
3185
+
3186
+ refreshContents();
3187
+ } else
3188
+ if (source == deEmbedTexturesItem)
3189
+ {
3190
+ Object3D obj;
3191
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3192
+ {
3193
+ obj = (Object3D)e.nextElement();
3194
+ obj.EmbedTextures(false);
3195
+ }
3196
+
3197
+ CameraPane.texturepigment.clear();
3198
+ CameraPane.texturebump.clear();
3199
+
3200
+ refreshContents();
3201
+ } else
26613202 if (source == flashSelectionButton)
26623203 {
26633204 CameraPane.flash = true;
....@@ -2669,6 +3210,10 @@
26693210 if (source == twoButton)
26703211 {
26713212 radio.layout = twoButton;
3213
+
3214
+ if (CameraPane.FULLSCREEN)
3215
+ fullscreenLayout = radio.layout;
3216
+
26723217 // bug
26733218 //gridPanel.setDividerLocation(1.0);
26743219 //bigPanel.setDividerLocation(0.0);
....@@ -2701,10 +3246,31 @@
27013246 bigThree.ClearUI();
27023247 bigThree.add(centralPanel);
27033248 bigThree.FlushUI();
3249
+
3250
+ cameraView.requestFocusInWindow();
3251
+
3252
+// refreshContents(true);
3253
+//
3254
+// try
3255
+// {
3256
+// java.awt.Robot bot = new java.awt.Robot();
3257
+// int mask = InputEvent.BUTTON1_MASK;
3258
+// bot.mouseMove(100, 100);
3259
+// bot.mousePress(mask);
3260
+// bot.mouseRelease(mask);
3261
+// }
3262
+// catch (Exception e)
3263
+// {
3264
+//
3265
+// }
3266
+
27043267 } else
27053268 if (source == threeButton)
27063269 {
27073270 radio.layout = threeButton;
3271
+
3272
+ if (CameraPane.FULLSCREEN)
3273
+ fullscreenLayout = radio.layout;
27083274
27093275 // bigThree.remove(scenePanel);
27103276 // bigThree.remove(centralPanel);
....@@ -2734,13 +3300,18 @@
27343300 // centralPanel.setVisible(true);
27353301 // XYZPanel.setVisible(true);
27363302 bigThree.ClearUI();
3303
+ bigThree.add(scenePanel);
27373304 bigThree.add(centralPanel);
2738
- bigThree.add(XYZPanel);
27393305 bigThree.FlushUI();
3306
+
3307
+ cameraView.requestFocusInWindow();
27403308 } else
27413309 if (source == fourButton)
27423310 {
27433311 radio.layout = fourButton;
3312
+
3313
+ if (CameraPane.FULLSCREEN)
3314
+ fullscreenLayout = radio.layout;
27443315
27453316 // bigThree.remove(scenePanel);
27463317 // bigThree.remove(centralPanel);
....@@ -2772,10 +3343,15 @@
27723343 bigThree.ClearUI();
27733344 bigThree.add(scenePanel);
27743345 bigThree.FlushUI();
3346
+
3347
+ cameraView.requestFocusInWindow();
27753348 } else
27763349 if (source == sixButton)
27773350 {
27783351 radio.layout = sixButton;
3352
+
3353
+ if (CameraPane.FULLSCREEN)
3354
+ fullscreenLayout = radio.layout;
27793355
27803356 // bigThree.remove(scenePanel);
27813357 // bigThree.remove(centralPanel);
....@@ -2805,13 +3381,18 @@
28053381 // centralPanel.setVisible(true);
28063382 // XYZPanel.setVisible(false);
28073383 bigThree.ClearUI();
2808
- bigThree.add(scenePanel);
28093384 bigThree.add(centralPanel);
3385
+ bigThree.add(scenePanel);
28103386 bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
28113389 } else
28123390 if (source == sevenButton)
28133391 {
28143392 radio.layout = sevenButton;
3393
+
3394
+ if (CameraPane.FULLSCREEN)
3395
+ fullscreenLayout = radio.layout;
28153396
28163397 // bigThree.remove(scenePanel);
28173398 // bigThree.remove(centralPanel);
....@@ -2845,6 +3426,8 @@
28453426 bigThree.add(centralPanel);
28463427 bigThree.add(XYZPanel);
28473428 bigThree.FlushUI();
3429
+
3430
+ cameraView.requestFocusInWindow();
28483431 } else
28493432 if (source == rootButton)
28503433 {
....@@ -2856,6 +3439,7 @@
28563439 EditObject(obj);
28573440 }
28583441
3442
+ cameraView.requestFocusInWindow();
28593443 refreshContents(true);
28603444 } else
28613445 if (source == closeButton)
....@@ -2865,22 +3449,37 @@
28653449 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28663450 {
28673451 ab = (cRadio)e.nextElement();
2868
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3452
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28693453 {
3454
+ // Patch to avoid bug with transparency.
3455
+ if (!ab.hadMaterial)
3456
+ {
3457
+ ab.object.material = null;
3458
+ }
3459
+
28703460 buttonGroup.remove(ab);
28713461 radioPanel.remove(ab);
28723462
2873
- ab.GetObject().editWindow = null;
3463
+ //ab.GetObject().editWindow = null;
3464
+ ab.GetObject().manipWindow = null;
28743465 // ab.GetObject().objectUI = null; // ?????????
28753466
28763467 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28773468 break;
28783469 }
28793470 }
3471
+
3472
+ cameraView.requestFocusInWindow();
28803473 refreshContents(true);
28813474 } else
28823475 if (source == editItem || source == editButton)
28833476 {
3477
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3478
+ {
3479
+ Object3D child = (Object3D)e.nextElement();
3480
+ child.pinned = true;
3481
+ }
3482
+
28843483 EditSelection(false);
28853484 } else
28863485 if (source == uneditButton)
....@@ -2890,12 +3489,13 @@
28903489 Object3D child = (Object3D)e.nextElement();
28913490 if(child.editWindow != null)
28923491 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3492
+ child.pinned = false;
28933493 child.CloseUI();
28943494 listUI.remove(child);
28953495
2896
- child.editWindow = null; // ???????????
3496
+ //child.editWindow = null; // ???????????
28973497 }
2898
- objEditor.ctrlPanel.validate();
3498
+ objEditor.ctrlPanel.FlushUI();
28993499 //objEditor.jTree.clearSelection();
29003500 //objEditor.ResetSliders();
29013501 refreshContents(true);
....@@ -2906,6 +3506,7 @@
29063506 //copy.ClearUI();
29073507 for (Object3D obj : listUI)
29083508 {
3509
+ obj.pinned = false;
29093510 obj.CloseUI();
29103511 }
29113512 listUI.clear();
....@@ -2915,7 +3516,7 @@
29153516 {
29163517 assert(copy == group);
29173518
2918
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3519
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29193520
29203521 for (Object3D obj : listUI)
29213522 {
....@@ -2964,6 +3565,9 @@
29643565 }
29653566
29663567 copy = group;
3568
+
3569
+ SetUndoStates();
3570
+
29673571 //Globals.theRenderer.object = group;
29683572 if(!useclient)
29693573 {
....@@ -2979,20 +3583,46 @@
29793583 frontView.object = group;
29803584 sideView.object = group;
29813585 }
2982
- group.editWindow = this;
3586
+
3587
+// fix "+" issue
3588
+ //group.editWindow = this;
3589
+ group.manipWindow = this;
3590
+
29833591 /*
29843592 currentLayout = radio.layout;
29853593 if (currentLayout == null)
29863594 currentLayout = sevenButton;
29873595 */
29883596 radio.layout.doClick();
3597
+
3598
+ ClearUnpinned();
3599
+ //Grafreed.Assert(group != null);
3600
+ //Grafreed.Assert(group.selection != null);
3601
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3602
+ if (group.selection == null || group.selection.size() == 1)
3603
+ EditSelection(false);
29893604 keepparent = group.parent;
29903605 // PARENT = NULL or not???
29913606 //group.parent = null; // ROOT
29923607 //group.attributes = -1;
29933608 ResetModel();
3609
+
3610
+ cameraView.requestFocusInWindow();
29943611 refreshContents(true);
2995
- }
3612
+ } else if (event.getSource() == editCameraItem)
3613
+ {
3614
+ cameraView.ProtectCamera();
3615
+ cameraView.repaint();
3616
+ return;
3617
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3618
+ {
3619
+ cameraView.RevertCamera();
3620
+ cameraView.repaint();
3621
+ return;
3622
+ // } else if (event.getSource() == textureButton)
3623
+ // {
3624
+ // return; // true;
3625
+ }
29963626 else
29973627 {
29983628 //return super.action(event, arg);
....@@ -3001,7 +3631,6 @@
30013631 }
30023632
30033633 boolean useclient = false;
3004
- cRadio radio;
30053634
30063635 void ToggleRoot()
30073636 {
....@@ -3053,6 +3682,28 @@
30533682 refreshContents();
30543683 }
30553684
3685
+ void TransformChildren()
3686
+ {
3687
+ Object3D obj;
3688
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3689
+ {
3690
+ obj = (Object3D)e.nextElement();
3691
+ obj.KeepTextureMatrices();
3692
+ obj.TransformChildren();
3693
+ obj.RestoreTextureMatrices();
3694
+
3695
+// if (obj.parent == null)
3696
+// {
3697
+// System.out.println("NULL PARENT!");
3698
+// new Exception().printStackTrace();
3699
+// }
3700
+// else
3701
+// TouchTransform(obj);
3702
+// //obj.parent.Touch();
3703
+ }
3704
+
3705
+ refreshContents();
3706
+ }
30563707
30573708 void ResetTransform()
30583709 {
....@@ -3165,7 +3816,7 @@
31653816 refreshContents();
31663817 }
31673818
3168
- void ResetCentroid()
3819
+ void ResetCentroid(boolean full)
31693820 {
31703821 Object3D obj;
31713822 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3180,12 +3831,16 @@
31803831 LA.matIdentity(Object3D.mat);
31813832 obj.getBounds(minima, maxima, false);
31823833 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3183
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3834
+ if (full)
3835
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31843836 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31853837 obj.TransformMesh(Object3D.mat);
3838
+
31863839 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3187
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3840
+ if (full)
3841
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31883842 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3843
+
31893844 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31903845 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31913846 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3214,7 +3869,8 @@
32143869
32153870 int size = obj.MemorySize();
32163871
3217
- System.err.println((size/1024) + " KB is the size of " + obj);
3872
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3873
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32183874 }
32193875 }
32203876 catch (Exception e)
....@@ -3251,9 +3907,9 @@
32513907 obj = (Object3D)e.nextElement();
32523908
32533909 System.out.println("Object is: " + obj);
3254
- GrafreeD.AnalyzeObject(obj);
3910
+ Grafreed.AnalyzeObject(obj);
32553911 System.out.println("Boundary rep: " + obj.bRep);
3256
- GrafreeD.AnalyzeObject(obj.bRep);
3912
+ Grafreed.AnalyzeObject(obj.bRep);
32573913
32583914 // System.err.println((size/1024) + " KB is the size of " + obj);
32593915 }
....@@ -3295,6 +3951,13 @@
32953951 void GenNormals(boolean crease)
32963952 {
32973953 group.GenNormalsS(crease);
3954
+
3955
+ refreshContents();
3956
+ }
3957
+
3958
+ void GenNormalsMESH()
3959
+ {
3960
+ group.GenNormalsMeshS();
32983961
32993962 refreshContents();
33003963 }
....@@ -3467,8 +4130,8 @@
34674130
34684131 void ParseVertices()
34694132 {
3470
- boolean epsequal = GrafreeD.epsequal;
3471
- GrafreeD.epsequal = true;
4133
+ boolean epsequal = Grafreed.epsequal;
4134
+ Grafreed.epsequal = true;
34724135
34734136 for (int i=0; i<group.selection.size(); i++)
34744137 {
....@@ -3493,7 +4156,7 @@
34934156 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34944157 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34954158
3496
- g.add(GrafreeD.clipboard);
4159
+ g.add(Grafreed.clipboard);
34974160
34984161 buffer.add(g);
34994162 }
....@@ -3508,7 +4171,7 @@
35084171 makeSomething(buffer, i==group.selection.size()-1);
35094172 }
35104173
3511
- GrafreeD.epsequal = epsequal;
4174
+ Grafreed.epsequal = epsequal;
35124175
35134176 refreshContents();
35144177 }
....@@ -3526,7 +4189,16 @@
35264189 String pigment = Object3D.GetPigment(tex);
35274190 //String bump = Object3D.GetBump(tex);
35284191
3529
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4192
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4193
+
4194
+ try
4195
+ {
4196
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4197
+ }
4198
+ catch (Exception e)
4199
+ {
4200
+ System.err.println("FAIL: " + node);
4201
+ }
35304202
35314203 double s = v.s;
35324204
....@@ -3614,11 +4286,11 @@
36144286
36154287 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36164288
3617
- boolean random = CameraPane.RANDOM;
3618
- CameraPane.RANDOM = false; // parse all random nodes
4289
+ boolean random = CameraPane.SWITCH;
4290
+ CameraPane.SWITCH = false; // parse all random nodes
36194291 lowres.linkVerticesThis(null);
36204292 lowres.linkVerticesThis(sn);
3621
- CameraPane.RANDOM = random;
4293
+ CameraPane.SWITCH = random;
36224294
36234295 System.err.flush();
36244296
....@@ -3658,7 +4330,7 @@
36584330 return;
36594331
36604332 Object3D poses = group.selection.get(0);
3661
- Object3D ref = GrafreeD.clipboard.get(0);
4333
+ Object3D ref = Grafreed.clipboard.get(0);
36624334
36634335 Object3D newgroup = new Object3D("Po:" + poses.name);
36644336
....@@ -3852,9 +4524,9 @@
38524524
38534525 void ClipMesh()
38544526 {
3855
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4527
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38564528 {
3857
- Object3D content = GrafreeD.clipboard.get(0);
4529
+ Object3D content = Grafreed.clipboard.get(0);
38584530
38594531 if (content instanceof cGroup && ((cGroup)content).transientlink )
38604532 content = ((cGroup)content).get(0);
....@@ -3863,7 +4535,7 @@
38634535 // {
38644536 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38654537 // }
3866
- group.selection.ClipMesh(GrafreeD.clipboard);
4538
+ group.selection.ClipMesh(Grafreed.clipboard);
38674539 }
38684540 // group.selection.ClipMesh(GrafreeD.clipboard);
38694541 System.out.println("DONE.");
....@@ -3910,6 +4582,18 @@
39104582 void MarkLeaves(boolean hide)
39114583 {
39124584 group.selection.MarkLeaves(hide);
4585
+ refreshContents();
4586
+ }
4587
+
4588
+ void RewindLeaves(boolean hide)
4589
+ {
4590
+ group.selection.RewindLeaves(hide);
4591
+ refreshContents();
4592
+ }
4593
+
4594
+ void RandomLeaves(boolean hide)
4595
+ {
4596
+ group.selection.RandomLeaves(hide);
39134597 refreshContents();
39144598 }
39154599
....@@ -3984,28 +4668,25 @@
39844668 // }
39854669 // }
39864670
3987
- static boolean allparams = true;
3988
-
3989
- static Vector<Object3D> listUI = new Vector<Object3D>();
3990
-
39914671 void EditSelection(boolean newWindow)
39924672 {
4673
+ if (group.selection == null)
4674
+ {
4675
+ EditElement(group, newWindow); // ? new
4676
+ return;
4677
+ }
4678
+
39934679 // aConstraints.gridy = 0;
39944680 for (int i=0; i<group.selection.size(); i++)
39954681 {
39964682 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39974683 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3998
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4684
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39994685
40004686 Object3D elem = (Object3D)group.selection.elementAt(i);
4001
- if(elem != group)
4687
+ if(elem != group || !newWindow)
40024688 {
4003
- // if (!(elem instanceof Composite))
4004
- // newWindow = false;
4005
- listUI.add(elem);
4006
- elem.openEditWindow(this, newWindow); //, false);
4007
- System.out.println("edit : " + elem);
4008
- elem.editWindow.refreshContents(true); // ? new
4689
+ EditElement(elem, newWindow); // ? new
40094690 }
40104691 }
40114692 }
....@@ -4080,7 +4761,8 @@
40804761 //new Exception().printStackTrace();
40814762
40824763 freezemodel = true;
4083
-
4764
+ ClearUnpinned();
4765
+
40844766 /**/
40854767 //switch (event.id)
40864768 {
....@@ -4088,7 +4770,6 @@
40884770 //case 702: // Event.LIST_DESELECT
40894771 group.deselectAll();
40904772 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4091
- objEditor.ClearInfo(); // .GetMaterial());
40924773 if (tps != null)
40934774 {
40944775 for (int i=0; i < tps.length; i++)
....@@ -4097,10 +4778,8 @@
40974778
40984779 //if (child.parent != null)
40994780 //child.parent.addSelectee(child);
4781
+ objEditor.SetMaterial(child);
41004782 group.addSelectee(child);
4101
- objEditor.SetMaterial(child); // .GetMaterial());
4102
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4103
- System.err.println("info : " + child.GetPath());
41044783 }
41054784 }
41064785 // else
....@@ -4110,20 +4789,28 @@
41104789 // System.err.println("info : " + group.GetPath());
41114790 // }
41124791
4113
- objEditor.SetText(); // jan 2014
4114
-
4115
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4792
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41164793 CameraPane.flash = true;
41174794
4118
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4795
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41194796 // a camera
41204797 {
4121
- CameraPane.camerachangeframe = 0; // don't refuse it
4122
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4798
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4799
+ {
4800
+ CameraPane.camerachangeframe = 0; // don't refuse it
4801
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4802
+ }
41234803 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41244804 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41254805 }
41264806
4807
+ if (tps != null && tps.length == 1)
4808
+ {
4809
+ EditSelection(false);
4810
+ }
4811
+
4812
+ SetPinStates(tps != null && tps.length > 0);
4813
+
41274814 refreshContents();
41284815 //return true;
41294816 }
....@@ -4132,6 +4819,35 @@
41324819
41334820 freezemodel = false;
41344821 }
4822
+
4823
+ void SetPinStates(boolean enabled)
4824
+ {
4825
+ editButton.setEnabled(enabled);
4826
+ uneditButton.setEnabled(enabled);
4827
+ unselectButton.setEnabled(enabled);
4828
+ flashSelectionButton.setEnabled(enabled);
4829
+ }
4830
+
4831
+ void refreshContents(boolean cp)
4832
+ {
4833
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4834
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4835
+ {
4836
+ objEditor.ClearInfo(); // .GetMaterial());
4837
+
4838
+ for (int i=0; i < group.selection.Size(); i++)
4839
+ {
4840
+ Object3D child = (Object3D) group.selection.get(i);
4841
+
4842
+ objEditor.AddInfo(child, this, true);
4843
+ System.err.println("info : " + child.GetPath());
4844
+ }
4845
+
4846
+ objEditor.SetText(); // jan 2014
4847
+ }
4848
+
4849
+ super.refreshContents(cp);
4850
+ }
41354851
41364852 void linkSomething(Object3D thing)
41374853 {
....@@ -4203,16 +4919,19 @@
42034919 {
42044920 if (group.selection.isEmpty())
42054921 return;
4206
- GrafreeD.clipboardIsTempGroup = false;
4922
+
4923
+ Grafreed.clipboardIsTempGroup = false;
42074924 Composite tGroup = null;
42084925 if (group.selection.size() > 0) // 1)
42094926 {
42104927 tGroup = new cGroup();
4211
- GrafreeD.clipboardIsTempGroup = true;
4928
+ Grafreed.clipboardIsTempGroup = true;
42124929 }
42134930
42144931 if (cut)
42154932 {
4933
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4934
+// Save();
42164935 //int indices[] = jList.getSelectedIndices();
42174936 //for (int i = indices.length - 1; i >= 0; i--)
42184937 //jList.remove(indices[i]);
....@@ -4248,16 +4967,16 @@
42484967 //System.out.println("cut " + child);
42494968 //System.out.println("parent = " + child.parent);
42504969 // tmp.addChild(child);
4251
- if (GrafreeD.clipboardIsTempGroup)
4970
+ if (Grafreed.clipboardIsTempGroup)
42524971 tGroup.add/*Child*/(tmp);
42534972 else
4254
- GrafreeD.clipboard = tmp;
4973
+ Grafreed.clipboard = tmp;
42554974 }
42564975 else
4257
- if (GrafreeD.clipboardIsTempGroup)
4976
+ if (Grafreed.clipboardIsTempGroup)
42584977 tGroup.add/*Child*/(child);
42594978 else
4260
- GrafreeD.clipboard = child;
4979
+ Grafreed.clipboard = child;
42614980 }
42624981
42634982 //ResetModel();
....@@ -4289,21 +5008,23 @@
42895008 //System.out.println("cut " + elem);
42905009 //System.out.println("parent = " + elem.parent);
42915010 // tmp.addChild(elem);
4292
- if (GrafreeD.clipboardIsTempGroup)
5011
+ if (Grafreed.clipboardIsTempGroup)
42935012 tGroup.add/*Child*/(tmp);
42945013 else
4295
- GrafreeD.clipboard = tmp;
5014
+ Grafreed.clipboard = tmp;
42965015 }
42975016 else
4298
- if (GrafreeD.clipboardIsTempGroup)
5017
+ if (Grafreed.clipboardIsTempGroup)
42995018 tGroup.add/*Child*/(child);
43005019 else
4301
- GrafreeD.clipboard = child;
5020
+ Grafreed.clipboard = child;
43025021 }
43035022
43045023 }
4305
- if (GrafreeD.clipboardIsTempGroup)
4306
- GrafreeD.clipboard = tGroup;
5024
+
5025
+ if (Grafreed.clipboardIsTempGroup)
5026
+ Grafreed.clipboard = tGroup;
5027
+
43075028 if (cut)
43085029 {
43095030 ResetModel();
....@@ -4313,11 +5034,15 @@
43135034
43145035 void paste(boolean expand)
43155036 {
5037
+ if (Globals.REPLACEONMAKE)
5038
+ Save();
5039
+ boolean keep = Globals.REPLACEONMAKE;
5040
+ Globals.REPLACEONMAKE = false;
43165041 // if (GrafreeD.clipboard == null)
43175042 // return;
43185043 boolean first = true;
43195044
4320
- if (GrafreeD.clipboardIsTempGroup)
5045
+ if (Grafreed.clipboardIsTempGroup)
43215046 {
43225047 Composite temp;
43235048
....@@ -4328,7 +5053,7 @@
43285053 temp = (Composite)Applet3D.clipboard.deepCopy();
43295054 */
43305055 Object3D elem;
4331
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5056
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43325057 {
43335058 Object3D child = (Object3D)e.nextElement();
43345059
....@@ -4362,21 +5087,22 @@
43625087 //Object3D cb = Applet3D.clipboard;
43635088 //temp.addChild(cb);
43645089 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4365
- assert(GrafreeD.clipboard.parent == null);
4366
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4367
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4368
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4369
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5090
+ assert(Grafreed.clipboard.parent == null);
5091
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5092
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5093
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5094
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43705095 else
4371
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4372
- GrafreeD.clipboard.get(0).parent = keepparent;
5096
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5097
+ Grafreed.clipboard.get(0).parent = keepparent;
43735098 }
43745099
5100
+ Globals.REPLACEONMAKE = keep;
43755101 ResetModel();
43765102 refreshContents();
43775103 }
43785104
4379
- void pasteInto(boolean copyit)
5105
+ void pasteInto(boolean copyit, boolean clone)
43805106 {
43815107 // if (GrafreeD.clipboard == null)
43825108 // return;
....@@ -4405,15 +5131,22 @@
44055131 if (copyit)
44065132 {
44075133 // paste(false);
4408
- CloneClipboard(false); // sept 2014
5134
+ if (clone)
5135
+ {
5136
+ CloneClipboard(false); // sept 2014
5137
+ }
5138
+ else
5139
+ {
5140
+ paste(false);
5141
+ }
44095142 }
44105143 else
44115144 {
44125145 boolean first = true;
44135146
4414
- if (GrafreeD.clipboardIsTempGroup)
5147
+ if (Grafreed.clipboardIsTempGroup)
44155148 {
4416
- Composite temp = (Composite)GrafreeD.clipboard;
5149
+ Composite temp = (Composite)Grafreed.clipboard;
44175150 Object3D copy;
44185151 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44195152 {
....@@ -4423,7 +5156,7 @@
44235156 }
44245157 } else
44255158 {
4426
- linkSomething(GrafreeD.clipboard); //.get(0));
5159
+ linkSomething(Grafreed.clipboard); //.get(0));
44275160 }
44285161 }
44295162 }
....@@ -4500,6 +5233,10 @@
45005233
45015234 void group(Object3D csg, boolean grab)
45025235 {
5236
+ if (Globals.REPLACEONMAKE)
5237
+ Save();
5238
+ boolean keep = Globals.REPLACEONMAKE;
5239
+ Globals.REPLACEONMAKE = false;
45035240 if (//false) // why??
45045241 !group.selection.isEmpty())
45055242 {
....@@ -4613,10 +5350,15 @@
46135350 //node.add(csg);
46145351 //makeSomething(node);
46155352 makeSomething(csg);
5353
+ Globals.REPLACEONMAKE = keep;
46165354 }
46175355
46185356 void Ungroup(Object3D g)
46195357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
46205362 if (g instanceof HiddenObject)
46215363 {
46225364 HiddenObject h = (HiddenObject) g;
....@@ -4633,6 +5375,7 @@
46335375 objEditor.makeSomething(g.get(i), false);
46345376 }
46355377 }
5378
+ Globals.REPLACEONMAKE = keep;
46365379 }
46375380
46385381 void ungroup()
....@@ -4828,21 +5571,6 @@
48285571 }
48295572 */
48305573
4831
- void ImportGFD()
4832
- {
4833
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4834
- browser.show();
4835
- String filename = browser.getFile();
4836
- if (filename != null && filename.length() > 0)
4837
- {
4838
- String fullname = browser.getDirectory() + filename;
4839
-
4840
- //Object3D readobj =
4841
- objEditor.ReadGFD(fullname, objEditor);
4842
- //makeSomething(readobj);
4843
- }
4844
- }
4845
-
48465574 /*
48475575 public void Callback(Object obj)
48485576 {
....@@ -4866,26 +5594,9 @@
48665594 }
48675595 */
48685596
4869
- void ImportVRMLX3D()
4870
- {
4871
- if (GrafreeD.standAlone)
4872
- {
4873
- /**/
4874
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4875
- browser.show();
4876
- String filename = browser.getFile();
4877
- if (filename != null && filename.length() > 0)
4878
- {
4879
- String fullname = browser.getDirectory() + filename;
4880
- LoadVRMLX3D(fullname);
4881
- }
4882
- /**/
4883
- }
4884
- }
4885
-
48865597 String GetFile(String dialogName)
48875598 {
4888
- if (GrafreeD.standAlone)
5599
+ if (Grafreed.standAlone)
48895600 {
48905601 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48915602 browser.show();
....@@ -4949,10 +5660,33 @@
49495660 cButton flashSelectionButton;
49505661 cButton editButton;
49515662 cButton uneditButton;
5663
+ JCheckBox allParamsButton;
49525664 cButton clearpanelButton;
4953
- cButton allParamsButton;
49545665 cButton unselectButton;
49555666
5667
+ cButton restoreCameraButton;
5668
+
5669
+ cButton saveButton;
5670
+ cButton oneStepButton;
5671
+
5672
+ cButton groupButton;
5673
+ cButton ungroupButton;
5674
+ cButton compositeButton;
5675
+ cButton switchButton;
5676
+ cButton loopButton;
5677
+ cButton textureButton;
5678
+
5679
+ cButton gridButton;
5680
+ cButton boxButton;
5681
+ cButton sphereButton;
5682
+ cButton coneButton;
5683
+ cButton torusButton;
5684
+ cButton superButton;
5685
+ cButton kleinButton;
5686
+ cButton particlesButton;
5687
+ cButton overlayButton;
5688
+ cButton lightButton;
5689
+
49565690 cButton screenfitButton;
49575691 cButton screenfitpointButton;
49585692 cButton snapobjectButton;
....@@ -4964,14 +5698,6 @@
49645698
49655699 cButton setsupportButton;
49665700
4967
- cButton twoButton;
4968
- cButton sixButton;
4969
- cButton threeButton;
4970
- cButton sevenButton;
4971
- cButton fourButton; // full panel
4972
- cButton oneButton; // full XYZ
4973
- //cButton currentLayout;
4974
-
49755701 //
49765702 //Composite
49775703 Object3D // to do !!
....@@ -4981,9 +5707,11 @@
49815707 //JTree jTree;
49825708 private MenuItem lookAtItem;
49835709 private MenuItem lookFromItem;
4984
- private MenuItem switchItem;
5710
+ private MenuItem switchViewItem;
49855711 private MenuItem cutItem;
4986
- private MenuItem duplicateItem;
5712
+ private MenuItem undoItem;
5713
+ private MenuItem redoItem;
5714
+ private JMenuItem duplicateItem;
49875715 private MenuItem cloneItem;
49885716 private MenuItem cloneSupportItem;
49895717 private MenuItem overwriteGeoItem;
....@@ -4996,7 +5724,7 @@
49965724 private MenuItem linkverticesItem;
49975725 private MenuItem relinkverticesItem;
49985726 private MenuItem setMasterItem;
4999
- private MenuItem resetMeshItem;
5727
+ private MenuItem resetAllItem;
50005728 private MenuItem stepAllItem;
50015729 private MenuItem revertMeshItem;
50025730 private MenuItem poseMeshItem;
....@@ -5007,10 +5735,11 @@
50075735 private MenuItem mergeGeometriesItem;
50085736 private MenuItem copyItem;
50095737 private MenuItem pasteItem;
5738
+ private MenuItem pasteIntoItem;
50105739 private MenuItem pasteLinkItem;
50115740 private MenuItem pasteCloneItem;
50125741 private MenuItem pasteExpandItem;
5013
- private MenuItem clearItem;
5742
+ private MenuItem deleteItem;
50145743 private MenuItem clearAllItem;
50155744 private MenuItem genUVItem;
50165745 private MenuItem genNormalsMESHItem;
....@@ -5045,6 +5774,10 @@
50455774 private MenuItem showleavesItem;
50465775 private MenuItem markleavesItem;
50475776 private MenuItem unmarkleavesItem;
5777
+ private MenuItem rewindleavesItem;
5778
+ private MenuItem unrewindleavesItem;
5779
+ private MenuItem randomleavesItem;
5780
+ private MenuItem unrandomleavesItem;
50485781
50495782 private MenuItem flipVItem;
50505783 private MenuItem unflipVItem;
....@@ -5056,15 +5789,17 @@
50565789 private MenuItem panoTexturesItem;
50575790
50585791 private MenuItem resetCentroidItem;
5059
- private MenuItem transformgeometryItem;
5792
+ private MenuItem resetCentroidXZItem;
50605793 private MenuItem resetTransformItem;
5794
+ private MenuItem transformGeometryItem;
5795
+ private MenuItem transformChildrenItem;
50615796 private MenuItem hideItem;
50625797 private MenuItem grabItem;
50635798 private MenuItem backItem;
50645799 private MenuItem frontItem;
50655800 private MenuItem cameraItem;
50665801 private MenuItem compositeItem;
5067
- private MenuItem randomItem;
5802
+ private MenuItem switchItem;
50685803 private MenuItem physicsItem;
50695804 private MenuItem frameselectorItem;
50705805 private MenuItem scriptNodeItem;
....@@ -5088,6 +5823,8 @@
50885823 private MenuItem attachBumpItem;
50895824 private MenuItem detachBumpItem;
50905825 private MenuItem pigmentBumpItem;
5826
+ private MenuItem embedTexturesItem;
5827
+ private MenuItem deEmbedTexturesItem;
50915828
50925829 private MenuItem particleItem;
50935830 private MenuItem ragdollItem;
....@@ -5104,7 +5841,7 @@
51045841 private MenuItem blobItem;
51055842 private MenuItem latheItem;
51065843 private MenuItem bezierItem;
5107
- private MenuItem checkerItem;
5844
+ private MenuItem overlayItem;
51085845 private MenuItem meshItem;
51095846 // private MenuItem meshGroupItem;
51105847 private MenuItem springItem;
....@@ -5126,11 +5863,6 @@
51265863 private MenuItem doubleItem;
51275864 private MenuItem tripleItem;
51285865
5129
- private MenuItem importGFDItem;
5130
- private MenuItem importVRMLX3DItem;
5131
- private MenuItem import3DSItem;
5132
- private MenuItem importOBJItem;
5133
-
51345866 private MenuItem computeAOItem;
51355867 private MenuItem recompileItem;
51365868 private MenuItem editScriptItem;
....@@ -5140,4 +5872,8 @@
51405872 private MenuItem analyzeItem;
51415873 private MenuItem dumpItem;
51425874 //boolean freezemodel = false;
5875
+
5876
+ Menu cameraMenu;
5877
+ MenuItem editCameraItem;
5878
+ MenuItem restoreCameraItem;
51435879 }