.. | .. |
---|
74 | 74 | this.copy = this.group = copy; |
---|
75 | 75 | //selectees = this.group.selectees; |
---|
76 | 76 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 77 | + SetupMenu2(this); //objEditor); |
---|
78 | 78 | SetupUI2(objEditor); |
---|
79 | 79 | objEditor.SetupUI(true); |
---|
80 | 80 | SetupViews(objEditor); |
---|
.. | .. |
---|
98 | 98 | |
---|
99 | 99 | void CloneClipboard(boolean supports) |
---|
100 | 100 | { |
---|
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)); |
---|
| 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)); |
---|
106 | 106 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 109 | } |
---|
110 | 110 | |
---|
111 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 119 | // obj.support = null; |
---|
120 | 120 | if (!supports) |
---|
121 | 121 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 123 | obj.parent = parent; |
---|
124 | 124 | // obj.support = support; |
---|
125 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 148 | |
---|
149 | 149 | //JTextField nameField; |
---|
150 | 150 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 151 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 152 | { |
---|
| 153 | + Menu menu; |
---|
| 154 | + oe.menuBar.add(menu = new Menu("Edit")); |
---|
| 155 | + //editItem = menu.add(new MenuItem("Edit")); |
---|
| 156 | + //editItem.addActionListener(this); |
---|
| 157 | + |
---|
| 158 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 159 | +// undoItem.addActionListener(this); |
---|
| 160 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 161 | +// redoItem.addActionListener(this); |
---|
| 162 | +// menu.add("-"); |
---|
| 163 | + duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 164 | + duplicateItem.addActionListener(this); |
---|
| 165 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 166 | + cloneItem.addActionListener(this); |
---|
| 167 | + if (Globals.ADVANCED) |
---|
| 168 | + { |
---|
| 169 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 170 | + cloneSupportItem.addActionListener(this); |
---|
| 171 | + } |
---|
| 172 | + menu.add("-"); |
---|
| 173 | + cutItem = menu.add(new MenuItem("Cut")); |
---|
| 174 | + cutItem.addActionListener(this); |
---|
| 175 | + copyItem = menu.add(new MenuItem("Copy")); |
---|
| 176 | + copyItem.addActionListener(this); |
---|
| 177 | + pasteItem = menu.add(new MenuItem("Paste")); |
---|
| 178 | + pasteItem.addActionListener(this); |
---|
| 179 | + |
---|
| 180 | + menu.add("-"); |
---|
| 181 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 182 | + pasteIntoItem.addActionListener(this); |
---|
| 183 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 184 | + pasteLinkItem.addActionListener(this); |
---|
| 185 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 186 | + pasteCloneItem.addActionListener(this); |
---|
| 187 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 188 | +// pasteExpandItem.addActionListener(this); |
---|
| 189 | + menu.add("-"); |
---|
| 190 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 191 | + clearItem.addActionListener(this); |
---|
| 192 | + |
---|
| 193 | + if (Globals.ADVANCED) |
---|
| 194 | + { |
---|
| 195 | + // Deletes the cameras... |
---|
| 196 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 197 | + clearAllItem.addActionListener(this); |
---|
| 198 | + } |
---|
| 199 | + |
---|
| 200 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 201 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 202 | + //zBufferItem.addActionListener(this); |
---|
| 203 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 204 | + //normalLensItem.addActionListener(this); |
---|
| 205 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 206 | + revertCameraItem.addActionListener(this); |
---|
| 207 | + |
---|
| 208 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 209 | + toggleFullScreenItem.addItemListener(this); |
---|
| 210 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 211 | + cameraMenu.add("-"); |
---|
| 212 | + |
---|
| 213 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 214 | + toggleTextureItem.addItemListener(this); |
---|
| 215 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 216 | + |
---|
| 217 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 218 | + toggleSwitchItem.addItemListener(this); |
---|
| 219 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 220 | + |
---|
| 221 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 222 | + toggleHandleItem.addItemListener(this); |
---|
| 223 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 224 | + |
---|
| 225 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 226 | + togglePaintItem.addItemListener(this); |
---|
| 227 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 228 | + |
---|
| 229 | + if (Globals.ADVANCED) |
---|
| 230 | + { |
---|
| 231 | + cameraMenu.add("-"); |
---|
| 232 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 233 | + toggleLiveItem.addItemListener(this); |
---|
| 234 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 235 | + |
---|
| 236 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 237 | + stepItem.addActionListener(this); |
---|
| 238 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 239 | + // toggleDLItem.addItemListener(this); |
---|
| 240 | + // toggleDLItem.setState(false); |
---|
| 241 | + |
---|
| 242 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 243 | + toggleRenderItem.addItemListener(this); |
---|
| 244 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 245 | + |
---|
| 246 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 247 | + toggleDebugItem.addItemListener(this); |
---|
| 248 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 249 | + |
---|
| 250 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 251 | + toggleFrustumItem.addItemListener(this); |
---|
| 252 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 253 | + |
---|
| 254 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 255 | + toggleFootContactItem.addItemListener(this); |
---|
| 256 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 257 | + |
---|
| 258 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 259 | + toggleTimelineItem.addItemListener(this); |
---|
| 260 | + } |
---|
| 261 | + |
---|
| 262 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 263 | +// toggleRootItem.addItemListener(this); |
---|
| 264 | +// toggleRootItem.setState(false); |
---|
| 265 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 266 | +// animationItem.addItemListener(this); |
---|
| 267 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 268 | + cameraMenu.add("-"); |
---|
| 269 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 270 | + editCameraItem.addActionListener(this); |
---|
| 271 | + |
---|
| 272 | + if (Globals.ADVANCED) |
---|
| 273 | + { |
---|
153 | 274 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
154 | 275 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
155 | 276 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
161 | 282 | lookAtItem.addActionListener(this); |
---|
162 | 283 | //lookFromItem.addActinoListener(this); |
---|
163 | 284 | //switchItem.addActionListener(this); |
---|
164 | | - Menu menu; |
---|
165 | | - oe.menuBar.add(menu = new Menu("Edit")); |
---|
166 | | - //editItem = menu.add(new MenuItem("Edit")); |
---|
167 | | - //editItem.addActionListener(this); |
---|
168 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
169 | | - duplicateItem.addActionListener(this); |
---|
170 | | - menu.add("-"); |
---|
171 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
172 | | - cloneItem.addActionListener(this); |
---|
173 | | - cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
174 | | - cloneSupportItem.addActionListener(this); |
---|
175 | | - menu.add("-"); |
---|
176 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
177 | | - cutItem.addActionListener(this); |
---|
178 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
179 | | - copyItem.addActionListener(this); |
---|
180 | | - pasteItem = menu.add(new MenuItem("Paste")); |
---|
181 | | - pasteItem.addActionListener(this); |
---|
182 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
183 | | - pasteLinkItem.addActionListener(this); |
---|
184 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
185 | | - pasteCloneItem.addActionListener(this); |
---|
186 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
187 | | -// pasteExpandItem.addActionListener(this); |
---|
188 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
189 | | - clearItem.addActionListener(this); |
---|
190 | | - clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
191 | | - clearAllItem.addActionListener(this); |
---|
192 | | - |
---|
| 285 | + } |
---|
| 286 | + |
---|
193 | 287 | 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); |
---|
| 288 | + if (Globals.ADVANCED) |
---|
| 289 | + { |
---|
198 | 290 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
199 | 291 | revertMeshItem.addActionListener(this); |
---|
200 | 292 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
201 | 293 | resetreferencesItem.addActionListener(this); |
---|
202 | 294 | menu.add("-"); |
---|
| 295 | + } |
---|
203 | 296 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
204 | 297 | overwriteGeoItem.addActionListener(this); |
---|
205 | 298 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
211 | 304 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
212 | 305 | overwriteUVItem.addActionListener(this); |
---|
213 | 306 | menu.add("-"); |
---|
| 307 | + if (Globals.ADVANCED) |
---|
| 308 | + { |
---|
214 | 309 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
215 | 310 | generateMeshItem.addActionListener(this); |
---|
216 | 311 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
217 | 312 | poseMeshItem.addActionListener(this); |
---|
218 | 313 | menu.add("-"); |
---|
| 314 | + } |
---|
219 | 315 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
220 | 316 | resetsupportItem.addActionListener(this); |
---|
221 | 317 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
222 | 318 | linkverticesItem.addActionListener(this); |
---|
223 | 319 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
224 | 320 | relinkverticesItem.addActionListener(this); |
---|
| 321 | + |
---|
| 322 | + if (Globals.ADVANCED) |
---|
| 323 | + { |
---|
225 | 324 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
226 | 325 | setMasterItem.addActionListener(this); |
---|
| 326 | + } |
---|
227 | 327 | |
---|
228 | 328 | oe.menuBar.add(menu = new Menu("Group")); |
---|
229 | 329 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
234 | 334 | frontItem.addActionListener(this); |
---|
235 | 335 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
236 | 336 | compositeItem.addActionListener(this); |
---|
237 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 337 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
238 | 338 | hideItem.addActionListener(this); |
---|
239 | 339 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
240 | 340 | ungroupItem.addActionListener(this); |
---|
241 | 341 | menu.add("-"); |
---|
242 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 342 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
243 | 343 | 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); |
---|
248 | 344 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
249 | 345 | switchGeoItem.addActionListener(this); |
---|
250 | 346 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
251 | 347 | switchTransfoItem.addActionListener(this); |
---|
252 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 348 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
253 | 349 | morphItem.addActionListener(this); |
---|
| 350 | + |
---|
| 351 | + if (Globals.ADVANCED) |
---|
| 352 | + { |
---|
| 353 | + menu.add("-"); |
---|
| 354 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 355 | + physicsItem.addActionListener(this); |
---|
| 356 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 357 | + frameselectorItem.addActionListener(this); |
---|
254 | 358 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
255 | 359 | scriptNodeItem.addActionListener(this); |
---|
256 | 360 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
257 | 361 | cameraItem.addActionListener(this); |
---|
| 362 | + } |
---|
258 | 363 | |
---|
259 | 364 | oe.menuBar.add(menu = new Menu("Object")); |
---|
260 | 365 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
263 | 368 | billboardItem.addActionListener(this); |
---|
264 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
265 | 370 | csgItem.addActionListener(this); |
---|
266 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 371 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
267 | 372 | shadowXItem.addActionListener(this); |
---|
268 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 373 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
269 | 374 | shadowYItem.addActionListener(this); |
---|
270 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 375 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
271 | 376 | shadowZItem.addActionListener(this); |
---|
| 377 | + if (Globals.ADVANCED) |
---|
| 378 | + { |
---|
| 379 | + menu.add("-"); |
---|
272 | 380 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
273 | 381 | linkerItem.addActionListener(this); |
---|
274 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
275 | | - templateItem.addActionListener(this); |
---|
276 | 382 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
277 | 383 | attributeItem.addActionListener(this); |
---|
| 384 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 385 | + templateItem.addActionListener(this); |
---|
278 | 386 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
279 | 387 | pointflowItem.addActionListener(this); |
---|
| 388 | + } |
---|
280 | 389 | menu.add("-"); |
---|
281 | 390 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
282 | 391 | resetTransformItem.addActionListener(this); |
---|
283 | 392 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
284 | 393 | resetCentroidItem.addActionListener(this); |
---|
285 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
286 | | - transformgeometryItem.addActionListener(this); |
---|
| 394 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 395 | + resetCentroidXZItem.addActionListener(this); |
---|
| 396 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 397 | + transformGeometryItem.addActionListener(this); |
---|
| 398 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 399 | + transformChildrenItem.addActionListener(this); |
---|
287 | 400 | |
---|
288 | 401 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
289 | 402 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
294 | 407 | genNormalsCADItem.addActionListener(this); |
---|
295 | 408 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
296 | 409 | genNormalsMESHItem.addActionListener(this); |
---|
| 410 | + if (Globals.ADVANCED) |
---|
| 411 | + { |
---|
297 | 412 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
298 | 413 | genNormalsMINEItem.addActionListener(this); |
---|
| 414 | + } |
---|
299 | 415 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
300 | 416 | stripifyItem.addActionListener(this); |
---|
301 | 417 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
317 | 433 | reduce34MeshItem.addActionListener(this); |
---|
318 | 434 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
319 | 435 | increaseMeshItem.addActionListener(this); |
---|
320 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
321 | | - smoothMeshItem.addActionListener(this); |
---|
322 | 436 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
323 | 437 | clipMeshItem.addActionListener(this); |
---|
| 438 | + |
---|
| 439 | + if (Globals.ADVANCED) |
---|
| 440 | + { |
---|
| 441 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 442 | + smoothMeshItem.addActionListener(this); |
---|
| 443 | + } |
---|
324 | 444 | |
---|
325 | 445 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
326 | 446 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
327 | 447 | clearMaterialsItem.addActionListener(this); |
---|
| 448 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 449 | + resetAllItem.addActionListener(this); |
---|
| 450 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 451 | + stepAllItem.addActionListener(this); |
---|
328 | 452 | menu.add("-"); |
---|
329 | 453 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
330 | 454 | liveleavesItem.addActionListener(this); |
---|
331 | 455 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
332 | 456 | unliveleavesItem.addActionListener(this); |
---|
| 457 | + if (Globals.ADVANCED) |
---|
| 458 | + { |
---|
333 | 459 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
334 | 460 | supportleavesItem.addActionListener(this); |
---|
335 | 461 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
336 | 462 | unsupportleavesItem.addActionListener(this); |
---|
| 463 | + } |
---|
337 | 464 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
338 | 465 | hideleavesItem.addActionListener(this); |
---|
339 | 466 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
342 | 469 | markleavesItem.addActionListener(this); |
---|
343 | 470 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
344 | 471 | unmarkleavesItem.addActionListener(this); |
---|
| 472 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 473 | + rewindleavesItem.addActionListener(this); |
---|
| 474 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 475 | + unrewindleavesItem.addActionListener(this); |
---|
| 476 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 477 | + randomleavesItem.addActionListener(this); |
---|
| 478 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 479 | + unrandomleavesItem.addActionListener(this); |
---|
345 | 480 | menu.add("-"); |
---|
346 | 481 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
347 | 482 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
377 | 512 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
378 | 513 | sortbynameItem.addActionListener(this); |
---|
379 | 514 | menu.add("-"); |
---|
| 515 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 516 | + shareGeometriesItem.addActionListener(this); |
---|
| 517 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 518 | + mergeGeometriesItem.addActionListener(this); |
---|
| 519 | + if (Globals.ADVANCED) |
---|
| 520 | + { |
---|
| 521 | + // Pretty much the same as duplicate and clone. |
---|
380 | 522 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
381 | 523 | extractGeometriesItem.addActionListener(this); |
---|
382 | 524 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
383 | 525 | 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); |
---|
| 526 | + } |
---|
388 | 527 | |
---|
389 | 528 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
390 | 529 | buildCreateMenu(menu); |
---|
391 | 530 | |
---|
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 | | - |
---|
403 | 531 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
404 | 532 | buildToolsMenu(menu); |
---|
405 | 533 | } |
---|
406 | 534 | |
---|
407 | 535 | void SetupUI2(ObjEditor oe) |
---|
408 | 536 | { |
---|
| 537 | + // June 2019 |
---|
| 538 | + if (oe == null) |
---|
| 539 | + { |
---|
| 540 | + //super.SetupUI2(this); |
---|
| 541 | + //return; |
---|
| 542 | + } |
---|
| 543 | + |
---|
| 544 | + if (copy != group) |
---|
| 545 | + { |
---|
| 546 | + //super.SetupUI2(this); |
---|
| 547 | + } |
---|
| 548 | + |
---|
409 | 549 | //new Exception().printStackTrace(); |
---|
410 | 550 | |
---|
411 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
436 | 576 | */ |
---|
437 | 577 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
438 | 578 | |
---|
439 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
440 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 579 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 580 | + //minButton.setToolTipText("Minimize window"); |
---|
| 581 | + //minButton.addActionListener(this); |
---|
| 582 | + |
---|
| 583 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + maxButton.setToolTipText("Maximize window"); |
---|
| 585 | + maxButton.addActionListener(this); |
---|
| 586 | + |
---|
| 587 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 589 | + fullButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + undoButton.setToolTipText("Undo changes"); |
---|
| 593 | + undoButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + redoButton.setToolTipText("Redo changes"); |
---|
| 597 | + redoButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + saveButton.setToolTipText("Save changes"); |
---|
| 601 | + saveButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 604 | + liveCB.setToolTipText("Enable animation"); |
---|
441 | 605 | liveCB.addItemListener(this); |
---|
442 | 606 | |
---|
443 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 608 | + fastCB.setToolTipText("Fast mode"); |
---|
| 609 | + fastCB.addItemListener(this); |
---|
| 610 | + |
---|
| 611 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 613 | + oneStepButton.addActionListener(this); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
444 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
445 | 617 | trackCB.addItemListener(this); |
---|
446 | 618 | |
---|
447 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
448 | 620 | screenfitButton.setToolTipText("Screen fit"); |
---|
449 | 621 | screenfitButton.addActionListener(this); |
---|
450 | 622 | |
---|
451 | 623 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
452 | 624 | // 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; |
---|
458 | 625 | |
---|
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"); |
---|
| 626 | + if (Globals.ADVANCED) |
---|
| 627 | + { |
---|
| 628 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + snapobjectButton.addActionListener(this); |
---|
| 630 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 631 | + } |
---|
| 632 | + |
---|
| 633 | + oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
466 | 635 | flashSelectionButton.addActionListener(this); |
---|
467 | 636 | |
---|
468 | 637 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
469 | 638 | |
---|
470 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
471 | 640 | twoButton.setToolTipText("Show center view only"); |
---|
472 | 641 | twoButton.addActionListener(this); |
---|
473 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
474 | 643 | fourButton.addActionListener(this); |
---|
475 | 644 | fourButton.setToolTipText("Show left panel only"); |
---|
476 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 645 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
477 | 646 | sixButton.setToolTipText("2-column layout left"); |
---|
478 | 647 | sixButton.addActionListener(this); |
---|
479 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 648 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
480 | 649 | threeButton.setToolTipText("2-column layout right"); |
---|
481 | 650 | threeButton.addActionListener(this); |
---|
482 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
483 | 652 | sevenButton.setToolTipText("3-column layout"); |
---|
484 | 653 | sevenButton.addActionListener(this); |
---|
485 | 654 | // |
---|
486 | 655 | |
---|
487 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
488 | 657 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
489 | 658 | rootButton.addActionListener(this); |
---|
490 | 659 | |
---|
491 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 660 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
492 | 661 | closeButton.setToolTipText("Close tab"); |
---|
493 | 662 | closeButton.addActionListener(this); |
---|
494 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
495 | 664 | //clearButton.addActionListener(this); |
---|
496 | 665 | |
---|
497 | | - cGridBag commandsPanel = new cGridBag(); |
---|
498 | | - |
---|
499 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 666 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
500 | 667 | editButton.setToolTipText("Edit selection"); |
---|
501 | 668 | editButton.addActionListener(this); |
---|
502 | 669 | |
---|
503 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 671 | uneditButton.setToolTipText("Unedit selection"); |
---|
505 | 672 | uneditButton.addActionListener(this); |
---|
506 | 673 | |
---|
507 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 675 | + allParamsButton.setToolTipText("Edit all params"); |
---|
| 676 | + allParamsButton.addActionListener(this); |
---|
| 677 | + |
---|
| 678 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
508 | 679 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
509 | 680 | clearPanelButton.addActionListener(this); |
---|
510 | 681 | |
---|
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); |
---|
| 682 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 683 | unselectButton.setToolTipText("Unselect"); |
---|
517 | 684 | unselectButton.addActionListener(this); |
---|
518 | 685 | |
---|
519 | | - commandsPanel.preferredHeight = 1; |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
520 | 687 | |
---|
521 | | - oe.treePanel.add(commandsPanel); |
---|
522 | | - oe.treePanel.Return(); |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
523 | 690 | |
---|
524 | 691 | // oe.aConstraints.gridx += 1; |
---|
525 | 692 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
587 | 754 | |
---|
588 | 755 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
589 | 756 | { |
---|
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); |
---|
599 | | - |
---|
600 | | - // constraints.gridy += 1; |
---|
601 | | - // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
602 | | - // localCB.addItemListener(this); |
---|
603 | | - |
---|
604 | | - //constraints.gridy += 1; |
---|
605 | | - panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
606 | | - crowdCB.setToolTipText("Used for crowds"); |
---|
607 | | - crowdCB.addItemListener(this); |
---|
608 | | - |
---|
609 | | - //constraints.gridy += 1; |
---|
610 | | - panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
611 | | - smoothCB.setToolTipText("Snapping delay"); |
---|
612 | | - smoothCB.addItemListener(this); |
---|
613 | | - |
---|
614 | | - //constraints.gridy += 1; |
---|
615 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
616 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
617 | | - slowCB.addItemListener(this); |
---|
618 | | - //constraints.gridy += 1; |
---|
619 | 757 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
620 | 758 | boxCB.setToolTipText("Display bounding boxes"); |
---|
621 | 759 | boxCB.addItemListener(this); |
---|
622 | | - //constraints.gridy += 1; |
---|
| 760 | + |
---|
623 | 761 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
624 | 762 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
625 | 763 | zoomBoxCB.addItemListener(this); |
---|
626 | 764 | |
---|
| 765 | + if (true) // Globals.ADVANCED) |
---|
| 766 | + { |
---|
| 767 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 768 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 769 | + supportCB.addItemListener(this); |
---|
| 770 | + |
---|
| 771 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 772 | + // localCB.addItemListener(this); |
---|
| 773 | + |
---|
| 774 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 775 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 776 | + crowdCB.addItemListener(this); |
---|
| 777 | + |
---|
| 778 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 779 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 780 | + smoothCB.addItemListener(this); |
---|
| 781 | + |
---|
| 782 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 783 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 784 | + slowCB.addItemListener(this); |
---|
| 785 | + |
---|
627 | 786 | // constraints.gridy += 1; |
---|
628 | 787 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
629 | 788 | // speakerMocapCB.addItemListener(this); |
---|
.. | .. |
---|
648 | 807 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
649 | 808 | // debugCB.addItemListener(this); |
---|
650 | 809 | |
---|
651 | | - //constraints.gridy += 1; |
---|
652 | 810 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 811 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
653 | 812 | oeilCB.addItemListener(this); |
---|
654 | 813 | |
---|
655 | | - //constraints.gridy += 1; |
---|
| 814 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 815 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 816 | + shadowCB.addItemListener(this); |
---|
| 817 | + |
---|
| 818 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 819 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 820 | + autosaveCB.addItemListener(this); |
---|
| 821 | + |
---|
| 822 | + if (Globals.ADVANCED) |
---|
| 823 | + { |
---|
656 | 824 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
657 | 825 | lookAtCB.setToolTipText("Look-at target"); |
---|
658 | 826 | lookAtCB.addItemListener(this); |
---|
| 827 | + } |
---|
| 828 | + |
---|
| 829 | + } |
---|
659 | 830 | |
---|
660 | 831 | cGridBag fill = new cGridBag(); |
---|
661 | 832 | |
---|
.. | .. |
---|
668 | 839 | void EditObject(Object3D obj) |
---|
669 | 840 | { |
---|
670 | 841 | cRadio radioButton = new cRadio(obj.name); |
---|
| 842 | + |
---|
| 843 | + // Patch to avoid bug with transparency. |
---|
| 844 | + radioButton.hadMaterial = obj.material != null; |
---|
| 845 | + if (!radioButton.hadMaterial) |
---|
| 846 | + { |
---|
| 847 | + obj.material = new cMaterial(); |
---|
| 848 | + } |
---|
| 849 | + |
---|
671 | 850 | radioButton.SetObject(obj); |
---|
672 | 851 | radioButton.layout = sevenButton; |
---|
673 | 852 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
676 | 855 | buttonGroup.add(radioButton); |
---|
677 | 856 | radioButton.doClick(); |
---|
678 | 857 | } |
---|
| 858 | + |
---|
679 | 859 | void SetupViews(ObjEditor oe) |
---|
680 | 860 | { |
---|
| 861 | + theFrame = this; |
---|
| 862 | + |
---|
681 | 863 | oe.SetupViews(); |
---|
682 | 864 | |
---|
683 | 865 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
686 | 868 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
687 | 869 | } |
---|
688 | 870 | |
---|
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; |
---|
| 871 | + cCheckBox liveCB; |
---|
| 872 | + cCheckBox supportCB; |
---|
| 873 | + cCheckBox localCB; |
---|
| 874 | + cCheckBox crowdCB; |
---|
| 875 | + cCheckBox smoothCB; |
---|
| 876 | + cCheckBox fastCB; |
---|
| 877 | + cCheckBox slowCB; |
---|
| 878 | + cCheckBox boxCB; |
---|
| 879 | + cCheckBox zoomBoxCB; |
---|
| 880 | + cCheckBox trackCB; |
---|
| 881 | + cCheckBox smoothfocusCB; |
---|
700 | 882 | // JCheckBox speakerMocapCB; |
---|
701 | | - JCheckBox speakerCameraCB; |
---|
702 | | - JCheckBox speakerFocusCB; |
---|
703 | | - JCheckBox debugCB; |
---|
704 | | - JCheckBox oeilCB; |
---|
705 | | - JCheckBox lookAtCB; |
---|
| 883 | + cCheckBox speakerCameraCB; |
---|
| 884 | + cCheckBox speakerFocusCB; |
---|
| 885 | + cCheckBox debugCB; |
---|
| 886 | + |
---|
| 887 | + cCheckBox oeilCB; |
---|
| 888 | + cCheckBox shadowCB; |
---|
| 889 | + cCheckBox autosaveCB; |
---|
| 890 | + cCheckBox lookAtCB; |
---|
706 | 891 | |
---|
707 | 892 | // static int COLOR = 1; |
---|
708 | 893 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
710 | 895 | |
---|
711 | 896 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
712 | 897 | |
---|
713 | | - JCheckBox colorCB; |
---|
714 | | - JCheckBox materialCB; |
---|
715 | | - JCheckBox textureCB; |
---|
| 898 | + cCheckBox colorCB; |
---|
| 899 | + cCheckBox materialCB; |
---|
| 900 | + cCheckBox textureCB; |
---|
716 | 901 | |
---|
717 | 902 | public void itemStateChanged(ItemEvent e) |
---|
718 | 903 | { |
---|
.. | .. |
---|
740 | 925 | } else if(e.getSource() == liveCB) |
---|
741 | 926 | { |
---|
742 | 927 | cameraView.ToggleLive(); |
---|
| 928 | + refreshContents(false); |
---|
743 | 929 | } |
---|
744 | 930 | else if(e.getSource() == supportCB) |
---|
745 | 931 | { |
---|
.. | .. |
---|
803 | 989 | else if(e.getSource() == oeilCB) |
---|
804 | 990 | { |
---|
805 | 991 | cameraView.ToggleOeil(); |
---|
| 992 | + } |
---|
| 993 | + else if(e.getSource() == shadowCB) |
---|
| 994 | + { |
---|
| 995 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 996 | + } |
---|
| 997 | + else if(e.getSource() == autosaveCB) |
---|
| 998 | + { |
---|
| 999 | + Globals.SAVEONMAKE ^= true; |
---|
806 | 1000 | } |
---|
807 | 1001 | else if(e.getSource() == lookAtCB) |
---|
808 | 1002 | { |
---|
.. | .. |
---|
892 | 1086 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
893 | 1087 | // return; |
---|
894 | 1088 | // } |
---|
895 | | - if (string.charAt(0) == '/') |
---|
| 1089 | + |
---|
| 1090 | + // File path for Mac and Windows |
---|
| 1091 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
896 | 1092 | { |
---|
897 | 1093 | // file(s) |
---|
898 | 1094 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
919 | 1115 | |
---|
920 | 1116 | flashIt = false; |
---|
921 | 1117 | CameraPane pane = (CameraPane) target; |
---|
922 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1118 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
923 | 1119 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
924 | 1120 | |
---|
925 | 1121 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
946 | 1142 | { |
---|
947 | 1143 | loadClipboard(true); |
---|
948 | 1144 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
949 | | - pasteInto(false); |
---|
| 1145 | + pasteInto(false, false); |
---|
950 | 1146 | } else { |
---|
951 | 1147 | loadClipboard(false); |
---|
952 | 1148 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
953 | | - pasteInto(false); // true); // ??? |
---|
| 1149 | + pasteInto(false, false); // true); // ??? |
---|
954 | 1150 | } |
---|
955 | 1151 | } |
---|
956 | 1152 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1072 | 1268 | kleinItem.addActionListener(this); |
---|
1073 | 1269 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1074 | 1270 | particleItem.addActionListener(this); |
---|
| 1271 | + if (Globals.ADVANCED) |
---|
| 1272 | + { |
---|
1075 | 1273 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1076 | 1274 | ragdollItem.addActionListener(this); |
---|
1077 | 1275 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1078 | 1276 | ragdoll2Item.addActionListener(this); |
---|
| 1277 | + } |
---|
1079 | 1278 | menu.add("-"); |
---|
1080 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1279 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1081 | 1280 | meshItem.addActionListener(this); |
---|
1082 | 1281 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1083 | 1282 | // meshGroupItem.addActionListener(this); |
---|
| 1283 | + if (Globals.ADVANCED) |
---|
| 1284 | + { |
---|
1084 | 1285 | springItem = menu.add(new MenuItem("Spring")); |
---|
1085 | 1286 | springItem.addActionListener(this); |
---|
1086 | 1287 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1087 | 1288 | 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); |
---|
1092 | 1289 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1093 | 1290 | blobItem.addActionListener(this); |
---|
1094 | 1291 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1095 | 1292 | latheItem.addActionListener(this); |
---|
| 1293 | + } |
---|
| 1294 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1295 | + bezierItem.addActionListener(this); |
---|
| 1296 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1297 | + overlayItem.addActionListener(this); |
---|
1096 | 1298 | lightItem = menu.add(new MenuItem("Light")); |
---|
1097 | 1299 | lightItem.addActionListener(this); |
---|
1098 | 1300 | menu.add("-"); |
---|
.. | .. |
---|
1102 | 1304 | loopItem.addActionListener(this); |
---|
1103 | 1305 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1104 | 1306 | doubleItem.addActionListener(this); |
---|
| 1307 | + if (Globals.ADVANCED) |
---|
| 1308 | + { |
---|
1105 | 1309 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1106 | 1310 | tripleItem.addActionListener(this); |
---|
| 1311 | + } |
---|
1107 | 1312 | } |
---|
1108 | 1313 | |
---|
1109 | 1314 | void buildToolsMenu(Menu menu) |
---|
1110 | 1315 | { |
---|
1111 | 1316 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1112 | 1317 | animationItem.addItemListener(this); |
---|
1113 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1318 | + animationItem.setState(Globals.ANIMATION); |
---|
1114 | 1319 | |
---|
1115 | 1320 | menu.add("-"); |
---|
1116 | 1321 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1117 | 1322 | parseverticesItem.addActionListener(this); |
---|
1118 | 1323 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1119 | 1324 | textureFieldItem.addActionListener(this); |
---|
1120 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1325 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1121 | 1326 | alignItem.addActionListener(this); |
---|
1122 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1123 | | - mirrorItem.addActionListener(this); |
---|
1124 | 1327 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1125 | 1328 | reduceMorphItem.addActionListener(this); |
---|
1126 | 1329 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1127 | 1330 | reduce34MorphItem.addActionListener(this); |
---|
1128 | | - |
---|
| 1331 | + menu.add("-"); |
---|
1129 | 1332 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1130 | 1333 | computeAOItem.addActionListener(this); |
---|
1131 | | - menu.add("-"); |
---|
1132 | 1334 | |
---|
| 1335 | + if (Globals.ADVANCED) |
---|
| 1336 | + { |
---|
| 1337 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1338 | + mirrorItem.addActionListener(this); |
---|
| 1339 | + menu.add("-"); |
---|
1133 | 1340 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1134 | 1341 | memoryItem.addActionListener(this); |
---|
1135 | 1342 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1136 | 1343 | analyzeItem.addActionListener(this); |
---|
1137 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1344 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1138 | 1345 | dumpItem.addActionListener(this); |
---|
1139 | 1346 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1140 | 1347 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1152 | 1359 | menu.add("-"); |
---|
1153 | 1360 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1154 | 1361 | editScriptItem.addActionListener(this); |
---|
| 1362 | + } |
---|
1155 | 1363 | } |
---|
1156 | 1364 | |
---|
1157 | 1365 | void ScreenFit() |
---|
.. | .. |
---|
1274 | 1482 | shadow.material = new cMaterial(obj.material); |
---|
1275 | 1483 | shadow.material.diffuse = 0.0001f; |
---|
1276 | 1484 | shadow.material.specular = 0.0001f; |
---|
| 1485 | + //shadow.projectedVertices[1].x = 300; |
---|
1277 | 1486 | |
---|
1278 | 1487 | makeSomething(shadow); |
---|
1279 | 1488 | } |
---|
.. | .. |
---|
1480 | 1689 | |
---|
1481 | 1690 | void Overwrite(int mask) |
---|
1482 | 1691 | { |
---|
1483 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1692 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1484 | 1693 | { |
---|
1485 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1694 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1486 | 1695 | |
---|
1487 | 1696 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1488 | 1697 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1653 | 1862 | { |
---|
1654 | 1863 | makeSomething(new BezierSurface()); |
---|
1655 | 1864 | } else |
---|
1656 | | - if (source == checkerItem) |
---|
| 1865 | + if (source == overlayItem) |
---|
1657 | 1866 | { |
---|
1658 | 1867 | /* |
---|
1659 | 1868 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1787 | 1996 | csg.addChild(child); |
---|
1788 | 1997 | child.addChild(csg); |
---|
1789 | 1998 | } 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"); |
---|
1806 | | - } else |
---|
1807 | 1999 | if (source == computeAOItem) |
---|
1808 | 2000 | { |
---|
1809 | 2001 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1822 | 2014 | if (source == invariantsItem) |
---|
1823 | 2015 | { |
---|
1824 | 2016 | System.out.println("Invariants:"); |
---|
1825 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2017 | + Grafreed.grafreeD.universe.invariants(); |
---|
1826 | 2018 | } else |
---|
1827 | 2019 | if (source == memoryItem) |
---|
1828 | 2020 | { |
---|
.. | .. |
---|
1840 | 2032 | if (source == dumpItem) |
---|
1841 | 2033 | { |
---|
1842 | 2034 | DumpObject(); |
---|
| 2035 | + } else |
---|
| 2036 | + if (source == minButton) |
---|
| 2037 | + { |
---|
| 2038 | + Minimize(); |
---|
| 2039 | + } else |
---|
| 2040 | + if (source == maxButton) |
---|
| 2041 | + { |
---|
| 2042 | + Maximize(); |
---|
| 2043 | + } else |
---|
| 2044 | + if (source == fullButton) |
---|
| 2045 | + { |
---|
| 2046 | + ToggleFullScreen(); |
---|
| 2047 | + } else |
---|
| 2048 | + if (source == undoButton) |
---|
| 2049 | + { |
---|
| 2050 | + Undo(); |
---|
| 2051 | + } else |
---|
| 2052 | + if (source == redoButton) |
---|
| 2053 | + { |
---|
| 2054 | + Redo(); |
---|
| 2055 | + } else |
---|
| 2056 | + if (source == saveButton) |
---|
| 2057 | + { |
---|
| 2058 | + Save(); |
---|
| 2059 | + } else |
---|
| 2060 | + if (source == oneStepButton) |
---|
| 2061 | + { |
---|
| 2062 | + Globals.ONESTEP = true; |
---|
| 2063 | + cameraView.repaint(); |
---|
1843 | 2064 | } else |
---|
1844 | 2065 | if (source == screenfitButton) |
---|
1845 | 2066 | { |
---|
.. | .. |
---|
1890 | 2111 | { |
---|
1891 | 2112 | loadClipboard(true); |
---|
1892 | 2113 | } else |
---|
| 2114 | + if (source == undoItem) |
---|
| 2115 | + { |
---|
| 2116 | + Undo(); |
---|
| 2117 | + } else |
---|
| 2118 | + if (source == redoItem) |
---|
| 2119 | + { |
---|
| 2120 | + Redo(); |
---|
| 2121 | + } else |
---|
1893 | 2122 | if (source == duplicateItem) |
---|
1894 | 2123 | { |
---|
1895 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2124 | + Object3D keep = Grafreed.clipboard; |
---|
1896 | 2125 | loadClipboard(false); |
---|
1897 | 2126 | paste(false); |
---|
1898 | | - GrafreeD.clipboard = keep; |
---|
| 2127 | + Grafreed.clipboard = keep; |
---|
1899 | 2128 | } else |
---|
1900 | 2129 | if (source == cloneItem) |
---|
1901 | 2130 | { |
---|
.. | .. |
---|
1913 | 2142 | { |
---|
1914 | 2143 | paste(false); |
---|
1915 | 2144 | } else |
---|
| 2145 | + if (source == pasteIntoItem) |
---|
| 2146 | + { |
---|
| 2147 | + pasteInto(true, false); |
---|
| 2148 | + } else |
---|
1916 | 2149 | if (source == pasteLinkItem) |
---|
1917 | 2150 | { |
---|
1918 | | - pasteInto(false); |
---|
| 2151 | + pasteInto(false, false); |
---|
1919 | 2152 | } else |
---|
1920 | 2153 | if (source == pasteCloneItem) |
---|
1921 | 2154 | { |
---|
1922 | | - pasteInto(true); |
---|
| 2155 | + pasteInto(true, true); |
---|
1923 | 2156 | } else |
---|
1924 | 2157 | if (source == pasteExpandItem) |
---|
1925 | 2158 | { |
---|
.. | .. |
---|
2111 | 2344 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2112 | 2345 | // refreshContents(); |
---|
2113 | 2346 | // } |
---|
2114 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2347 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2115 | 2348 | { |
---|
2116 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2349 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2117 | 2350 | |
---|
2118 | 2351 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2119 | 2352 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2121 | 2354 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2122 | 2355 | for (int i=0; i<group.selection.size(); i++) |
---|
2123 | 2356 | { |
---|
2124 | | - boolean random = CameraPane.RANDOM; |
---|
2125 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2357 | + boolean random = CameraPane.SWITCH; |
---|
| 2358 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2126 | 2359 | group.selection.get(i).linkVerticesThis(content); |
---|
2127 | 2360 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2128 | | - CameraPane.RANDOM = random; |
---|
| 2361 | + CameraPane.SWITCH = random; |
---|
2129 | 2362 | } |
---|
2130 | 2363 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2131 | 2364 | refreshContents(); |
---|
.. | .. |
---|
2135 | 2368 | { |
---|
2136 | 2369 | for (int i=0; i<group.selection.size(); i++) |
---|
2137 | 2370 | { |
---|
2138 | | - boolean random = CameraPane.RANDOM; |
---|
2139 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2371 | + boolean random = CameraPane.SWITCH; |
---|
| 2372 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2140 | 2373 | group.selection.get(i).linkVerticesThis(null); |
---|
2141 | | - CameraPane.RANDOM = random; |
---|
| 2374 | + CameraPane.SWITCH = random; |
---|
2142 | 2375 | } |
---|
2143 | 2376 | |
---|
2144 | 2377 | refreshContents(); |
---|
2145 | 2378 | } else |
---|
2146 | 2379 | if (source == relinkverticesItem) |
---|
2147 | 2380 | { |
---|
2148 | | - boolean random = CameraPane.RANDOM; |
---|
2149 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2381 | + boolean random = CameraPane.SWITCH; |
---|
| 2382 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2150 | 2383 | group.selection.RelinkToSupport(); |
---|
2151 | | - CameraPane.RANDOM = random; |
---|
| 2384 | + CameraPane.SWITCH = random; |
---|
2152 | 2385 | |
---|
2153 | 2386 | refreshContents(); |
---|
2154 | 2387 | } else |
---|
.. | .. |
---|
2163 | 2396 | } else |
---|
2164 | 2397 | if (source == setMasterItem) |
---|
2165 | 2398 | { |
---|
2166 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2399 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2167 | 2400 | { |
---|
2168 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2401 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2169 | 2402 | |
---|
2170 | 2403 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2171 | 2404 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2178 | 2411 | { |
---|
2179 | 2412 | if (group.selection.size() == 1) |
---|
2180 | 2413 | { |
---|
2181 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2414 | + if (Grafreed.clipboard.size() == 1) |
---|
2182 | 2415 | { |
---|
2183 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2416 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2184 | 2417 | |
---|
2185 | 2418 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2186 | 2419 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2197 | 2430 | { |
---|
2198 | 2431 | RevertMeshes(); |
---|
2199 | 2432 | } else |
---|
2200 | | - if (source == resetMeshItem) |
---|
| 2433 | + if (source == resetAllItem) |
---|
2201 | 2434 | { |
---|
2202 | 2435 | ResetAll(); |
---|
2203 | 2436 | } else |
---|
.. | .. |
---|
2246 | 2479 | RandomNode random = new RandomNode(); |
---|
2247 | 2480 | group(random); |
---|
2248 | 2481 | if (random.size() > 0) |
---|
2249 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2482 | + random.name = random.get(0).name + "Switch"; |
---|
2250 | 2483 | } else |
---|
2251 | 2484 | if (source == physicsItem) |
---|
2252 | 2485 | { |
---|
.. | .. |
---|
2385 | 2618 | } else |
---|
2386 | 2619 | if (source == genNormalsMESHItem) |
---|
2387 | 2620 | { |
---|
2388 | | - GenNormals(true); // TODO |
---|
| 2621 | + GenNormalsMESH(); |
---|
2389 | 2622 | } else |
---|
2390 | 2623 | if (source == genNormalsORGANItem) |
---|
2391 | 2624 | { |
---|
.. | .. |
---|
2450 | 2683 | if (source == unmarkleavesItem) |
---|
2451 | 2684 | { |
---|
2452 | 2685 | MarkLeaves(false); |
---|
| 2686 | + } else |
---|
| 2687 | + if (source == rewindleavesItem) |
---|
| 2688 | + { |
---|
| 2689 | + RewindLeaves(true); |
---|
| 2690 | + } else |
---|
| 2691 | + if (source == unrewindleavesItem) |
---|
| 2692 | + { |
---|
| 2693 | + RewindLeaves(false); |
---|
| 2694 | + } else |
---|
| 2695 | + if (source == randomleavesItem) |
---|
| 2696 | + { |
---|
| 2697 | + RandomLeaves(true); |
---|
| 2698 | + } else |
---|
| 2699 | + if (source == unrandomleavesItem) |
---|
| 2700 | + { |
---|
| 2701 | + RandomLeaves(false); |
---|
2453 | 2702 | } else |
---|
2454 | 2703 | if (source == flipVItem) |
---|
2455 | 2704 | { |
---|
.. | .. |
---|
2535 | 2784 | { |
---|
2536 | 2785 | SmoothMesh(); |
---|
2537 | 2786 | } else |
---|
2538 | | - if (source == transformgeometryItem) |
---|
| 2787 | + if (source == transformGeometryItem) |
---|
2539 | 2788 | { |
---|
2540 | 2789 | TransformGeometry(); |
---|
| 2790 | + } else |
---|
| 2791 | + if (source == transformChildrenItem) |
---|
| 2792 | + { |
---|
| 2793 | + TransformChildren(); |
---|
2541 | 2794 | } else |
---|
2542 | 2795 | if (source == resetTransformItem) |
---|
2543 | 2796 | { |
---|
.. | .. |
---|
2545 | 2798 | } else |
---|
2546 | 2799 | if (source == resetCentroidItem) |
---|
2547 | 2800 | { |
---|
2548 | | - ResetCentroid(); |
---|
| 2801 | + ResetCentroid(true); |
---|
| 2802 | + } else |
---|
| 2803 | + if (source == resetCentroidXZItem) |
---|
| 2804 | + { |
---|
| 2805 | + ResetCentroid(false); |
---|
2549 | 2806 | } else |
---|
2550 | 2807 | if (source == resetParentItem) |
---|
2551 | 2808 | { |
---|
.. | .. |
---|
2709 | 2966 | bigThree.ClearUI(); |
---|
2710 | 2967 | bigThree.add(centralPanel); |
---|
2711 | 2968 | bigThree.FlushUI(); |
---|
| 2969 | + |
---|
| 2970 | + cameraView.requestFocusInWindow(); |
---|
| 2971 | + |
---|
| 2972 | +// refreshContents(true); |
---|
| 2973 | +// |
---|
| 2974 | +// try |
---|
| 2975 | +// { |
---|
| 2976 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2977 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2978 | +// bot.mouseMove(100, 100); |
---|
| 2979 | +// bot.mousePress(mask); |
---|
| 2980 | +// bot.mouseRelease(mask); |
---|
| 2981 | +// } |
---|
| 2982 | +// catch (Exception e) |
---|
| 2983 | +// { |
---|
| 2984 | +// |
---|
| 2985 | +// } |
---|
| 2986 | + |
---|
2712 | 2987 | } else |
---|
2713 | 2988 | if (source == threeButton) |
---|
2714 | 2989 | { |
---|
.. | .. |
---|
2745 | 3020 | bigThree.add(centralPanel); |
---|
2746 | 3021 | bigThree.add(XYZPanel); |
---|
2747 | 3022 | bigThree.FlushUI(); |
---|
| 3023 | + |
---|
| 3024 | + cameraView.requestFocusInWindow(); |
---|
2748 | 3025 | } else |
---|
2749 | 3026 | if (source == fourButton) |
---|
2750 | 3027 | { |
---|
.. | .. |
---|
2780 | 3057 | bigThree.ClearUI(); |
---|
2781 | 3058 | bigThree.add(scenePanel); |
---|
2782 | 3059 | bigThree.FlushUI(); |
---|
| 3060 | + |
---|
| 3061 | + cameraView.requestFocusInWindow(); |
---|
2783 | 3062 | } else |
---|
2784 | 3063 | if (source == sixButton) |
---|
2785 | 3064 | { |
---|
.. | .. |
---|
2816 | 3095 | bigThree.add(scenePanel); |
---|
2817 | 3096 | bigThree.add(centralPanel); |
---|
2818 | 3097 | bigThree.FlushUI(); |
---|
| 3098 | + |
---|
| 3099 | + cameraView.requestFocusInWindow(); |
---|
2819 | 3100 | } else |
---|
2820 | 3101 | if (source == sevenButton) |
---|
2821 | 3102 | { |
---|
.. | .. |
---|
2853 | 3134 | bigThree.add(centralPanel); |
---|
2854 | 3135 | bigThree.add(XYZPanel); |
---|
2855 | 3136 | bigThree.FlushUI(); |
---|
| 3137 | + |
---|
| 3138 | + cameraView.requestFocusInWindow(); |
---|
2856 | 3139 | } else |
---|
2857 | 3140 | if (source == rootButton) |
---|
2858 | 3141 | { |
---|
.. | .. |
---|
2864 | 3147 | EditObject(obj); |
---|
2865 | 3148 | } |
---|
2866 | 3149 | |
---|
| 3150 | + cameraView.requestFocusInWindow(); |
---|
2867 | 3151 | refreshContents(true); |
---|
2868 | 3152 | } else |
---|
2869 | 3153 | if (source == closeButton) |
---|
.. | .. |
---|
2873 | 3157 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2874 | 3158 | { |
---|
2875 | 3159 | ab = (cRadio)e.nextElement(); |
---|
2876 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3160 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2877 | 3161 | { |
---|
| 3162 | + // Patch to avoid bug with transparency. |
---|
| 3163 | + if (!ab.hadMaterial) |
---|
| 3164 | + { |
---|
| 3165 | + ab.object.material = null; |
---|
| 3166 | + } |
---|
| 3167 | + |
---|
2878 | 3168 | buttonGroup.remove(ab); |
---|
2879 | 3169 | radioPanel.remove(ab); |
---|
2880 | 3170 | |
---|
2881 | | - ab.GetObject().editWindow = null; |
---|
| 3171 | + //ab.GetObject().editWindow = null; |
---|
| 3172 | + ab.GetObject().manipWindow = null; |
---|
2882 | 3173 | // ab.GetObject().objectUI = null; // ????????? |
---|
2883 | 3174 | |
---|
2884 | 3175 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2885 | 3176 | break; |
---|
2886 | 3177 | } |
---|
2887 | 3178 | } |
---|
| 3179 | + |
---|
| 3180 | + cameraView.requestFocusInWindow(); |
---|
2888 | 3181 | refreshContents(true); |
---|
2889 | 3182 | } else |
---|
2890 | 3183 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
2901 | 3194 | child.CloseUI(); |
---|
2902 | 3195 | listUI.remove(child); |
---|
2903 | 3196 | |
---|
2904 | | - child.editWindow = null; // ??????????? |
---|
| 3197 | + //child.editWindow = null; // ??????????? |
---|
2905 | 3198 | } |
---|
2906 | | - objEditor.ctrlPanel.validate(); |
---|
| 3199 | + objEditor.ctrlPanel.FlushUI(); |
---|
2907 | 3200 | //objEditor.jTree.clearSelection(); |
---|
2908 | 3201 | //objEditor.ResetSliders(); |
---|
2909 | 3202 | refreshContents(true); |
---|
.. | .. |
---|
2987 | 3280 | frontView.object = group; |
---|
2988 | 3281 | sideView.object = group; |
---|
2989 | 3282 | } |
---|
2990 | | - group.editWindow = this; |
---|
| 3283 | + |
---|
| 3284 | +// fix "+" issue |
---|
| 3285 | + //group.editWindow = this; |
---|
| 3286 | + group.manipWindow = this; |
---|
| 3287 | + |
---|
2991 | 3288 | /* |
---|
2992 | 3289 | currentLayout = radio.layout; |
---|
2993 | 3290 | if (currentLayout == null) |
---|
.. | .. |
---|
2999 | 3296 | //group.parent = null; // ROOT |
---|
3000 | 3297 | //group.attributes = -1; |
---|
3001 | 3298 | ResetModel(); |
---|
| 3299 | + |
---|
| 3300 | + cameraView.requestFocusInWindow(); |
---|
3002 | 3301 | refreshContents(true); |
---|
3003 | | - } |
---|
| 3302 | + } else if (event.getSource() == editCameraItem) |
---|
| 3303 | + { |
---|
| 3304 | + cameraView.ProtectCamera(); |
---|
| 3305 | + cameraView.repaint(); |
---|
| 3306 | + return; |
---|
| 3307 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3308 | + { |
---|
| 3309 | + cameraView.RevertCamera(); |
---|
| 3310 | + cameraView.repaint(); |
---|
| 3311 | + return; |
---|
| 3312 | + // } else if (event.getSource() == textureButton) |
---|
| 3313 | + // { |
---|
| 3314 | + // return; // true; |
---|
| 3315 | + } |
---|
3004 | 3316 | else |
---|
3005 | 3317 | { |
---|
3006 | 3318 | //return super.action(event, arg); |
---|
.. | .. |
---|
3009 | 3321 | } |
---|
3010 | 3322 | |
---|
3011 | 3323 | boolean useclient = false; |
---|
3012 | | - cRadio radio; |
---|
3013 | 3324 | |
---|
3014 | 3325 | void ToggleRoot() |
---|
3015 | 3326 | { |
---|
.. | .. |
---|
3061 | 3372 | refreshContents(); |
---|
3062 | 3373 | } |
---|
3063 | 3374 | |
---|
| 3375 | + void TransformChildren() |
---|
| 3376 | + { |
---|
| 3377 | + Object3D obj; |
---|
| 3378 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3379 | + { |
---|
| 3380 | + obj = (Object3D)e.nextElement(); |
---|
| 3381 | + obj.KeepTextureMatrices(); |
---|
| 3382 | + obj.TransformChildren(); |
---|
| 3383 | + obj.RestoreTextureMatrices(); |
---|
| 3384 | + |
---|
| 3385 | +// if (obj.parent == null) |
---|
| 3386 | +// { |
---|
| 3387 | +// System.out.println("NULL PARENT!"); |
---|
| 3388 | +// new Exception().printStackTrace(); |
---|
| 3389 | +// } |
---|
| 3390 | +// else |
---|
| 3391 | +// TouchTransform(obj); |
---|
| 3392 | +// //obj.parent.Touch(); |
---|
| 3393 | + } |
---|
| 3394 | + |
---|
| 3395 | + refreshContents(); |
---|
| 3396 | + } |
---|
3064 | 3397 | |
---|
3065 | 3398 | void ResetTransform() |
---|
3066 | 3399 | { |
---|
.. | .. |
---|
3173 | 3506 | refreshContents(); |
---|
3174 | 3507 | } |
---|
3175 | 3508 | |
---|
3176 | | - void ResetCentroid() |
---|
| 3509 | + void ResetCentroid(boolean full) |
---|
3177 | 3510 | { |
---|
3178 | 3511 | Object3D obj; |
---|
3179 | 3512 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3188 | 3521 | LA.matIdentity(Object3D.mat); |
---|
3189 | 3522 | obj.getBounds(minima, maxima, false); |
---|
3190 | 3523 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3191 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3524 | + if (full) |
---|
| 3525 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3192 | 3526 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3193 | 3527 | obj.TransformMesh(Object3D.mat); |
---|
| 3528 | + |
---|
3194 | 3529 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3195 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3530 | + if (full) |
---|
| 3531 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3196 | 3532 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3533 | + |
---|
3197 | 3534 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3198 | 3535 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3199 | 3536 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3222 | 3559 | |
---|
3223 | 3560 | int size = obj.MemorySize(); |
---|
3224 | 3561 | |
---|
3225 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3562 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3563 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3226 | 3564 | } |
---|
3227 | 3565 | } |
---|
3228 | 3566 | catch (Exception e) |
---|
.. | .. |
---|
3259 | 3597 | obj = (Object3D)e.nextElement(); |
---|
3260 | 3598 | |
---|
3261 | 3599 | System.out.println("Object is: " + obj); |
---|
3262 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3600 | + Grafreed.AnalyzeObject(obj); |
---|
3263 | 3601 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3264 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3602 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3265 | 3603 | |
---|
3266 | 3604 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3267 | 3605 | } |
---|
.. | .. |
---|
3303 | 3641 | void GenNormals(boolean crease) |
---|
3304 | 3642 | { |
---|
3305 | 3643 | group.GenNormalsS(crease); |
---|
| 3644 | + |
---|
| 3645 | + refreshContents(); |
---|
| 3646 | + } |
---|
| 3647 | + |
---|
| 3648 | + void GenNormalsMESH() |
---|
| 3649 | + { |
---|
| 3650 | + group.GenNormalsMeshS(); |
---|
3306 | 3651 | |
---|
3307 | 3652 | refreshContents(); |
---|
3308 | 3653 | } |
---|
.. | .. |
---|
3475 | 3820 | |
---|
3476 | 3821 | void ParseVertices() |
---|
3477 | 3822 | { |
---|
3478 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3479 | | - GrafreeD.epsequal = true; |
---|
| 3823 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3824 | + Grafreed.epsequal = true; |
---|
3480 | 3825 | |
---|
3481 | 3826 | for (int i=0; i<group.selection.size(); i++) |
---|
3482 | 3827 | { |
---|
.. | .. |
---|
3501 | 3846 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3502 | 3847 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3503 | 3848 | |
---|
3504 | | - g.add(GrafreeD.clipboard); |
---|
| 3849 | + g.add(Grafreed.clipboard); |
---|
3505 | 3850 | |
---|
3506 | 3851 | buffer.add(g); |
---|
3507 | 3852 | } |
---|
.. | .. |
---|
3516 | 3861 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3517 | 3862 | } |
---|
3518 | 3863 | |
---|
3519 | | - GrafreeD.epsequal = epsequal; |
---|
| 3864 | + Grafreed.epsequal = epsequal; |
---|
3520 | 3865 | |
---|
3521 | 3866 | refreshContents(); |
---|
3522 | 3867 | } |
---|
.. | .. |
---|
3534 | 3879 | String pigment = Object3D.GetPigment(tex); |
---|
3535 | 3880 | //String bump = Object3D.GetBump(tex); |
---|
3536 | 3881 | |
---|
3537 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3882 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3883 | + |
---|
| 3884 | + try |
---|
| 3885 | + { |
---|
| 3886 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3887 | + } |
---|
| 3888 | + catch (Exception e) |
---|
| 3889 | + { |
---|
| 3890 | + System.err.println("FAIL: " + node); |
---|
| 3891 | + } |
---|
3538 | 3892 | |
---|
3539 | 3893 | double s = v.s; |
---|
3540 | 3894 | |
---|
.. | .. |
---|
3622 | 3976 | |
---|
3623 | 3977 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3624 | 3978 | |
---|
3625 | | - boolean random = CameraPane.RANDOM; |
---|
3626 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3979 | + boolean random = CameraPane.SWITCH; |
---|
| 3980 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3627 | 3981 | lowres.linkVerticesThis(null); |
---|
3628 | 3982 | lowres.linkVerticesThis(sn); |
---|
3629 | | - CameraPane.RANDOM = random; |
---|
| 3983 | + CameraPane.SWITCH = random; |
---|
3630 | 3984 | |
---|
3631 | 3985 | System.err.flush(); |
---|
3632 | 3986 | |
---|
.. | .. |
---|
3666 | 4020 | return; |
---|
3667 | 4021 | |
---|
3668 | 4022 | Object3D poses = group.selection.get(0); |
---|
3669 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4023 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3670 | 4024 | |
---|
3671 | 4025 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3672 | 4026 | |
---|
.. | .. |
---|
3860 | 4214 | |
---|
3861 | 4215 | void ClipMesh() |
---|
3862 | 4216 | { |
---|
3863 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4217 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3864 | 4218 | { |
---|
3865 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4219 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3866 | 4220 | |
---|
3867 | 4221 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3868 | 4222 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3871 | 4225 | // { |
---|
3872 | 4226 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3873 | 4227 | // } |
---|
3874 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4228 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3875 | 4229 | } |
---|
3876 | 4230 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3877 | 4231 | System.out.println("DONE."); |
---|
.. | .. |
---|
3918 | 4272 | void MarkLeaves(boolean hide) |
---|
3919 | 4273 | { |
---|
3920 | 4274 | group.selection.MarkLeaves(hide); |
---|
| 4275 | + refreshContents(); |
---|
| 4276 | + } |
---|
| 4277 | + |
---|
| 4278 | + void RewindLeaves(boolean hide) |
---|
| 4279 | + { |
---|
| 4280 | + group.selection.RewindLeaves(hide); |
---|
| 4281 | + refreshContents(); |
---|
| 4282 | + } |
---|
| 4283 | + |
---|
| 4284 | + void RandomLeaves(boolean hide) |
---|
| 4285 | + { |
---|
| 4286 | + group.selection.RandomLeaves(hide); |
---|
3921 | 4287 | refreshContents(); |
---|
3922 | 4288 | } |
---|
3923 | 4289 | |
---|
.. | .. |
---|
4006 | 4372 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4007 | 4373 | |
---|
4008 | 4374 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4009 | | - if(elem != group) |
---|
| 4375 | + if(elem != group || !newWindow) |
---|
4010 | 4376 | { |
---|
4011 | 4377 | // if (!(elem instanceof Composite)) |
---|
4012 | 4378 | // newWindow = false; |
---|
.. | .. |
---|
4096 | 4462 | //case 702: // Event.LIST_DESELECT |
---|
4097 | 4463 | group.deselectAll(); |
---|
4098 | 4464 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4099 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4100 | 4465 | if (tps != null) |
---|
4101 | 4466 | { |
---|
4102 | 4467 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4105 | 4470 | |
---|
4106 | 4471 | //if (child.parent != null) |
---|
4107 | 4472 | //child.parent.addSelectee(child); |
---|
| 4473 | + objEditor.SetMaterial(child); |
---|
4108 | 4474 | group.addSelectee(child); |
---|
4109 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4110 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4111 | | - System.err.println("info : " + child.GetPath()); |
---|
4112 | 4475 | } |
---|
4113 | 4476 | } |
---|
4114 | 4477 | // else |
---|
.. | .. |
---|
4118 | 4481 | // System.err.println("info : " + group.GetPath()); |
---|
4119 | 4482 | // } |
---|
4120 | 4483 | |
---|
4121 | | - objEditor.SetText(); // jan 2014 |
---|
4122 | | - |
---|
4123 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4484 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4124 | 4485 | CameraPane.flash = true; |
---|
4125 | 4486 | |
---|
4126 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4487 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4127 | 4488 | // a camera |
---|
4128 | 4489 | { |
---|
4129 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4130 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4490 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4491 | + { |
---|
| 4492 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4493 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4494 | + } |
---|
4131 | 4495 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4132 | 4496 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4133 | 4497 | } |
---|
.. | .. |
---|
4140 | 4504 | |
---|
4141 | 4505 | freezemodel = false; |
---|
4142 | 4506 | } |
---|
| 4507 | + |
---|
| 4508 | + void refreshContents(boolean cp) |
---|
| 4509 | + { |
---|
| 4510 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4511 | + { |
---|
| 4512 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4513 | + |
---|
| 4514 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4515 | + { |
---|
| 4516 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4517 | + |
---|
| 4518 | + objEditor.AddInfo(child, this, true); |
---|
| 4519 | + System.err.println("info : " + child.GetPath()); |
---|
| 4520 | + } |
---|
| 4521 | + |
---|
| 4522 | + objEditor.SetText(); // jan 2014 |
---|
| 4523 | + } |
---|
| 4524 | + |
---|
| 4525 | + super.refreshContents(cp); |
---|
| 4526 | + } |
---|
4143 | 4527 | |
---|
4144 | 4528 | void linkSomething(Object3D thing) |
---|
4145 | 4529 | { |
---|
.. | .. |
---|
4211 | 4595 | { |
---|
4212 | 4596 | if (group.selection.isEmpty()) |
---|
4213 | 4597 | return; |
---|
4214 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4598 | + |
---|
| 4599 | + Grafreed.clipboardIsTempGroup = false; |
---|
4215 | 4600 | Composite tGroup = null; |
---|
4216 | 4601 | if (group.selection.size() > 0) // 1) |
---|
4217 | 4602 | { |
---|
4218 | 4603 | tGroup = new cGroup(); |
---|
4219 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4604 | + Grafreed.clipboardIsTempGroup = true; |
---|
4220 | 4605 | } |
---|
4221 | 4606 | |
---|
4222 | 4607 | if (cut) |
---|
4223 | 4608 | { |
---|
| 4609 | + if (Globals.SAVEONMAKE) |
---|
| 4610 | + Save(); |
---|
4224 | 4611 | //int indices[] = jList.getSelectedIndices(); |
---|
4225 | 4612 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4226 | 4613 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4256 | 4643 | //System.out.println("cut " + child); |
---|
4257 | 4644 | //System.out.println("parent = " + child.parent); |
---|
4258 | 4645 | // tmp.addChild(child); |
---|
4259 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4646 | + if (Grafreed.clipboardIsTempGroup) |
---|
4260 | 4647 | tGroup.add/*Child*/(tmp); |
---|
4261 | 4648 | else |
---|
4262 | | - GrafreeD.clipboard = tmp; |
---|
| 4649 | + Grafreed.clipboard = tmp; |
---|
4263 | 4650 | } |
---|
4264 | 4651 | else |
---|
4265 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4652 | + if (Grafreed.clipboardIsTempGroup) |
---|
4266 | 4653 | tGroup.add/*Child*/(child); |
---|
4267 | 4654 | else |
---|
4268 | | - GrafreeD.clipboard = child; |
---|
| 4655 | + Grafreed.clipboard = child; |
---|
4269 | 4656 | } |
---|
4270 | 4657 | |
---|
4271 | 4658 | //ResetModel(); |
---|
.. | .. |
---|
4297 | 4684 | //System.out.println("cut " + elem); |
---|
4298 | 4685 | //System.out.println("parent = " + elem.parent); |
---|
4299 | 4686 | // tmp.addChild(elem); |
---|
4300 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4687 | + if (Grafreed.clipboardIsTempGroup) |
---|
4301 | 4688 | tGroup.add/*Child*/(tmp); |
---|
4302 | 4689 | else |
---|
4303 | | - GrafreeD.clipboard = tmp; |
---|
| 4690 | + Grafreed.clipboard = tmp; |
---|
4304 | 4691 | } |
---|
4305 | 4692 | else |
---|
4306 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4693 | + if (Grafreed.clipboardIsTempGroup) |
---|
4307 | 4694 | tGroup.add/*Child*/(child); |
---|
4308 | 4695 | else |
---|
4309 | | - GrafreeD.clipboard = child; |
---|
| 4696 | + Grafreed.clipboard = child; |
---|
4310 | 4697 | } |
---|
4311 | 4698 | |
---|
4312 | 4699 | } |
---|
4313 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4314 | | - GrafreeD.clipboard = tGroup; |
---|
| 4700 | + |
---|
| 4701 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4702 | + Grafreed.clipboard = tGroup; |
---|
| 4703 | + |
---|
4315 | 4704 | if (cut) |
---|
4316 | 4705 | { |
---|
4317 | 4706 | ResetModel(); |
---|
.. | .. |
---|
4325 | 4714 | // return; |
---|
4326 | 4715 | boolean first = true; |
---|
4327 | 4716 | |
---|
4328 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4717 | + if (Grafreed.clipboardIsTempGroup) |
---|
4329 | 4718 | { |
---|
4330 | 4719 | Composite temp; |
---|
4331 | 4720 | |
---|
.. | .. |
---|
4336 | 4725 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4337 | 4726 | */ |
---|
4338 | 4727 | Object3D elem; |
---|
4339 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4728 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4340 | 4729 | { |
---|
4341 | 4730 | Object3D child = (Object3D)e.nextElement(); |
---|
4342 | 4731 | |
---|
.. | .. |
---|
4370 | 4759 | //Object3D cb = Applet3D.clipboard; |
---|
4371 | 4760 | //temp.addChild(cb); |
---|
4372 | 4761 | //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()); |
---|
| 4762 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4763 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4764 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4765 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4766 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4378 | 4767 | else |
---|
4379 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4380 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4768 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4769 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4381 | 4770 | } |
---|
4382 | 4771 | |
---|
4383 | 4772 | ResetModel(); |
---|
4384 | 4773 | refreshContents(); |
---|
4385 | 4774 | } |
---|
4386 | 4775 | |
---|
4387 | | - void pasteInto(boolean copyit) |
---|
| 4776 | + void pasteInto(boolean copyit, boolean clone) |
---|
4388 | 4777 | { |
---|
4389 | 4778 | // if (GrafreeD.clipboard == null) |
---|
4390 | 4779 | // return; |
---|
.. | .. |
---|
4413 | 4802 | if (copyit) |
---|
4414 | 4803 | { |
---|
4415 | 4804 | // paste(false); |
---|
4416 | | - CloneClipboard(false); // sept 2014 |
---|
| 4805 | + if (clone) |
---|
| 4806 | + { |
---|
| 4807 | + CloneClipboard(false); // sept 2014 |
---|
| 4808 | + } |
---|
| 4809 | + else |
---|
| 4810 | + { |
---|
| 4811 | + paste(false); |
---|
| 4812 | + } |
---|
4417 | 4813 | } |
---|
4418 | 4814 | else |
---|
4419 | 4815 | { |
---|
4420 | 4816 | boolean first = true; |
---|
4421 | 4817 | |
---|
4422 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4818 | + if (Grafreed.clipboardIsTempGroup) |
---|
4423 | 4819 | { |
---|
4424 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4820 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4425 | 4821 | Object3D copy; |
---|
4426 | 4822 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4427 | 4823 | { |
---|
.. | .. |
---|
4431 | 4827 | } |
---|
4432 | 4828 | } else |
---|
4433 | 4829 | { |
---|
4434 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4830 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4435 | 4831 | } |
---|
4436 | 4832 | } |
---|
4437 | 4833 | } |
---|
.. | .. |
---|
4836 | 5232 | } |
---|
4837 | 5233 | */ |
---|
4838 | 5234 | |
---|
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 | | - |
---|
4854 | 5235 | /* |
---|
4855 | 5236 | public void Callback(Object obj) |
---|
4856 | 5237 | { |
---|
.. | .. |
---|
4874 | 5255 | } |
---|
4875 | 5256 | */ |
---|
4876 | 5257 | |
---|
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 | | - |
---|
4894 | 5258 | String GetFile(String dialogName) |
---|
4895 | 5259 | { |
---|
4896 | | - if (GrafreeD.standAlone) |
---|
| 5260 | + if (Grafreed.standAlone) |
---|
4897 | 5261 | { |
---|
4898 | 5262 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4899 | 5263 | browser.show(); |
---|
.. | .. |
---|
4957 | 5321 | cButton flashSelectionButton; |
---|
4958 | 5322 | cButton editButton; |
---|
4959 | 5323 | cButton uneditButton; |
---|
| 5324 | + JCheckBox allParamsButton; |
---|
4960 | 5325 | cButton clearpanelButton; |
---|
4961 | | - cButton allParamsButton; |
---|
4962 | 5326 | cButton unselectButton; |
---|
4963 | 5327 | |
---|
| 5328 | + cButton minButton; |
---|
| 5329 | + cButton maxButton; |
---|
| 5330 | + cButton fullButton; |
---|
| 5331 | + cButton undoButton; |
---|
| 5332 | + cButton redoButton; |
---|
| 5333 | + cButton saveButton; |
---|
| 5334 | + cButton oneStepButton; |
---|
| 5335 | + |
---|
4964 | 5336 | cButton screenfitButton; |
---|
4965 | 5337 | cButton screenfitpointButton; |
---|
4966 | 5338 | cButton snapobjectButton; |
---|
.. | .. |
---|
4971 | 5343 | cButton closeButton; |
---|
4972 | 5344 | |
---|
4973 | 5345 | cButton setsupportButton; |
---|
4974 | | - |
---|
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 | 5346 | |
---|
4983 | 5347 | // |
---|
4984 | 5348 | //Composite |
---|
.. | .. |
---|
4991 | 5355 | private MenuItem lookFromItem; |
---|
4992 | 5356 | private MenuItem switchItem; |
---|
4993 | 5357 | private MenuItem cutItem; |
---|
| 5358 | + private MenuItem undoItem; |
---|
| 5359 | + private MenuItem redoItem; |
---|
4994 | 5360 | private MenuItem duplicateItem; |
---|
4995 | 5361 | private MenuItem cloneItem; |
---|
4996 | 5362 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5004 | 5370 | private MenuItem linkverticesItem; |
---|
5005 | 5371 | private MenuItem relinkverticesItem; |
---|
5006 | 5372 | private MenuItem setMasterItem; |
---|
5007 | | - private MenuItem resetMeshItem; |
---|
| 5373 | + private MenuItem resetAllItem; |
---|
5008 | 5374 | private MenuItem stepAllItem; |
---|
5009 | 5375 | private MenuItem revertMeshItem; |
---|
5010 | 5376 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5015 | 5381 | private MenuItem mergeGeometriesItem; |
---|
5016 | 5382 | private MenuItem copyItem; |
---|
5017 | 5383 | private MenuItem pasteItem; |
---|
| 5384 | + private MenuItem pasteIntoItem; |
---|
5018 | 5385 | private MenuItem pasteLinkItem; |
---|
5019 | 5386 | private MenuItem pasteCloneItem; |
---|
5020 | 5387 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5053 | 5420 | private MenuItem showleavesItem; |
---|
5054 | 5421 | private MenuItem markleavesItem; |
---|
5055 | 5422 | private MenuItem unmarkleavesItem; |
---|
| 5423 | + private MenuItem rewindleavesItem; |
---|
| 5424 | + private MenuItem unrewindleavesItem; |
---|
| 5425 | + private MenuItem randomleavesItem; |
---|
| 5426 | + private MenuItem unrandomleavesItem; |
---|
5056 | 5427 | |
---|
5057 | 5428 | private MenuItem flipVItem; |
---|
5058 | 5429 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5064 | 5435 | private MenuItem panoTexturesItem; |
---|
5065 | 5436 | |
---|
5066 | 5437 | private MenuItem resetCentroidItem; |
---|
5067 | | - private MenuItem transformgeometryItem; |
---|
| 5438 | + private MenuItem resetCentroidXZItem; |
---|
5068 | 5439 | private MenuItem resetTransformItem; |
---|
| 5440 | + private MenuItem transformGeometryItem; |
---|
| 5441 | + private MenuItem transformChildrenItem; |
---|
5069 | 5442 | private MenuItem hideItem; |
---|
5070 | 5443 | private MenuItem grabItem; |
---|
5071 | 5444 | private MenuItem backItem; |
---|
.. | .. |
---|
5112 | 5485 | private MenuItem blobItem; |
---|
5113 | 5486 | private MenuItem latheItem; |
---|
5114 | 5487 | private MenuItem bezierItem; |
---|
5115 | | - private MenuItem checkerItem; |
---|
| 5488 | + private MenuItem overlayItem; |
---|
5116 | 5489 | private MenuItem meshItem; |
---|
5117 | 5490 | // private MenuItem meshGroupItem; |
---|
5118 | 5491 | private MenuItem springItem; |
---|
.. | .. |
---|
5134 | 5507 | private MenuItem doubleItem; |
---|
5135 | 5508 | private MenuItem tripleItem; |
---|
5136 | 5509 | |
---|
5137 | | - private MenuItem importGFDItem; |
---|
5138 | | - private MenuItem importVRMLX3DItem; |
---|
5139 | | - private MenuItem import3DSItem; |
---|
5140 | | - private MenuItem importOBJItem; |
---|
5141 | | - |
---|
5142 | 5510 | private MenuItem computeAOItem; |
---|
5143 | 5511 | private MenuItem recompileItem; |
---|
5144 | 5512 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5148 | 5516 | private MenuItem analyzeItem; |
---|
5149 | 5517 | private MenuItem dumpItem; |
---|
5150 | 5518 | //boolean freezemodel = false; |
---|
| 5519 | + |
---|
| 5520 | + Menu cameraMenu; |
---|
| 5521 | + MenuItem editCameraItem; |
---|
| 5522 | + MenuItem revertCameraItem; |
---|
5151 | 5523 | } |
---|