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,92 +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(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444
- trackCB.setToolTipText("Enable tracking");
445
- trackCB.addItemListener(this);
446
-
447
- 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);
448631 screenfitButton.setToolTipText("Screen fit");
449632 screenfitButton.addActionListener(this);
450633
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
+
451683 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452684 // screenfitpointButton.addActionListener(this);
453
-// oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
455
- snapobjectButton.addActionListener(this);
456
- snapobjectButton.setToolTipText("Snap Object");
457
- oe.aConstraints.gridx += 1;
458685
459
- //aConstraints.gridx = 0;
460
- //aConstraints.gridy += 1;
461
- oe.aConstraints.weighty = 0;
462
- oe.aConstraints.gridwidth = 1;
463
-
464
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
465
- flashSelectionButton.setToolTipText("Show selection");
466
- flashSelectionButton.addActionListener(this);
467
-
468
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469
-
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471
- twoButton.setToolTipText("Show center view only");
472
- twoButton.addActionListener(this);
473
- 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);
474693 fourButton.addActionListener(this);
475
- fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
477
- sixButton.setToolTipText("2-column layout left");
478
- sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
480
- 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");
481706 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
483
- sevenButton.setToolTipText("3-column layout");
484
- 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);
485713 //
486714
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
- 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");
489717 rootButton.addActionListener(this);
490718
491
- 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);
492720 closeButton.setToolTipText("Close tab");
493721 closeButton.addActionListener(this);
494722 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
495723 //clearButton.addActionListener(this);
496
-
497
- 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
+ }
498756
499
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
500
- 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");
501806 editButton.addActionListener(this);
502807
503
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
- uneditButton.setToolTipText("Unedit selection");
808
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ uneditButton.setToolTipText("Remove selection controls");
505810 uneditButton.addActionListener(this);
506811
507
- 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);
508817 clearPanelButton.setToolTipText("Clear edit panel");
509818 clearPanelButton.addActionListener(this);
510819
511
- commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
- allParamsButton.setToolTipText("All params??");
513
- allParamsButton.addActionListener(this);
514
-
515
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
820
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516821 unselectButton.setToolTipText("Unselect");
517822 unselectButton.addActionListener(this);
518823
519
- 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);
520827
521
- oe.treePanel.add(commandsPanel);
522
- oe.treePanel.Return();
828
+ editCommandsPanel.preferredHeight = 1;
829
+
830
+ SetPinStates(false);
831
+// oe.treePanel.add(commandsPanel);
832
+// oe.treePanel.Return();
523833
524834 // oe.aConstraints.gridx += 1;
525835 // oe.aConstraints.weighty = 0;
....@@ -536,29 +846,17 @@
536846
537847 JScrollPane jSP;
538848 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
539
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
849
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
540850 ResetModel();
541851
542852 oe.treePanel.add(jSPPanel);
543853 oe.treePanel.Return();
544854
545
- cGridBag copyOptionsPanel = new cGridBag();
546
-
547
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
548
- colorCB.setToolTipText("Copy color when dropped");
549
- colorCB.addItemListener(this);
550
-
551
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
552
- materialCB.setToolTipText("Copy material when dropped");
553
- materialCB.addItemListener(this);
554
-
555
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
556
- textureCB.setToolTipText("Copy texture when dropped");
557
- textureCB.addItemListener(this);
558
-
559
- copyOptionsPanel.preferredHeight = 1;
560855 oe.treePanel.add(copyOptionsPanel);
561856 oe.treePanel.Return();
857
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
858
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
859
+ sliderPane.preferredHeight = 1;
562860
563861 // mainPanel.setDividerLocation(0.5); //1.0);
564862 // mainPanel.setResizeWeight(0.5);
....@@ -581,53 +879,67 @@
581879 dgr.addDragGestureListener(this);
582880 }catch(Exception e) {}
583881 */
584
- radio.layout = sevenButton;
882
+ radio.layout = sixButton; // sevenButton;
585883 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
586884 }
587885
588886 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589887 {
590
- //constraints.gridx = 0;
591
- //constraints.gridy = 0;
592
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
593
- fastCB.setToolTipText("Fast mode");
594
- fastCB.addItemListener(this);
595
- //constraints.gridy += 1;
596
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
597
- supportCB.setToolTipText("Enabled rigging");
598
- 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);
599891
600
- // constraints.gridy += 1;
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);
919
+
601920 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
602921 // localCB.addItemListener(this);
603922
604
- //constraints.gridy += 1;
923
+ panel.Return();
924
+
605925 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
606926 crowdCB.setToolTipText("Used for crowds");
607927 crowdCB.addItemListener(this);
608928
609
- //constraints.gridy += 1;
610929 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
611930 smoothCB.setToolTipText("Snapping delay");
612931 smoothCB.addItemListener(this);
613932
614
- //constraints.gridy += 1;
615933 panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
616934 slowCB.setToolTipText("Smooth interpolation");
617935 slowCB.addItemListener(this);
618
- //constraints.gridy += 1;
619
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620
- boxCB.setToolTipText("Display bounding boxes");
621
- boxCB.addItemListener(this);
622
- //constraints.gridy += 1;
623
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625
- zoomBoxCB.addItemListener(this);
626
-
936
+
627937 // constraints.gridy += 1;
628938 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
629939 // speakerMocapCB.addItemListener(this);
630940
941
+ panel.Return();
942
+
631943 if (false)
632944 {
633945 // handled in scripts
....@@ -642,42 +954,85 @@
642954 //constraints.gridy += 1;
643955 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
644956 smoothfocusCB.addItemListener(this);
957
+ panel.Return();
645958 }
646959
647960 //constraints.gridx += 1;
648961 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649962 // debugCB.addItemListener(this);
650963
651
- //constraints.gridy += 1;
964
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
965
+ trackCB.setToolTipText("Enable tracking target");
966
+ trackCB.addItemListener(this);
967
+
652968 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
969
+ oeilCB.setToolTipText("Move camera when tracking");
653970 oeilCB.addItemListener(this);
654971
655
- //constraints.gridy += 1;
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
+ {
656992 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657993 lookAtCB.setToolTipText("Look-at target");
658994 lookAtCB.addItemListener(this);
995
+ }
996
+
997
+ }
659998
660999 cGridBag fill = new cGridBag();
661
-
6621000 fill.preferredHeight = 200;
1001
+ cGridBag fill2 = new cGridBag();
1002
+ fill2.preferredHeight = 200;
1003
+ cGridBag fill3 = new cGridBag();
1004
+ fill3.preferredHeight = 200;
6631005
6641006 panel.add(fill);
1007
+ panel.add(fill2);
1008
+ panel.add(fill3);
6651009
6661010 }
6671011
6681012 void EditObject(Object3D obj)
6691013 {
6701014 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
+
6711023 radioButton.SetObject(obj);
672
- radioButton.layout = sevenButton;
1024
+ radioButton.layout = sixButton; // sevenButton;
6731025 radioButton.SetCamera(cameraView.renderCamera, false);
6741026 radioButton.addActionListener(this);
6751027 radioPanel.add(radioButton);
6761028 buttonGroup.add(radioButton);
6771029 radioButton.doClick();
6781030 }
1031
+
6791032 void SetupViews(ObjEditor oe)
6801033 {
1034
+ theFrame = this;
1035
+
6811036 oe.SetupViews();
6821037
6831038 System.out.println("SetupViews");
....@@ -686,23 +1041,28 @@
6861041 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6871042 }
6881043
689
- JCheckBox liveCB;
690
- JCheckBox supportCB;
691
- JCheckBox localCB;
692
- JCheckBox crowdCB;
693
- JCheckBox smoothCB;
694
- JCheckBox fastCB;
695
- JCheckBox slowCB;
696
- JCheckBox boxCB;
697
- JCheckBox zoomBoxCB;
698
- JCheckBox trackCB;
699
- 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;
7001057 // JCheckBox speakerMocapCB;
701
- JCheckBox speakerCameraCB;
702
- JCheckBox speakerFocusCB;
703
- JCheckBox debugCB;
704
- JCheckBox oeilCB;
705
- JCheckBox lookAtCB;
1058
+ cCheckBox speakerCameraCB;
1059
+ cCheckBox speakerFocusCB;
1060
+ cCheckBox debugCB;
1061
+
1062
+ cCheckBox oeilCB;
1063
+ cCheckBox shadowCB;
1064
+ cCheckBox autokeepCB;
1065
+ cCheckBox lookAtCB;
7061066
7071067 // static int COLOR = 1;
7081068 // static int MATERIAL = 2;
....@@ -710,9 +1070,9 @@
7101070
7111071 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7121072
713
- JCheckBox colorCB;
714
- JCheckBox materialCB;
715
- JCheckBox textureCB;
1073
+ cCheckBox colorCB;
1074
+ cCheckBox materialCB;
1075
+ cCheckBox textureCB;
7161076
7171077 public void itemStateChanged(ItemEvent e)
7181078 {
....@@ -740,6 +1100,7 @@
7401100 } else if(e.getSource() == liveCB)
7411101 {
7421102 cameraView.ToggleLive();
1103
+ refreshContents(false);
7431104 }
7441105 else if(e.getSource() == supportCB)
7451106 {
....@@ -804,6 +1165,18 @@
8041165 {
8051166 cameraView.ToggleOeil();
8061167 }
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
+ }
8071180 else if(e.getSource() == lookAtCB)
8081181 {
8091182 cameraView.ToggleLookAt();
....@@ -820,7 +1193,8 @@
8201193
8211194 /**/
8221195 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
823
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1196
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1197
+ TreePath path = objEditor.jTree.getSelectionPath();
8241198 if ((path == null) || (path.getPathCount() <= 1)) {
8251199 // We can't move the root node or an empty selection
8261200 return;
....@@ -883,8 +1257,6 @@
8831257 }
8841258 }
8851259
886
- String string = (String) object;
887
-
8881260 System.out.println("Transfer = " + object + "; drop : " + target);
8891261 // if( object instanceof java.io.File[])
8901262 // {
....@@ -892,7 +1264,11 @@
8921264 // objEditor.DropFile((java.io.File[]) object, true);
8931265 // return;
8941266 // }
895
- 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) == ':')
8961272 {
8971273 // file(s)
8981274 String[] names = string.split("\n");
....@@ -919,7 +1295,7 @@
9191295
9201296 flashIt = false;
9211297 CameraPane pane = (CameraPane) target;
922
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1298
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9231299 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9241300
9251301 if (group.selection.size() == 1)
....@@ -935,23 +1311,33 @@
9351311
9361312 assert target == objEditor.jTree;
9371313 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1314
+ Object3D destinationLeaf;
9381315 try {
939
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1316
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9401317 } catch (Exception e) {
9411318 System.out.println("destinationPath : " + destinationPath);
9421319 return;
9431320 }
9441321
945
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1322
+ for (int i=group.selection.size(); --i>=0;)
9461323 {
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
+// {
9471333 loadClipboard(true);
9481334 objEditor.jTree.setSelectionPath(destinationPath);
949
- pasteInto(false);
950
- } else {
951
- loadClipboard(false);
952
- objEditor.jTree.setSelectionPath(destinationPath);
953
- pasteInto(false); // true); // ???
954
- }
1335
+ pasteInto(false, false);
1336
+// } else {
1337
+// loadClipboard(false);
1338
+// objEditor.jTree.setSelectionPath(destinationPath);
1339
+// pasteInto(false, false); // true); // ???
1340
+// }
9551341 }
9561342 public void dropActionChanged(DropTargetDragEvent dtde)
9571343 // Called if the user has modified the current drop gesture
....@@ -1056,85 +1442,107 @@
10561442 {
10571443 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10581444 //heightFieldItem.addActionListener(this);
1059
- gridItem = menu.add(new MenuItem("Grid"));
1060
- gridItem.addActionListener(this);
1061
- rectoidItem = menu.add(new MenuItem("Box"));
1062
- rectoidItem.addActionListener(this);
1063
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1064
- ellipsoidItem.addActionListener(this);
1065
- coneItem = menu.add(new MenuItem("Cone"));
1066
- coneItem.addActionListener(this);
1067
- torusItem = menu.add(new MenuItem("Torus"));
1068
- torusItem.addActionListener(this);
1069
- superItem = menu.add(new MenuItem("Superellipsoid"));
1070
- 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
+ {
10711463 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10721464 kleinItem.addActionListener(this);
1073
- particleItem = menu.add(new MenuItem("Particle system"));
1074
- particleItem.addActionListener(this);
1465
+ }
1466
+
1467
+// particleItem = menu.add(new MenuItem("Particle system"));
1468
+// particleItem.addActionListener(this);
1469
+ if (Globals.ADVANCED)
1470
+ {
10751471 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10761472 ragdollItem.addActionListener(this);
10771473 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10781474 ragdoll2Item.addActionListener(this);
1475
+ }
10791476 menu.add("-");
1080
- meshItem = menu.add(new MenuItem("Mesh"));
1477
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10811478 meshItem.addActionListener(this);
10821479 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10831480 // meshGroupItem.addActionListener(this);
1481
+ if (Globals.ADVANCED)
1482
+ {
10841483 springItem = menu.add(new MenuItem("Spring"));
10851484 springItem.addActionListener(this);
10861485 flagItem = menu.add(new MenuItem("Flag"));
10871486 flagItem.addActionListener(this);
1088
- bezierItem = menu.add(new MenuItem("Patch"));
1089
- bezierItem.addActionListener(this);
1090
- checkerItem = menu.add(new MenuItem("Checker"));
1091
- checkerItem.addActionListener(this);
10921487 blobItem = menu.add(new MenuItem("Blob"));
10931488 blobItem.addActionListener(this);
10941489 latheItem = menu.add(new MenuItem("Lathe"));
10951490 latheItem.addActionListener(this);
1096
- lightItem = menu.add(new MenuItem("Light"));
1097
- 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);
10981498 menu.add("-");
10991499 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11001500 //superLoopItem.addActionListener(this);
1101
- loopItem = menu.add(new MenuItem("Loop"));
1102
- loopItem.addActionListener(this);
1501
+// loopItem = menu.add(new MenuItem("Loop"));
1502
+// loopItem.addActionListener(this);
11031503 doubleItem = menu.add(new MenuItem("Fork"));
11041504 doubleItem.addActionListener(this);
1505
+ if (Globals.ADVANCED)
1506
+ {
11051507 tripleItem = menu.add(new MenuItem("Trident"));
11061508 tripleItem.addActionListener(this);
1509
+ }
11071510 }
11081511
11091512 void buildToolsMenu(Menu menu)
11101513 {
11111514 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11121515 animationItem.addItemListener(this);
1113
- animationItem.setState(CameraPane.ANIMATION);
1516
+ animationItem.setState(Globals.ANIMATION);
1517
+
1518
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1519
+ archiveItem.addActionListener(this);
11141520
11151521 menu.add("-");
11161522 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11171523 parseverticesItem.addActionListener(this);
11181524 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11191525 textureFieldItem.addActionListener(this);
1120
- alignItem = menu.add(new MenuItem("Align"));
1526
+ alignItem = menu.add(new MenuItem("Align Objects"));
11211527 alignItem.addActionListener(this);
1122
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1123
- mirrorItem.addActionListener(this);
11241528 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11251529 reduceMorphItem.addActionListener(this);
11261530 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11271531 reduce34MorphItem.addActionListener(this);
1128
-
1129
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1130
- computeAOItem.addActionListener(this);
11311532 menu.add("-");
1132
-
11331533 menu.add(memoryItem = new MenuItem("Memory Usage"));
11341534 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("-");
11351543 menu.add(analyzeItem = new MenuItem("Analyze"));
11361544 analyzeItem.addActionListener(this);
1137
- menu.add(dumpItem = new MenuItem("Dump"));
1545
+ menu.add(dumpItem = new MenuItem("Print"));
11381546 dumpItem.addActionListener(this);
11391547 // menu.add(pathItem = new MenuItem("From-to path"));
11401548 // pathItem.addActionListener(this);
....@@ -1152,6 +1560,7 @@
11521560 menu.add("-");
11531561 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11541562 editScriptItem.addActionListener(this);
1563
+ }
11551564 }
11561565
11571566 void ScreenFit()
....@@ -1274,9 +1683,34 @@
12741683 shadow.material = new cMaterial(obj.material);
12751684 shadow.material.diffuse = 0.0001f;
12761685 shadow.material.specular = 0.0001f;
1686
+ //shadow.projectedVertices[1].x = 300;
12771687
12781688 makeSomething(shadow);
12791689 }
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
+ }
12801714
12811715 /**
12821716 * applyExample
....@@ -1480,9 +1914,9 @@
14801914
14811915 void Overwrite(int mask)
14821916 {
1483
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14841918 {
1485
- Object3D content = GrafreeD.clipboard.get(0);
1919
+ Object3D content = Grafreed.clipboard.get(0);
14861920
14871921 if (content instanceof cGroup && ((cGroup)content).transientlink )
14881922 content = ((cGroup)content).get(0);
....@@ -1521,7 +1955,7 @@
15211955 {
15221956 ScreenFit();
15231957 } else
1524
- if (source == switchItem)
1958
+ if (source == switchViewItem)
15251959 {
15261960 cVector v1 = new cVector();
15271961 cVector v2 = new cVector();
....@@ -1530,11 +1964,11 @@
15301964 objEditor.cameraView.renderCamera.setAim(v2, v1);
15311965 objEditor.cameraView.repaint();
15321966 } else
1533
- if (source == rectoidItem)
1967
+ if (source == rectoidItem || source == boxButton)
15341968 {
15351969 makeSomething(new Box());
15361970 } else
1537
- if (source == particleItem)
1971
+ if (source == particleItem || source == particlesButton)
15381972 {
15391973 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15401974 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1613,27 +2047,27 @@
16132047
16142048 makeSomething(obj);
16152049 } else
1616
- if (source == gridItem)
2050
+ if (source == gridItem || source == gridButton)
16172051 {
16182052 makeSomething(new Grid());
16192053 } else
1620
- if (source == ellipsoidItem)
2054
+ if (source == ellipsoidItem || source == sphereButton)
16212055 {
16222056 makeSomething(new Sphere());
16232057 } else
1624
- if (source == coneItem)
2058
+ if (source == coneItem || source == coneButton)
16252059 {
16262060 makeSomething(new Cone());
16272061 } else
1628
- if (source == torusItem)
2062
+ if (source == torusItem || source == torusButton)
16292063 {
16302064 makeSomething(new Torus());
16312065 } else
1632
- if (source == superItem)
2066
+ if (source == superItem || source == superButton)
16332067 {
16342068 makeSomething(new Superellipsoid());
16352069 } else
1636
- if (source == kleinItem)
2070
+ if (source == kleinItem || source == kleinButton)
16372071 {
16382072 makeSomething(new Klein());
16392073 } else
....@@ -1653,7 +2087,7 @@
16532087 {
16542088 makeSomething(new BezierSurface());
16552089 } else
1656
- if (source == checkerItem)
2090
+ if (source == overlayItem || source == overlayButton)
16572091 {
16582092 /*
16592093 Object3D obj = new BezierSurface(5,8);
....@@ -1701,7 +2135,7 @@
17012135 s.setup();
17022136 makeSomething(s);
17032137 } else
1704
- if (source == lightItem)
2138
+ if (source == lightItem || source == lightButton)
17052139 {
17062140 makeSomething(new Light());
17072141 } else
....@@ -1751,30 +2185,30 @@
17512185
17522186 group(g);
17532187 } else
1754
- if (source == loopItem)
2188
+ if (source == loopItem || source == loopButton)
17552189 {
17562190 Composite csg = new GroupLeaf();
17572191 csg.count = 5;
17582192 group(csg);
1759
- Composite child = new cGroup();
2193
+ Composite child = new cGroup("Branch");
17602194 csg.addChild(child);
17612195 child.addChild(csg);
17622196 } else
17632197 if (source == doubleItem)
17642198 {
1765
- Composite csg = new GroupLeaf();
2199
+ Composite csg = new GroupLeaf("Fork");
17662200 csg.count = 5;
17672201 group(csg);
1768
- Composite child = new cGroup();
2202
+ Composite child = new cGroup("Branch A");
17692203 csg.addChild(child);
17702204 child.addChild(csg);
1771
- child = new cGroup();
2205
+ child = new cGroup("Branch B");
17722206 csg.addChild(child);
17732207 child.addChild(csg);
17742208 } else
17752209 if (source == tripleItem)
17762210 {
1777
- Composite csg = new GroupLeaf();
2211
+ Composite csg = new GroupLeaf("Trident");
17782212 csg.count = 4;
17792213 group(csg);
17802214 Composite child = new cGroup();
....@@ -1786,23 +2220,6 @@
17862220 child = new cGroup();
17872221 csg.addChild(child);
17882222 child.addChild(csg);
1789
- } else
1790
-
1791
- if (source == importGFDItem)
1792
- {
1793
- ImportGFD();
1794
- } else
1795
- if (source == importVRMLX3DItem)
1796
- {
1797
- ImportVRMLX3D();
1798
- } else
1799
- if (source == import3DSItem)
1800
- {
1801
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1802
- } else
1803
- if (source == importOBJItem)
1804
- {
1805
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18062223 } else
18072224 if (source == computeAOItem)
18082225 {
....@@ -1822,7 +2239,7 @@
18222239 if (source == invariantsItem)
18232240 {
18242241 System.out.println("Invariants:");
1825
- GrafreeD.grafreeD.universe.invariants();
2242
+ Grafreed.grafreeD.universe.invariants();
18262243 } else
18272244 if (source == memoryItem)
18282245 {
....@@ -1841,19 +2258,61 @@
18412258 {
18422259 DumpObject();
18432260 } 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
18442306 if (source == screenfitButton)
18452307 {
1846
- //Reload(lastConverter, lastFilename, true);
18472308 ScreenFit();
18482309 } else
18492310 if (source == screenfitpointButton)
18502311 {
1851
- //Reload(lastConverter, lastFilename, true);
18522312 ScreenFitPoint();
18532313 } else
18542314 if (source == snapobjectButton)
18552315 {
1856
- //Reload(lastConverter, lastFilename, true);
18572316 SnapObject();
18582317 } else
18592318 // if (event.getSource() == recompileButton)
....@@ -1890,12 +2349,20 @@
18902349 {
18912350 loadClipboard(true);
18922351 } else
2352
+ if (source == undoItem)
2353
+ {
2354
+ Undo();
2355
+ } else
2356
+ if (source == redoItem)
2357
+ {
2358
+ Redo();
2359
+ } else
18932360 if (source == duplicateItem)
18942361 {
1895
- Object3D keep = GrafreeD.clipboard;
2362
+ Object3D keep = Grafreed.clipboard;
18962363 loadClipboard(false);
18972364 paste(false);
1898
- GrafreeD.clipboard = keep;
2365
+ Grafreed.clipboard = keep;
18992366 } else
19002367 if (source == cloneItem)
19012368 {
....@@ -1913,13 +2380,17 @@
19132380 {
19142381 paste(false);
19152382 } else
2383
+ if (source == pasteIntoItem)
2384
+ {
2385
+ pasteInto(true, false);
2386
+ } else
19162387 if (source == pasteLinkItem)
19172388 {
1918
- pasteInto(false);
2389
+ pasteInto(false, false);
19192390 } else
19202391 if (source == pasteCloneItem)
19212392 {
1922
- pasteInto(true);
2393
+ pasteInto(true, true);
19232394 } else
19242395 if (source == pasteExpandItem)
19252396 {
....@@ -2111,9 +2582,9 @@
21112582 // group.selection.get(0).setMasterThis(content); // should be identity
21122583 // refreshContents();
21132584 // }
2114
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2585
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21152586 {
2116
- Object3D content = GrafreeD.clipboard.get(0);
2587
+ Object3D content = Grafreed.clipboard.get(0);
21172588
21182589 if (content instanceof cGroup && ((cGroup)content).transientlink )
21192590 content = ((cGroup)content).get(0);
....@@ -2121,11 +2592,11 @@
21212592 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21222593 for (int i=0; i<group.selection.size(); i++)
21232594 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2595
+ boolean random = CameraPane.SWITCH;
2596
+ CameraPane.SWITCH = false; // parse all random nodes
21262597 group.selection.get(i).linkVerticesThis(content);
21272598 // group.selection.get(i).setMasterThis(content); // should be identity
2128
- CameraPane.RANDOM = random;
2599
+ CameraPane.SWITCH = random;
21292600 }
21302601 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21312602 refreshContents();
....@@ -2135,20 +2606,20 @@
21352606 {
21362607 for (int i=0; i<group.selection.size(); i++)
21372608 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2609
+ boolean random = CameraPane.SWITCH;
2610
+ CameraPane.SWITCH = false; // parse all random nodes
21402611 group.selection.get(i).linkVerticesThis(null);
2141
- CameraPane.RANDOM = random;
2612
+ CameraPane.SWITCH = random;
21422613 }
21432614
21442615 refreshContents();
21452616 } else
21462617 if (source == relinkverticesItem)
21472618 {
2148
- boolean random = CameraPane.RANDOM;
2149
- CameraPane.RANDOM = false; // parse all random nodes
2619
+ boolean random = CameraPane.SWITCH;
2620
+ CameraPane.SWITCH = false; // parse all random nodes
21502621 group.selection.RelinkToSupport();
2151
- CameraPane.RANDOM = random;
2622
+ CameraPane.SWITCH = random;
21522623
21532624 refreshContents();
21542625 } else
....@@ -2163,9 +2634,9 @@
21632634 } else
21642635 if (source == setMasterItem)
21652636 {
2166
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2637
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21672638 {
2168
- Object3D content = GrafreeD.clipboard.get(0);
2639
+ Object3D content = Grafreed.clipboard.get(0);
21692640
21702641 if (content instanceof cGroup && ((cGroup)content).transientlink )
21712642 content = ((cGroup)content).get(0);
....@@ -2178,9 +2649,9 @@
21782649 {
21792650 if (group.selection.size() == 1)
21802651 {
2181
- if (GrafreeD.clipboard.size() == 1)
2652
+ if (Grafreed.clipboard.size() == 1)
21822653 {
2183
- Object3D content = GrafreeD.clipboard.get(0);
2654
+ Object3D content = Grafreed.clipboard.get(0);
21842655
21852656 if (content instanceof cGroup && ((cGroup)content).transientlink )
21862657 content = ((cGroup)content).get(0);
....@@ -2197,7 +2668,7 @@
21972668 {
21982669 RevertMeshes();
21992670 } else
2200
- if (source == resetMeshItem)
2671
+ if (source == resetAllItem)
22012672 {
22022673 ResetAll();
22032674 } else
....@@ -2205,7 +2676,7 @@
22052676 {
22062677 StepAll();
22072678 } else
2208
- if (source == clearItem) // || event.getSource() == clearButton)
2679
+ if (source == deleteItem) // || event.getSource() == clearButton)
22092680 {
22102681 //int indices[] = jList.getSelectedIndices();
22112682 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,9 +2688,9 @@
22172688 {
22182689 ClearSelection(true);
22192690 } else
2220
- if (source == grabItem)
2691
+ if (source == grabItem || source == groupButton)
22212692 {
2222
- group(new cGroup(), true);
2693
+ group(new cGroup(), false); // true);
22232694 } else
22242695 if (source == hideItem)
22252696 {
....@@ -2237,16 +2708,16 @@
22372708 {
22382709 makeSomething(new Camera());
22392710 } else
2240
- if (source == compositeItem)
2711
+ if (source == compositeItem || source == compositeButton)
22412712 {
22422713 group(new Composite());
22432714 } else
2244
- if (source == randomItem)
2715
+ if (source == switchItem || source == switchButton)
22452716 {
22462717 RandomNode random = new RandomNode();
22472718 group(random);
22482719 if (random.size() > 0)
2249
- random.name = random.get(0).name + "Rnd";
2720
+ random.name = random.get(0).name + "Switch";
22502721 } else
22512722 if (source == physicsItem)
22522723 {
....@@ -2343,7 +2814,7 @@
23432814 {
23442815 group(new cLinker());
23452816 } else
2346
- if (source == textureItem)
2817
+ if (source == textureItem || source == textureButton)
23472818 {
23482819 group(new TextureNode());
23492820 } else
....@@ -2363,17 +2834,30 @@
23632834 {
23642835 CastShadow(2);
23652836 } else
2366
- if (source == ungroupItem)
2837
+ if (source == ungroupItem || source == ungroupButton)
23672838 {
2368
- //ungroup();
2839
+ boolean hasRoot = false;
2840
+
23692841 for (int i=0; i<group.selection.size(); i++)
23702842 {
2371
- Ungroup(group.selection.get(i));
2843
+ if (group.selection.get(i) == group)
2844
+ {
2845
+ hasRoot = true;
2846
+ break;
2847
+ }
23722848 }
23732849
2374
- ClearSelection(false);
2375
-
2376
- 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
+ }
23772861 } else
23782862 if (source == genUVItem)
23792863 {
....@@ -2385,7 +2869,7 @@
23852869 } else
23862870 if (source == genNormalsMESHItem)
23872871 {
2388
- GenNormals(true); // TODO
2872
+ GenNormalsMESH();
23892873 } else
23902874 if (source == genNormalsORGANItem)
23912875 {
....@@ -2450,6 +2934,22 @@
24502934 if (source == unmarkleavesItem)
24512935 {
24522936 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);
24532953 } else
24542954 if (source == flipVItem)
24552955 {
....@@ -2535,9 +3035,13 @@
25353035 {
25363036 SmoothMesh();
25373037 } else
2538
- if (source == transformgeometryItem)
3038
+ if (source == transformGeometryItem)
25393039 {
25403040 TransformGeometry();
3041
+ } else
3042
+ if (source == transformChildrenItem)
3043
+ {
3044
+ TransformChildren();
25413045 } else
25423046 if (source == resetTransformItem)
25433047 {
....@@ -2545,7 +3049,11 @@
25453049 } else
25463050 if (source == resetCentroidItem)
25473051 {
2548
- ResetCentroid();
3052
+ ResetCentroid(true);
3053
+ } else
3054
+ if (source == resetCentroidXZItem)
3055
+ {
3056
+ ResetCentroid(false);
25493057 } else
25503058 if (source == resetParentItem)
25513059 {
....@@ -2650,7 +3158,7 @@
26503158 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26513159 {
26523160 obj = (Object3D)e.nextElement();
2653
- obj.SetBumpTexture(null);
3161
+ obj.ResetBumpTexture();
26543162 }
26553163
26563164 refreshContents();
....@@ -2666,6 +3174,31 @@
26663174
26673175 refreshContents();
26683176 } 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
26693202 if (source == flashSelectionButton)
26703203 {
26713204 CameraPane.flash = true;
....@@ -2677,6 +3210,10 @@
26773210 if (source == twoButton)
26783211 {
26793212 radio.layout = twoButton;
3213
+
3214
+ if (CameraPane.FULLSCREEN)
3215
+ fullscreenLayout = radio.layout;
3216
+
26803217 // bug
26813218 //gridPanel.setDividerLocation(1.0);
26823219 //bigPanel.setDividerLocation(0.0);
....@@ -2709,10 +3246,31 @@
27093246 bigThree.ClearUI();
27103247 bigThree.add(centralPanel);
27113248 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
+
27123267 } else
27133268 if (source == threeButton)
27143269 {
27153270 radio.layout = threeButton;
3271
+
3272
+ if (CameraPane.FULLSCREEN)
3273
+ fullscreenLayout = radio.layout;
27163274
27173275 // bigThree.remove(scenePanel);
27183276 // bigThree.remove(centralPanel);
....@@ -2742,13 +3300,18 @@
27423300 // centralPanel.setVisible(true);
27433301 // XYZPanel.setVisible(true);
27443302 bigThree.ClearUI();
3303
+ bigThree.add(scenePanel);
27453304 bigThree.add(centralPanel);
2746
- bigThree.add(XYZPanel);
27473305 bigThree.FlushUI();
3306
+
3307
+ cameraView.requestFocusInWindow();
27483308 } else
27493309 if (source == fourButton)
27503310 {
27513311 radio.layout = fourButton;
3312
+
3313
+ if (CameraPane.FULLSCREEN)
3314
+ fullscreenLayout = radio.layout;
27523315
27533316 // bigThree.remove(scenePanel);
27543317 // bigThree.remove(centralPanel);
....@@ -2780,10 +3343,15 @@
27803343 bigThree.ClearUI();
27813344 bigThree.add(scenePanel);
27823345 bigThree.FlushUI();
3346
+
3347
+ cameraView.requestFocusInWindow();
27833348 } else
27843349 if (source == sixButton)
27853350 {
27863351 radio.layout = sixButton;
3352
+
3353
+ if (CameraPane.FULLSCREEN)
3354
+ fullscreenLayout = radio.layout;
27873355
27883356 // bigThree.remove(scenePanel);
27893357 // bigThree.remove(centralPanel);
....@@ -2813,13 +3381,18 @@
28133381 // centralPanel.setVisible(true);
28143382 // XYZPanel.setVisible(false);
28153383 bigThree.ClearUI();
2816
- bigThree.add(scenePanel);
28173384 bigThree.add(centralPanel);
3385
+ bigThree.add(scenePanel);
28183386 bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
28193389 } else
28203390 if (source == sevenButton)
28213391 {
28223392 radio.layout = sevenButton;
3393
+
3394
+ if (CameraPane.FULLSCREEN)
3395
+ fullscreenLayout = radio.layout;
28233396
28243397 // bigThree.remove(scenePanel);
28253398 // bigThree.remove(centralPanel);
....@@ -2853,6 +3426,8 @@
28533426 bigThree.add(centralPanel);
28543427 bigThree.add(XYZPanel);
28553428 bigThree.FlushUI();
3429
+
3430
+ cameraView.requestFocusInWindow();
28563431 } else
28573432 if (source == rootButton)
28583433 {
....@@ -2864,6 +3439,7 @@
28643439 EditObject(obj);
28653440 }
28663441
3442
+ cameraView.requestFocusInWindow();
28673443 refreshContents(true);
28683444 } else
28693445 if (source == closeButton)
....@@ -2873,22 +3449,37 @@
28733449 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28743450 {
28753451 ab = (cRadio)e.nextElement();
2876
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3452
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28773453 {
3454
+ // Patch to avoid bug with transparency.
3455
+ if (!ab.hadMaterial)
3456
+ {
3457
+ ab.object.material = null;
3458
+ }
3459
+
28783460 buttonGroup.remove(ab);
28793461 radioPanel.remove(ab);
28803462
2881
- ab.GetObject().editWindow = null;
3463
+ //ab.GetObject().editWindow = null;
3464
+ ab.GetObject().manipWindow = null;
28823465 // ab.GetObject().objectUI = null; // ?????????
28833466
28843467 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28853468 break;
28863469 }
28873470 }
3471
+
3472
+ cameraView.requestFocusInWindow();
28883473 refreshContents(true);
28893474 } else
28903475 if (source == editItem || source == editButton)
28913476 {
3477
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3478
+ {
3479
+ Object3D child = (Object3D)e.nextElement();
3480
+ child.pinned = true;
3481
+ }
3482
+
28923483 EditSelection(false);
28933484 } else
28943485 if (source == uneditButton)
....@@ -2898,12 +3489,13 @@
28983489 Object3D child = (Object3D)e.nextElement();
28993490 if(child.editWindow != null)
29003491 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3492
+ child.pinned = false;
29013493 child.CloseUI();
29023494 listUI.remove(child);
29033495
2904
- child.editWindow = null; // ???????????
3496
+ //child.editWindow = null; // ???????????
29053497 }
2906
- objEditor.ctrlPanel.validate();
3498
+ objEditor.ctrlPanel.FlushUI();
29073499 //objEditor.jTree.clearSelection();
29083500 //objEditor.ResetSliders();
29093501 refreshContents(true);
....@@ -2914,6 +3506,7 @@
29143506 //copy.ClearUI();
29153507 for (Object3D obj : listUI)
29163508 {
3509
+ obj.pinned = false;
29173510 obj.CloseUI();
29183511 }
29193512 listUI.clear();
....@@ -2923,7 +3516,7 @@
29233516 {
29243517 assert(copy == group);
29253518
2926
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3519
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29273520
29283521 for (Object3D obj : listUI)
29293522 {
....@@ -2972,6 +3565,9 @@
29723565 }
29733566
29743567 copy = group;
3568
+
3569
+ SetUndoStates();
3570
+
29753571 //Globals.theRenderer.object = group;
29763572 if(!useclient)
29773573 {
....@@ -2987,20 +3583,46 @@
29873583 frontView.object = group;
29883584 sideView.object = group;
29893585 }
2990
- group.editWindow = this;
3586
+
3587
+// fix "+" issue
3588
+ //group.editWindow = this;
3589
+ group.manipWindow = this;
3590
+
29913591 /*
29923592 currentLayout = radio.layout;
29933593 if (currentLayout == null)
29943594 currentLayout = sevenButton;
29953595 */
29963596 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);
29973604 keepparent = group.parent;
29983605 // PARENT = NULL or not???
29993606 //group.parent = null; // ROOT
30003607 //group.attributes = -1;
30013608 ResetModel();
3609
+
3610
+ cameraView.requestFocusInWindow();
30023611 refreshContents(true);
3003
- }
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
+ }
30043626 else
30053627 {
30063628 //return super.action(event, arg);
....@@ -3009,7 +3631,6 @@
30093631 }
30103632
30113633 boolean useclient = false;
3012
- cRadio radio;
30133634
30143635 void ToggleRoot()
30153636 {
....@@ -3061,6 +3682,28 @@
30613682 refreshContents();
30623683 }
30633684
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
+ }
30643707
30653708 void ResetTransform()
30663709 {
....@@ -3173,7 +3816,7 @@
31733816 refreshContents();
31743817 }
31753818
3176
- void ResetCentroid()
3819
+ void ResetCentroid(boolean full)
31773820 {
31783821 Object3D obj;
31793822 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3188,12 +3831,16 @@
31883831 LA.matIdentity(Object3D.mat);
31893832 obj.getBounds(minima, maxima, false);
31903833 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3191
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3834
+ if (full)
3835
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31923836 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31933837 obj.TransformMesh(Object3D.mat);
3838
+
31943839 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3195
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3840
+ if (full)
3841
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31963842 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3843
+
31973844 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31983845 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31993846 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3222,7 +3869,8 @@
32223869
32233870 int size = obj.MemorySize();
32243871
3225
- 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)");
32263874 }
32273875 }
32283876 catch (Exception e)
....@@ -3259,9 +3907,9 @@
32593907 obj = (Object3D)e.nextElement();
32603908
32613909 System.out.println("Object is: " + obj);
3262
- GrafreeD.AnalyzeObject(obj);
3910
+ Grafreed.AnalyzeObject(obj);
32633911 System.out.println("Boundary rep: " + obj.bRep);
3264
- GrafreeD.AnalyzeObject(obj.bRep);
3912
+ Grafreed.AnalyzeObject(obj.bRep);
32653913
32663914 // System.err.println((size/1024) + " KB is the size of " + obj);
32673915 }
....@@ -3303,6 +3951,13 @@
33033951 void GenNormals(boolean crease)
33043952 {
33053953 group.GenNormalsS(crease);
3954
+
3955
+ refreshContents();
3956
+ }
3957
+
3958
+ void GenNormalsMESH()
3959
+ {
3960
+ group.GenNormalsMeshS();
33063961
33073962 refreshContents();
33083963 }
....@@ -3475,8 +4130,8 @@
34754130
34764131 void ParseVertices()
34774132 {
3478
- boolean epsequal = GrafreeD.epsequal;
3479
- GrafreeD.epsequal = true;
4133
+ boolean epsequal = Grafreed.epsequal;
4134
+ Grafreed.epsequal = true;
34804135
34814136 for (int i=0; i<group.selection.size(); i++)
34824137 {
....@@ -3501,7 +4156,7 @@
35014156 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35024157 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35034158
3504
- g.add(GrafreeD.clipboard);
4159
+ g.add(Grafreed.clipboard);
35054160
35064161 buffer.add(g);
35074162 }
....@@ -3516,7 +4171,7 @@
35164171 makeSomething(buffer, i==group.selection.size()-1);
35174172 }
35184173
3519
- GrafreeD.epsequal = epsequal;
4174
+ Grafreed.epsequal = epsequal;
35204175
35214176 refreshContents();
35224177 }
....@@ -3534,7 +4189,16 @@
35344189 String pigment = Object3D.GetPigment(tex);
35354190 //String bump = Object3D.GetBump(tex);
35364191
3537
- 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
+ }
35384202
35394203 double s = v.s;
35404204
....@@ -3622,11 +4286,11 @@
36224286
36234287 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36244288
3625
- boolean random = CameraPane.RANDOM;
3626
- CameraPane.RANDOM = false; // parse all random nodes
4289
+ boolean random = CameraPane.SWITCH;
4290
+ CameraPane.SWITCH = false; // parse all random nodes
36274291 lowres.linkVerticesThis(null);
36284292 lowres.linkVerticesThis(sn);
3629
- CameraPane.RANDOM = random;
4293
+ CameraPane.SWITCH = random;
36304294
36314295 System.err.flush();
36324296
....@@ -3666,7 +4330,7 @@
36664330 return;
36674331
36684332 Object3D poses = group.selection.get(0);
3669
- Object3D ref = GrafreeD.clipboard.get(0);
4333
+ Object3D ref = Grafreed.clipboard.get(0);
36704334
36714335 Object3D newgroup = new Object3D("Po:" + poses.name);
36724336
....@@ -3860,9 +4524,9 @@
38604524
38614525 void ClipMesh()
38624526 {
3863
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4527
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38644528 {
3865
- Object3D content = GrafreeD.clipboard.get(0);
4529
+ Object3D content = Grafreed.clipboard.get(0);
38664530
38674531 if (content instanceof cGroup && ((cGroup)content).transientlink )
38684532 content = ((cGroup)content).get(0);
....@@ -3871,7 +4535,7 @@
38714535 // {
38724536 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38734537 // }
3874
- group.selection.ClipMesh(GrafreeD.clipboard);
4538
+ group.selection.ClipMesh(Grafreed.clipboard);
38754539 }
38764540 // group.selection.ClipMesh(GrafreeD.clipboard);
38774541 System.out.println("DONE.");
....@@ -3918,6 +4582,18 @@
39184582 void MarkLeaves(boolean hide)
39194583 {
39204584 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);
39214597 refreshContents();
39224598 }
39234599
....@@ -3992,28 +4668,25 @@
39924668 // }
39934669 // }
39944670
3995
- static boolean allparams = true;
3996
-
3997
- static Vector<Object3D> listUI = new Vector<Object3D>();
3998
-
39994671 void EditSelection(boolean newWindow)
40004672 {
4673
+ if (group.selection == null)
4674
+ {
4675
+ EditElement(group, newWindow); // ? new
4676
+ return;
4677
+ }
4678
+
40014679 // aConstraints.gridy = 0;
40024680 for (int i=0; i<group.selection.size(); i++)
40034681 {
40044682 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40054683 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4006
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4684
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40074685
40084686 Object3D elem = (Object3D)group.selection.elementAt(i);
4009
- if(elem != group)
4687
+ if(elem != group || !newWindow)
40104688 {
4011
- // if (!(elem instanceof Composite))
4012
- // newWindow = false;
4013
- listUI.add(elem);
4014
- elem.openEditWindow(this, newWindow); //, false);
4015
- System.out.println("edit : " + elem);
4016
- elem.editWindow.refreshContents(true); // ? new
4689
+ EditElement(elem, newWindow); // ? new
40174690 }
40184691 }
40194692 }
....@@ -4088,7 +4761,8 @@
40884761 //new Exception().printStackTrace();
40894762
40904763 freezemodel = true;
4091
-
4764
+ ClearUnpinned();
4765
+
40924766 /**/
40934767 //switch (event.id)
40944768 {
....@@ -4096,7 +4770,6 @@
40964770 //case 702: // Event.LIST_DESELECT
40974771 group.deselectAll();
40984772 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4099
- objEditor.ClearInfo(); // .GetMaterial());
41004773 if (tps != null)
41014774 {
41024775 for (int i=0; i < tps.length; i++)
....@@ -4105,10 +4778,8 @@
41054778
41064779 //if (child.parent != null)
41074780 //child.parent.addSelectee(child);
4781
+ objEditor.SetMaterial(child);
41084782 group.addSelectee(child);
4109
- objEditor.SetMaterial(child); // .GetMaterial());
4110
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4111
- System.err.println("info : " + child.GetPath());
41124783 }
41134784 }
41144785 // else
....@@ -4118,20 +4789,28 @@
41184789 // System.err.println("info : " + group.GetPath());
41194790 // }
41204791
4121
- objEditor.SetText(); // jan 2014
4122
-
4123
- 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))
41244793 CameraPane.flash = true;
41254794
4126
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4795
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41274796 // a camera
41284797 {
4129
- CameraPane.camerachangeframe = 0; // don't refuse it
4130
- 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
+ }
41314803 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41324804 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41334805 }
41344806
4807
+ if (tps != null && tps.length == 1)
4808
+ {
4809
+ EditSelection(false);
4810
+ }
4811
+
4812
+ SetPinStates(tps != null && tps.length > 0);
4813
+
41354814 refreshContents();
41364815 //return true;
41374816 }
....@@ -4140,6 +4819,35 @@
41404819
41414820 freezemodel = false;
41424821 }
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
+ }
41434851
41444852 void linkSomething(Object3D thing)
41454853 {
....@@ -4211,16 +4919,19 @@
42114919 {
42124920 if (group.selection.isEmpty())
42134921 return;
4214
- GrafreeD.clipboardIsTempGroup = false;
4922
+
4923
+ Grafreed.clipboardIsTempGroup = false;
42154924 Composite tGroup = null;
42164925 if (group.selection.size() > 0) // 1)
42174926 {
42184927 tGroup = new cGroup();
4219
- GrafreeD.clipboardIsTempGroup = true;
4928
+ Grafreed.clipboardIsTempGroup = true;
42204929 }
42214930
42224931 if (cut)
42234932 {
4933
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4934
+// Save();
42244935 //int indices[] = jList.getSelectedIndices();
42254936 //for (int i = indices.length - 1; i >= 0; i--)
42264937 //jList.remove(indices[i]);
....@@ -4256,16 +4967,16 @@
42564967 //System.out.println("cut " + child);
42574968 //System.out.println("parent = " + child.parent);
42584969 // tmp.addChild(child);
4259
- if (GrafreeD.clipboardIsTempGroup)
4970
+ if (Grafreed.clipboardIsTempGroup)
42604971 tGroup.add/*Child*/(tmp);
42614972 else
4262
- GrafreeD.clipboard = tmp;
4973
+ Grafreed.clipboard = tmp;
42634974 }
42644975 else
4265
- if (GrafreeD.clipboardIsTempGroup)
4976
+ if (Grafreed.clipboardIsTempGroup)
42664977 tGroup.add/*Child*/(child);
42674978 else
4268
- GrafreeD.clipboard = child;
4979
+ Grafreed.clipboard = child;
42694980 }
42704981
42714982 //ResetModel();
....@@ -4297,21 +5008,23 @@
42975008 //System.out.println("cut " + elem);
42985009 //System.out.println("parent = " + elem.parent);
42995010 // tmp.addChild(elem);
4300
- if (GrafreeD.clipboardIsTempGroup)
5011
+ if (Grafreed.clipboardIsTempGroup)
43015012 tGroup.add/*Child*/(tmp);
43025013 else
4303
- GrafreeD.clipboard = tmp;
5014
+ Grafreed.clipboard = tmp;
43045015 }
43055016 else
4306
- if (GrafreeD.clipboardIsTempGroup)
5017
+ if (Grafreed.clipboardIsTempGroup)
43075018 tGroup.add/*Child*/(child);
43085019 else
4309
- GrafreeD.clipboard = child;
5020
+ Grafreed.clipboard = child;
43105021 }
43115022
43125023 }
4313
- if (GrafreeD.clipboardIsTempGroup)
4314
- GrafreeD.clipboard = tGroup;
5024
+
5025
+ if (Grafreed.clipboardIsTempGroup)
5026
+ Grafreed.clipboard = tGroup;
5027
+
43155028 if (cut)
43165029 {
43175030 ResetModel();
....@@ -4321,11 +5034,15 @@
43215034
43225035 void paste(boolean expand)
43235036 {
5037
+ if (Globals.REPLACEONMAKE)
5038
+ Save();
5039
+ boolean keep = Globals.REPLACEONMAKE;
5040
+ Globals.REPLACEONMAKE = false;
43245041 // if (GrafreeD.clipboard == null)
43255042 // return;
43265043 boolean first = true;
43275044
4328
- if (GrafreeD.clipboardIsTempGroup)
5045
+ if (Grafreed.clipboardIsTempGroup)
43295046 {
43305047 Composite temp;
43315048
....@@ -4336,7 +5053,7 @@
43365053 temp = (Composite)Applet3D.clipboard.deepCopy();
43375054 */
43385055 Object3D elem;
4339
- 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))
43405057 {
43415058 Object3D child = (Object3D)e.nextElement();
43425059
....@@ -4370,21 +5087,22 @@
43705087 //Object3D cb = Applet3D.clipboard;
43715088 //temp.addChild(cb);
43725089 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4373
- assert(GrafreeD.clipboard.parent == null);
4374
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4375
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4376
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4377
- 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());
43785095 else
4379
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4380
- GrafreeD.clipboard.get(0).parent = keepparent;
5096
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5097
+ Grafreed.clipboard.get(0).parent = keepparent;
43815098 }
43825099
5100
+ Globals.REPLACEONMAKE = keep;
43835101 ResetModel();
43845102 refreshContents();
43855103 }
43865104
4387
- void pasteInto(boolean copyit)
5105
+ void pasteInto(boolean copyit, boolean clone)
43885106 {
43895107 // if (GrafreeD.clipboard == null)
43905108 // return;
....@@ -4413,15 +5131,22 @@
44135131 if (copyit)
44145132 {
44155133 // paste(false);
4416
- CloneClipboard(false); // sept 2014
5134
+ if (clone)
5135
+ {
5136
+ CloneClipboard(false); // sept 2014
5137
+ }
5138
+ else
5139
+ {
5140
+ paste(false);
5141
+ }
44175142 }
44185143 else
44195144 {
44205145 boolean first = true;
44215146
4422
- if (GrafreeD.clipboardIsTempGroup)
5147
+ if (Grafreed.clipboardIsTempGroup)
44235148 {
4424
- Composite temp = (Composite)GrafreeD.clipboard;
5149
+ Composite temp = (Composite)Grafreed.clipboard;
44255150 Object3D copy;
44265151 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44275152 {
....@@ -4431,7 +5156,7 @@
44315156 }
44325157 } else
44335158 {
4434
- linkSomething(GrafreeD.clipboard); //.get(0));
5159
+ linkSomething(Grafreed.clipboard); //.get(0));
44355160 }
44365161 }
44375162 }
....@@ -4508,6 +5233,10 @@
45085233
45095234 void group(Object3D csg, boolean grab)
45105235 {
5236
+ if (Globals.REPLACEONMAKE)
5237
+ Save();
5238
+ boolean keep = Globals.REPLACEONMAKE;
5239
+ Globals.REPLACEONMAKE = false;
45115240 if (//false) // why??
45125241 !group.selection.isEmpty())
45135242 {
....@@ -4621,10 +5350,15 @@
46215350 //node.add(csg);
46225351 //makeSomething(node);
46235352 makeSomething(csg);
5353
+ Globals.REPLACEONMAKE = keep;
46245354 }
46255355
46265356 void Ungroup(Object3D g)
46275357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
46285362 if (g instanceof HiddenObject)
46295363 {
46305364 HiddenObject h = (HiddenObject) g;
....@@ -4641,6 +5375,7 @@
46415375 objEditor.makeSomething(g.get(i), false);
46425376 }
46435377 }
5378
+ Globals.REPLACEONMAKE = keep;
46445379 }
46455380
46465381 void ungroup()
....@@ -4836,21 +5571,6 @@
48365571 }
48375572 */
48385573
4839
- void ImportGFD()
4840
- {
4841
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4842
- browser.show();
4843
- String filename = browser.getFile();
4844
- if (filename != null && filename.length() > 0)
4845
- {
4846
- String fullname = browser.getDirectory() + filename;
4847
-
4848
- //Object3D readobj =
4849
- objEditor.ReadGFD(fullname, objEditor);
4850
- //makeSomething(readobj);
4851
- }
4852
- }
4853
-
48545574 /*
48555575 public void Callback(Object obj)
48565576 {
....@@ -4874,26 +5594,9 @@
48745594 }
48755595 */
48765596
4877
- void ImportVRMLX3D()
4878
- {
4879
- if (GrafreeD.standAlone)
4880
- {
4881
- /**/
4882
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4883
- browser.show();
4884
- String filename = browser.getFile();
4885
- if (filename != null && filename.length() > 0)
4886
- {
4887
- String fullname = browser.getDirectory() + filename;
4888
- LoadVRMLX3D(fullname);
4889
- }
4890
- /**/
4891
- }
4892
- }
4893
-
48945597 String GetFile(String dialogName)
48955598 {
4896
- if (GrafreeD.standAlone)
5599
+ if (Grafreed.standAlone)
48975600 {
48985601 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48995602 browser.show();
....@@ -4957,10 +5660,33 @@
49575660 cButton flashSelectionButton;
49585661 cButton editButton;
49595662 cButton uneditButton;
5663
+ JCheckBox allParamsButton;
49605664 cButton clearpanelButton;
4961
- cButton allParamsButton;
49625665 cButton unselectButton;
49635666
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
+
49645690 cButton screenfitButton;
49655691 cButton screenfitpointButton;
49665692 cButton snapobjectButton;
....@@ -4972,14 +5698,6 @@
49725698
49735699 cButton setsupportButton;
49745700
4975
- cButton twoButton;
4976
- cButton sixButton;
4977
- cButton threeButton;
4978
- cButton sevenButton;
4979
- cButton fourButton; // full panel
4980
- cButton oneButton; // full XYZ
4981
- //cButton currentLayout;
4982
-
49835701 //
49845702 //Composite
49855703 Object3D // to do !!
....@@ -4989,9 +5707,11 @@
49895707 //JTree jTree;
49905708 private MenuItem lookAtItem;
49915709 private MenuItem lookFromItem;
4992
- private MenuItem switchItem;
5710
+ private MenuItem switchViewItem;
49935711 private MenuItem cutItem;
4994
- private MenuItem duplicateItem;
5712
+ private MenuItem undoItem;
5713
+ private MenuItem redoItem;
5714
+ private JMenuItem duplicateItem;
49955715 private MenuItem cloneItem;
49965716 private MenuItem cloneSupportItem;
49975717 private MenuItem overwriteGeoItem;
....@@ -5004,7 +5724,7 @@
50045724 private MenuItem linkverticesItem;
50055725 private MenuItem relinkverticesItem;
50065726 private MenuItem setMasterItem;
5007
- private MenuItem resetMeshItem;
5727
+ private MenuItem resetAllItem;
50085728 private MenuItem stepAllItem;
50095729 private MenuItem revertMeshItem;
50105730 private MenuItem poseMeshItem;
....@@ -5015,10 +5735,11 @@
50155735 private MenuItem mergeGeometriesItem;
50165736 private MenuItem copyItem;
50175737 private MenuItem pasteItem;
5738
+ private MenuItem pasteIntoItem;
50185739 private MenuItem pasteLinkItem;
50195740 private MenuItem pasteCloneItem;
50205741 private MenuItem pasteExpandItem;
5021
- private MenuItem clearItem;
5742
+ private MenuItem deleteItem;
50225743 private MenuItem clearAllItem;
50235744 private MenuItem genUVItem;
50245745 private MenuItem genNormalsMESHItem;
....@@ -5053,6 +5774,10 @@
50535774 private MenuItem showleavesItem;
50545775 private MenuItem markleavesItem;
50555776 private MenuItem unmarkleavesItem;
5777
+ private MenuItem rewindleavesItem;
5778
+ private MenuItem unrewindleavesItem;
5779
+ private MenuItem randomleavesItem;
5780
+ private MenuItem unrandomleavesItem;
50565781
50575782 private MenuItem flipVItem;
50585783 private MenuItem unflipVItem;
....@@ -5064,15 +5789,17 @@
50645789 private MenuItem panoTexturesItem;
50655790
50665791 private MenuItem resetCentroidItem;
5067
- private MenuItem transformgeometryItem;
5792
+ private MenuItem resetCentroidXZItem;
50685793 private MenuItem resetTransformItem;
5794
+ private MenuItem transformGeometryItem;
5795
+ private MenuItem transformChildrenItem;
50695796 private MenuItem hideItem;
50705797 private MenuItem grabItem;
50715798 private MenuItem backItem;
50725799 private MenuItem frontItem;
50735800 private MenuItem cameraItem;
50745801 private MenuItem compositeItem;
5075
- private MenuItem randomItem;
5802
+ private MenuItem switchItem;
50765803 private MenuItem physicsItem;
50775804 private MenuItem frameselectorItem;
50785805 private MenuItem scriptNodeItem;
....@@ -5096,6 +5823,8 @@
50965823 private MenuItem attachBumpItem;
50975824 private MenuItem detachBumpItem;
50985825 private MenuItem pigmentBumpItem;
5826
+ private MenuItem embedTexturesItem;
5827
+ private MenuItem deEmbedTexturesItem;
50995828
51005829 private MenuItem particleItem;
51015830 private MenuItem ragdollItem;
....@@ -5112,7 +5841,7 @@
51125841 private MenuItem blobItem;
51135842 private MenuItem latheItem;
51145843 private MenuItem bezierItem;
5115
- private MenuItem checkerItem;
5844
+ private MenuItem overlayItem;
51165845 private MenuItem meshItem;
51175846 // private MenuItem meshGroupItem;
51185847 private MenuItem springItem;
....@@ -5134,11 +5863,6 @@
51345863 private MenuItem doubleItem;
51355864 private MenuItem tripleItem;
51365865
5137
- private MenuItem importGFDItem;
5138
- private MenuItem importVRMLX3DItem;
5139
- private MenuItem import3DSItem;
5140
- private MenuItem importOBJItem;
5141
-
51425866 private MenuItem computeAOItem;
51435867 private MenuItem recompileItem;
51445868 private MenuItem editScriptItem;
....@@ -5148,4 +5872,8 @@
51485872 private MenuItem analyzeItem;
51495873 private MenuItem dumpItem;
51505874 //boolean freezemodel = false;
5875
+
5876
+ Menu cameraMenu;
5877
+ MenuItem editCameraItem;
5878
+ MenuItem restoreCameraItem;
51515879 }