.. | .. |
---|
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 | + undoItem = menu.add(new MenuItem("Undo")); |
---|
| 158 | + undoItem.addActionListener(this); |
---|
| 159 | + redoItem = menu.add(new MenuItem("Redo")); |
---|
| 160 | + redoItem.addActionListener(this); |
---|
| 161 | + menu.add("-"); |
---|
| 162 | + duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 163 | + duplicateItem.addActionListener(this); |
---|
| 164 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 165 | + cloneItem.addActionListener(this); |
---|
| 166 | + if (Globals.ADVANCED) |
---|
| 167 | + { |
---|
| 168 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 169 | + cloneSupportItem.addActionListener(this); |
---|
| 170 | + } |
---|
| 171 | + menu.add("-"); |
---|
| 172 | + cutItem = menu.add(new MenuItem("Cut")); |
---|
| 173 | + cutItem.addActionListener(this); |
---|
| 174 | + copyItem = menu.add(new MenuItem("Copy")); |
---|
| 175 | + copyItem.addActionListener(this); |
---|
| 176 | + pasteItem = menu.add(new MenuItem("Paste")); |
---|
| 177 | + pasteItem.addActionListener(this); |
---|
| 178 | + menu.add("-"); |
---|
| 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 Camera")); |
---|
| 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(CameraPane.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 Camera")); |
---|
| 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")); |
---|
.. | .. |
---|
269 | 374 | shadowYItem.addActionListener(this); |
---|
270 | 375 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
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")); |
---|
.. | .. |
---|
377 | 504 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
378 | 505 | sortbynameItem.addActionListener(this); |
---|
379 | 506 | menu.add("-"); |
---|
| 507 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 508 | + shareGeometriesItem.addActionListener(this); |
---|
| 509 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 510 | + mergeGeometriesItem.addActionListener(this); |
---|
| 511 | + if (Globals.ADVANCED) |
---|
| 512 | + { |
---|
| 513 | + // Pretty much the same as duplicate and clone. |
---|
380 | 514 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
381 | 515 | extractGeometriesItem.addActionListener(this); |
---|
382 | 516 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
383 | 517 | 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); |
---|
| 518 | + } |
---|
388 | 519 | |
---|
389 | 520 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
390 | 521 | buildCreateMenu(menu); |
---|
391 | 522 | |
---|
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 | 523 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
404 | 524 | buildToolsMenu(menu); |
---|
405 | 525 | } |
---|
.. | .. |
---|
437 | 557 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
438 | 558 | |
---|
439 | 559 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
440 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 560 | + liveCB.setToolTipText("Enable animation"); |
---|
441 | 561 | liveCB.addItemListener(this); |
---|
442 | 562 | |
---|
| 563 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 564 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 565 | + oneStepButton.addActionListener(this); |
---|
| 566 | + |
---|
443 | 567 | oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
444 | 568 | fastCB.setToolTipText("Fast mode"); |
---|
445 | 569 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
448 | 572 | trackCB.setToolTipText("Enable tracking"); |
---|
449 | 573 | trackCB.addItemListener(this); |
---|
450 | 574 | |
---|
451 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 575 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
452 | 576 | screenfitButton.setToolTipText("Screen fit"); |
---|
453 | 577 | screenfitButton.addActionListener(this); |
---|
454 | 578 | |
---|
455 | 579 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
456 | 580 | // screenfitpointButton.addActionListener(this); |
---|
457 | | -// oe.aConstraints.gridx += 1; |
---|
458 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
459 | | - snapobjectButton.addActionListener(this); |
---|
460 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
461 | | - oe.aConstraints.gridx += 1; |
---|
462 | 581 | |
---|
463 | | - //aConstraints.gridx = 0; |
---|
464 | | - //aConstraints.gridy += 1; |
---|
465 | | - oe.aConstraints.weighty = 0; |
---|
466 | | - oe.aConstraints.gridwidth = 1; |
---|
467 | | - |
---|
468 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 582 | + if (Globals.ADVANCED) |
---|
| 583 | + { |
---|
| 584 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 585 | + snapobjectButton.addActionListener(this); |
---|
| 586 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 587 | + } |
---|
| 588 | + |
---|
| 589 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
469 | 590 | flashSelectionButton.setToolTipText("Show selection"); |
---|
470 | 591 | flashSelectionButton.addActionListener(this); |
---|
471 | 592 | |
---|
472 | 593 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
473 | 594 | |
---|
474 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 595 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
475 | 596 | twoButton.setToolTipText("Show center view only"); |
---|
476 | 597 | twoButton.addActionListener(this); |
---|
477 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 598 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
478 | 599 | fourButton.addActionListener(this); |
---|
479 | 600 | fourButton.setToolTipText("Show left panel only"); |
---|
480 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 601 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
481 | 602 | sixButton.setToolTipText("2-column layout left"); |
---|
482 | 603 | sixButton.addActionListener(this); |
---|
483 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 604 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
484 | 605 | threeButton.setToolTipText("2-column layout right"); |
---|
485 | 606 | threeButton.addActionListener(this); |
---|
486 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
487 | 608 | sevenButton.setToolTipText("3-column layout"); |
---|
488 | 609 | sevenButton.addActionListener(this); |
---|
489 | 610 | // |
---|
490 | 611 | |
---|
491 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
492 | 613 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
493 | 614 | rootButton.addActionListener(this); |
---|
494 | 615 | |
---|
495 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
496 | 617 | closeButton.setToolTipText("Close tab"); |
---|
497 | 618 | closeButton.addActionListener(this); |
---|
498 | 619 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
500 | 621 | |
---|
501 | 622 | cGridBag commandsPanel = new cGridBag(); |
---|
502 | 623 | |
---|
503 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 625 | editButton.setToolTipText("Edit selection"); |
---|
505 | 626 | editButton.addActionListener(this); |
---|
506 | 627 | |
---|
507 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
508 | 629 | uneditButton.setToolTipText("Unedit selection"); |
---|
509 | 630 | uneditButton.addActionListener(this); |
---|
510 | 631 | |
---|
511 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 633 | + allParamsButton.setToolTipText("Edit all params"); |
---|
| 634 | + allParamsButton.addActionListener(this); |
---|
| 635 | + |
---|
| 636 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
512 | 637 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
513 | 638 | clearPanelButton.addActionListener(this); |
---|
514 | 639 | |
---|
515 | | - commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | | - allParamsButton.setToolTipText("All params??"); |
---|
517 | | - allParamsButton.addActionListener(this); |
---|
518 | | - |
---|
519 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 640 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
520 | 641 | unselectButton.setToolTipText("Unselect"); |
---|
521 | 642 | unselectButton.addActionListener(this); |
---|
522 | 643 | |
---|
.. | .. |
---|
591 | 712 | |
---|
592 | 713 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
593 | 714 | { |
---|
| 715 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 716 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 717 | + boxCB.addItemListener(this); |
---|
| 718 | + |
---|
| 719 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 720 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 721 | + zoomBoxCB.addItemListener(this); |
---|
| 722 | + |
---|
| 723 | + if (true) // Globals.ADVANCED) |
---|
| 724 | + { |
---|
594 | 725 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
595 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
| 726 | + supportCB.setToolTipText("Enable rigging"); |
---|
596 | 727 | supportCB.addItemListener(this); |
---|
597 | 728 | |
---|
598 | 729 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
.. | .. |
---|
610 | 741 | slowCB.setToolTipText("Smooth interpolation"); |
---|
611 | 742 | slowCB.addItemListener(this); |
---|
612 | 743 | |
---|
613 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
614 | | - boxCB.setToolTipText("Display bounding boxes"); |
---|
615 | | - boxCB.addItemListener(this); |
---|
616 | | - |
---|
617 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
618 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
619 | | - zoomBoxCB.addItemListener(this); |
---|
620 | | - |
---|
621 | 744 | // constraints.gridy += 1; |
---|
622 | 745 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
623 | 746 | // speakerMocapCB.addItemListener(this); |
---|
.. | .. |
---|
648 | 771 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
649 | 772 | lookAtCB.setToolTipText("Look-at target"); |
---|
650 | 773 | lookAtCB.addItemListener(this); |
---|
| 774 | + |
---|
| 775 | + } |
---|
651 | 776 | |
---|
652 | 777 | cGridBag fill = new cGridBag(); |
---|
653 | 778 | |
---|
.. | .. |
---|
668 | 793 | buttonGroup.add(radioButton); |
---|
669 | 794 | radioButton.doClick(); |
---|
670 | 795 | } |
---|
| 796 | + |
---|
671 | 797 | void SetupViews(ObjEditor oe) |
---|
672 | 798 | { |
---|
673 | 799 | oe.SetupViews(); |
---|
.. | .. |
---|
884 | 1010 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
885 | 1011 | // return; |
---|
886 | 1012 | // } |
---|
887 | | - if (string.charAt(0) == '/') |
---|
| 1013 | + |
---|
| 1014 | + // File path for Mac and Windows |
---|
| 1015 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
888 | 1016 | { |
---|
889 | 1017 | // file(s) |
---|
890 | 1018 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
911 | 1039 | |
---|
912 | 1040 | flashIt = false; |
---|
913 | 1041 | CameraPane pane = (CameraPane) target; |
---|
914 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1042 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
915 | 1043 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
916 | 1044 | |
---|
917 | 1045 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
938 | 1066 | { |
---|
939 | 1067 | loadClipboard(true); |
---|
940 | 1068 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
941 | | - pasteInto(false); |
---|
| 1069 | + pasteInto(false, false); |
---|
942 | 1070 | } else { |
---|
943 | 1071 | loadClipboard(false); |
---|
944 | 1072 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
945 | | - pasteInto(false); // true); // ??? |
---|
| 1073 | + pasteInto(false, false); // true); // ??? |
---|
946 | 1074 | } |
---|
947 | 1075 | } |
---|
948 | 1076 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1064 | 1192 | kleinItem.addActionListener(this); |
---|
1065 | 1193 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1066 | 1194 | particleItem.addActionListener(this); |
---|
| 1195 | + if (Globals.ADVANCED) |
---|
| 1196 | + { |
---|
1067 | 1197 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1068 | 1198 | ragdollItem.addActionListener(this); |
---|
1069 | 1199 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1070 | 1200 | ragdoll2Item.addActionListener(this); |
---|
| 1201 | + } |
---|
1071 | 1202 | menu.add("-"); |
---|
1072 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1203 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1073 | 1204 | meshItem.addActionListener(this); |
---|
1074 | 1205 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1075 | 1206 | // meshGroupItem.addActionListener(this); |
---|
| 1207 | + if (Globals.ADVANCED) |
---|
| 1208 | + { |
---|
1076 | 1209 | springItem = menu.add(new MenuItem("Spring")); |
---|
1077 | 1210 | springItem.addActionListener(this); |
---|
1078 | 1211 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1079 | 1212 | flagItem.addActionListener(this); |
---|
1080 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1081 | | - bezierItem.addActionListener(this); |
---|
1082 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1083 | | - checkerItem.addActionListener(this); |
---|
1084 | 1213 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1085 | 1214 | blobItem.addActionListener(this); |
---|
1086 | 1215 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1087 | 1216 | latheItem.addActionListener(this); |
---|
| 1217 | + } |
---|
| 1218 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1219 | + bezierItem.addActionListener(this); |
---|
| 1220 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1221 | + overlayItem.addActionListener(this); |
---|
1088 | 1222 | lightItem = menu.add(new MenuItem("Light")); |
---|
1089 | 1223 | lightItem.addActionListener(this); |
---|
1090 | 1224 | menu.add("-"); |
---|
.. | .. |
---|
1094 | 1228 | loopItem.addActionListener(this); |
---|
1095 | 1229 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1096 | 1230 | doubleItem.addActionListener(this); |
---|
| 1231 | + if (Globals.ADVANCED) |
---|
| 1232 | + { |
---|
1097 | 1233 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1098 | 1234 | tripleItem.addActionListener(this); |
---|
| 1235 | + } |
---|
1099 | 1236 | } |
---|
1100 | 1237 | |
---|
1101 | 1238 | void buildToolsMenu(Menu menu) |
---|
.. | .. |
---|
1109 | 1246 | parseverticesItem.addActionListener(this); |
---|
1110 | 1247 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1111 | 1248 | textureFieldItem.addActionListener(this); |
---|
1112 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1249 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1113 | 1250 | alignItem.addActionListener(this); |
---|
1114 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1115 | | - mirrorItem.addActionListener(this); |
---|
1116 | 1251 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1117 | 1252 | reduceMorphItem.addActionListener(this); |
---|
1118 | 1253 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1119 | 1254 | reduce34MorphItem.addActionListener(this); |
---|
1120 | | - |
---|
| 1255 | + menu.add("-"); |
---|
1121 | 1256 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1122 | 1257 | computeAOItem.addActionListener(this); |
---|
1123 | | - menu.add("-"); |
---|
1124 | 1258 | |
---|
| 1259 | + if (Globals.ADVANCED) |
---|
| 1260 | + { |
---|
| 1261 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1262 | + mirrorItem.addActionListener(this); |
---|
| 1263 | + menu.add("-"); |
---|
1125 | 1264 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1126 | 1265 | memoryItem.addActionListener(this); |
---|
1127 | 1266 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1144 | 1283 | menu.add("-"); |
---|
1145 | 1284 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1146 | 1285 | editScriptItem.addActionListener(this); |
---|
| 1286 | + } |
---|
1147 | 1287 | } |
---|
1148 | 1288 | |
---|
1149 | 1289 | void ScreenFit() |
---|
.. | .. |
---|
1472 | 1612 | |
---|
1473 | 1613 | void Overwrite(int mask) |
---|
1474 | 1614 | { |
---|
1475 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1615 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1476 | 1616 | { |
---|
1477 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1617 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1478 | 1618 | |
---|
1479 | 1619 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1480 | 1620 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1645 | 1785 | { |
---|
1646 | 1786 | makeSomething(new BezierSurface()); |
---|
1647 | 1787 | } else |
---|
1648 | | - if (source == checkerItem) |
---|
| 1788 | + if (source == overlayItem) |
---|
1649 | 1789 | { |
---|
1650 | 1790 | /* |
---|
1651 | 1791 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1779 | 1919 | csg.addChild(child); |
---|
1780 | 1920 | child.addChild(csg); |
---|
1781 | 1921 | } else |
---|
1782 | | - |
---|
1783 | | - if (source == importGFDItem) |
---|
1784 | | - { |
---|
1785 | | - ImportGFD(); |
---|
1786 | | - } else |
---|
1787 | | - if (source == importVRMLX3DItem) |
---|
1788 | | - { |
---|
1789 | | - ImportVRMLX3D(); |
---|
1790 | | - } else |
---|
1791 | | - if (source == import3DSItem) |
---|
1792 | | - { |
---|
1793 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1794 | | - } else |
---|
1795 | | - if (source == importOBJItem) |
---|
1796 | | - { |
---|
1797 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1798 | | - } else |
---|
1799 | 1922 | if (source == computeAOItem) |
---|
1800 | 1923 | { |
---|
1801 | 1924 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1814 | 1937 | if (source == invariantsItem) |
---|
1815 | 1938 | { |
---|
1816 | 1939 | System.out.println("Invariants:"); |
---|
1817 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1940 | + Grafreed.grafreeD.universe.invariants(); |
---|
1818 | 1941 | } else |
---|
1819 | 1942 | if (source == memoryItem) |
---|
1820 | 1943 | { |
---|
.. | .. |
---|
1832 | 1955 | if (source == dumpItem) |
---|
1833 | 1956 | { |
---|
1834 | 1957 | DumpObject(); |
---|
| 1958 | + } else |
---|
| 1959 | + if (source == oneStepButton) |
---|
| 1960 | + { |
---|
| 1961 | + Globals.ONESTEP = true; |
---|
| 1962 | + cameraView.repaint(); |
---|
1835 | 1963 | } else |
---|
1836 | 1964 | if (source == screenfitButton) |
---|
1837 | 1965 | { |
---|
.. | .. |
---|
1882 | 2010 | { |
---|
1883 | 2011 | loadClipboard(true); |
---|
1884 | 2012 | } else |
---|
| 2013 | + if (source == undoItem) |
---|
| 2014 | + { |
---|
| 2015 | + Undo(); |
---|
| 2016 | + } else |
---|
| 2017 | + if (source == redoItem) |
---|
| 2018 | + { |
---|
| 2019 | + Redo(); |
---|
| 2020 | + } else |
---|
1885 | 2021 | if (source == duplicateItem) |
---|
1886 | 2022 | { |
---|
1887 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2023 | + Object3D keep = Grafreed.clipboard; |
---|
1888 | 2024 | loadClipboard(false); |
---|
1889 | 2025 | paste(false); |
---|
1890 | | - GrafreeD.clipboard = keep; |
---|
| 2026 | + Grafreed.clipboard = keep; |
---|
1891 | 2027 | } else |
---|
1892 | 2028 | if (source == cloneItem) |
---|
1893 | 2029 | { |
---|
.. | .. |
---|
1905 | 2041 | { |
---|
1906 | 2042 | paste(false); |
---|
1907 | 2043 | } else |
---|
| 2044 | + if (source == pasteIntoItem) |
---|
| 2045 | + { |
---|
| 2046 | + pasteInto(true, false); |
---|
| 2047 | + } else |
---|
1908 | 2048 | if (source == pasteLinkItem) |
---|
1909 | 2049 | { |
---|
1910 | | - pasteInto(false); |
---|
| 2050 | + pasteInto(false, false); |
---|
1911 | 2051 | } else |
---|
1912 | 2052 | if (source == pasteCloneItem) |
---|
1913 | 2053 | { |
---|
1914 | | - pasteInto(true); |
---|
| 2054 | + pasteInto(true, true); |
---|
1915 | 2055 | } else |
---|
1916 | 2056 | if (source == pasteExpandItem) |
---|
1917 | 2057 | { |
---|
.. | .. |
---|
2103 | 2243 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2104 | 2244 | // refreshContents(); |
---|
2105 | 2245 | // } |
---|
2106 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2246 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2107 | 2247 | { |
---|
2108 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2248 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2109 | 2249 | |
---|
2110 | 2250 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2111 | 2251 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2113 | 2253 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2114 | 2254 | for (int i=0; i<group.selection.size(); i++) |
---|
2115 | 2255 | { |
---|
2116 | | - boolean random = CameraPane.RANDOM; |
---|
2117 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2256 | + boolean random = CameraPane.SWITCH; |
---|
| 2257 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2118 | 2258 | group.selection.get(i).linkVerticesThis(content); |
---|
2119 | 2259 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2120 | | - CameraPane.RANDOM = random; |
---|
| 2260 | + CameraPane.SWITCH = random; |
---|
2121 | 2261 | } |
---|
2122 | 2262 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2123 | 2263 | refreshContents(); |
---|
.. | .. |
---|
2127 | 2267 | { |
---|
2128 | 2268 | for (int i=0; i<group.selection.size(); i++) |
---|
2129 | 2269 | { |
---|
2130 | | - boolean random = CameraPane.RANDOM; |
---|
2131 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2270 | + boolean random = CameraPane.SWITCH; |
---|
| 2271 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2132 | 2272 | group.selection.get(i).linkVerticesThis(null); |
---|
2133 | | - CameraPane.RANDOM = random; |
---|
| 2273 | + CameraPane.SWITCH = random; |
---|
2134 | 2274 | } |
---|
2135 | 2275 | |
---|
2136 | 2276 | refreshContents(); |
---|
2137 | 2277 | } else |
---|
2138 | 2278 | if (source == relinkverticesItem) |
---|
2139 | 2279 | { |
---|
2140 | | - boolean random = CameraPane.RANDOM; |
---|
2141 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2280 | + boolean random = CameraPane.SWITCH; |
---|
| 2281 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2142 | 2282 | group.selection.RelinkToSupport(); |
---|
2143 | | - CameraPane.RANDOM = random; |
---|
| 2283 | + CameraPane.SWITCH = random; |
---|
2144 | 2284 | |
---|
2145 | 2285 | refreshContents(); |
---|
2146 | 2286 | } else |
---|
.. | .. |
---|
2155 | 2295 | } else |
---|
2156 | 2296 | if (source == setMasterItem) |
---|
2157 | 2297 | { |
---|
2158 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2298 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2159 | 2299 | { |
---|
2160 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2300 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2161 | 2301 | |
---|
2162 | 2302 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2163 | 2303 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2170 | 2310 | { |
---|
2171 | 2311 | if (group.selection.size() == 1) |
---|
2172 | 2312 | { |
---|
2173 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2313 | + if (Grafreed.clipboard.size() == 1) |
---|
2174 | 2314 | { |
---|
2175 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2315 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2176 | 2316 | |
---|
2177 | 2317 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2178 | 2318 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2189 | 2329 | { |
---|
2190 | 2330 | RevertMeshes(); |
---|
2191 | 2331 | } else |
---|
2192 | | - if (source == resetMeshItem) |
---|
| 2332 | + if (source == resetAllItem) |
---|
2193 | 2333 | { |
---|
2194 | 2334 | ResetAll(); |
---|
2195 | 2335 | } else |
---|
.. | .. |
---|
2238 | 2378 | RandomNode random = new RandomNode(); |
---|
2239 | 2379 | group(random); |
---|
2240 | 2380 | if (random.size() > 0) |
---|
2241 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2381 | + random.name = random.get(0).name + "Switch"; |
---|
2242 | 2382 | } else |
---|
2243 | 2383 | if (source == physicsItem) |
---|
2244 | 2384 | { |
---|
.. | .. |
---|
2527 | 2667 | { |
---|
2528 | 2668 | SmoothMesh(); |
---|
2529 | 2669 | } else |
---|
2530 | | - if (source == transformgeometryItem) |
---|
| 2670 | + if (source == transformGeometryItem) |
---|
2531 | 2671 | { |
---|
2532 | 2672 | TransformGeometry(); |
---|
| 2673 | + } else |
---|
| 2674 | + if (source == transformChildrenItem) |
---|
| 2675 | + { |
---|
| 2676 | + TransformChildren(); |
---|
2533 | 2677 | } else |
---|
2534 | 2678 | if (source == resetTransformItem) |
---|
2535 | 2679 | { |
---|
.. | .. |
---|
2537 | 2681 | } else |
---|
2538 | 2682 | if (source == resetCentroidItem) |
---|
2539 | 2683 | { |
---|
2540 | | - ResetCentroid(); |
---|
| 2684 | + ResetCentroid(true); |
---|
| 2685 | + } else |
---|
| 2686 | + if (source == resetCentroidXZItem) |
---|
| 2687 | + { |
---|
| 2688 | + ResetCentroid(false); |
---|
2541 | 2689 | } else |
---|
2542 | 2690 | if (source == resetParentItem) |
---|
2543 | 2691 | { |
---|
.. | .. |
---|
2893 | 3041 | child.CloseUI(); |
---|
2894 | 3042 | listUI.remove(child); |
---|
2895 | 3043 | |
---|
2896 | | - child.editWindow = null; // ??????????? |
---|
| 3044 | + //child.editWindow = null; // ??????????? |
---|
2897 | 3045 | } |
---|
2898 | | - objEditor.ctrlPanel.validate(); |
---|
| 3046 | + objEditor.ctrlPanel.FlushUI(); |
---|
2899 | 3047 | //objEditor.jTree.clearSelection(); |
---|
2900 | 3048 | //objEditor.ResetSliders(); |
---|
2901 | 3049 | refreshContents(true); |
---|
.. | .. |
---|
2979 | 3127 | frontView.object = group; |
---|
2980 | 3128 | sideView.object = group; |
---|
2981 | 3129 | } |
---|
2982 | | - group.editWindow = this; |
---|
| 3130 | + |
---|
| 3131 | +// fix "+" issue group.editWindow = this; |
---|
| 3132 | + |
---|
2983 | 3133 | /* |
---|
2984 | 3134 | currentLayout = radio.layout; |
---|
2985 | 3135 | if (currentLayout == null) |
---|
.. | .. |
---|
2992 | 3142 | //group.attributes = -1; |
---|
2993 | 3143 | ResetModel(); |
---|
2994 | 3144 | refreshContents(true); |
---|
2995 | | - } |
---|
| 3145 | + } else if (event.getSource() == editCameraItem) |
---|
| 3146 | + { |
---|
| 3147 | + cameraView.ProtectCamera(); |
---|
| 3148 | + cameraView.repaint(); |
---|
| 3149 | + return; |
---|
| 3150 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3151 | + { |
---|
| 3152 | + cameraView.RevertCamera(); |
---|
| 3153 | + cameraView.repaint(); |
---|
| 3154 | + return; |
---|
| 3155 | + // } else if (event.getSource() == textureButton) |
---|
| 3156 | + // { |
---|
| 3157 | + // return; // true; |
---|
| 3158 | + } |
---|
2996 | 3159 | else |
---|
2997 | 3160 | { |
---|
2998 | 3161 | //return super.action(event, arg); |
---|
.. | .. |
---|
3053 | 3216 | refreshContents(); |
---|
3054 | 3217 | } |
---|
3055 | 3218 | |
---|
| 3219 | + void TransformChildren() |
---|
| 3220 | + { |
---|
| 3221 | + Object3D obj; |
---|
| 3222 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3223 | + { |
---|
| 3224 | + obj = (Object3D)e.nextElement(); |
---|
| 3225 | + obj.KeepTextureMatrices(); |
---|
| 3226 | + obj.TransformChildren(); |
---|
| 3227 | + obj.RestoreTextureMatrices(); |
---|
| 3228 | + |
---|
| 3229 | +// if (obj.parent == null) |
---|
| 3230 | +// { |
---|
| 3231 | +// System.out.println("NULL PARENT!"); |
---|
| 3232 | +// new Exception().printStackTrace(); |
---|
| 3233 | +// } |
---|
| 3234 | +// else |
---|
| 3235 | +// TouchTransform(obj); |
---|
| 3236 | +// //obj.parent.Touch(); |
---|
| 3237 | + } |
---|
| 3238 | + |
---|
| 3239 | + refreshContents(); |
---|
| 3240 | + } |
---|
3056 | 3241 | |
---|
3057 | 3242 | void ResetTransform() |
---|
3058 | 3243 | { |
---|
.. | .. |
---|
3165 | 3350 | refreshContents(); |
---|
3166 | 3351 | } |
---|
3167 | 3352 | |
---|
3168 | | - void ResetCentroid() |
---|
| 3353 | + void ResetCentroid(boolean full) |
---|
3169 | 3354 | { |
---|
3170 | 3355 | Object3D obj; |
---|
3171 | 3356 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3180 | 3365 | LA.matIdentity(Object3D.mat); |
---|
3181 | 3366 | obj.getBounds(minima, maxima, false); |
---|
3182 | 3367 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3183 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3368 | + if (full) |
---|
| 3369 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3184 | 3370 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3185 | 3371 | obj.TransformMesh(Object3D.mat); |
---|
| 3372 | + |
---|
3186 | 3373 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3187 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3374 | + if (full) |
---|
| 3375 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3188 | 3376 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3377 | + |
---|
3189 | 3378 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3190 | 3379 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3191 | 3380 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3251 | 3440 | obj = (Object3D)e.nextElement(); |
---|
3252 | 3441 | |
---|
3253 | 3442 | System.out.println("Object is: " + obj); |
---|
3254 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3443 | + Grafreed.AnalyzeObject(obj); |
---|
3255 | 3444 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3256 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3445 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3257 | 3446 | |
---|
3258 | 3447 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3259 | 3448 | } |
---|
.. | .. |
---|
3467 | 3656 | |
---|
3468 | 3657 | void ParseVertices() |
---|
3469 | 3658 | { |
---|
3470 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3471 | | - GrafreeD.epsequal = true; |
---|
| 3659 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3660 | + Grafreed.epsequal = true; |
---|
3472 | 3661 | |
---|
3473 | 3662 | for (int i=0; i<group.selection.size(); i++) |
---|
3474 | 3663 | { |
---|
.. | .. |
---|
3493 | 3682 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3494 | 3683 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3495 | 3684 | |
---|
3496 | | - g.add(GrafreeD.clipboard); |
---|
| 3685 | + g.add(Grafreed.clipboard); |
---|
3497 | 3686 | |
---|
3498 | 3687 | buffer.add(g); |
---|
3499 | 3688 | } |
---|
.. | .. |
---|
3508 | 3697 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3509 | 3698 | } |
---|
3510 | 3699 | |
---|
3511 | | - GrafreeD.epsequal = epsequal; |
---|
| 3700 | + Grafreed.epsequal = epsequal; |
---|
3512 | 3701 | |
---|
3513 | 3702 | refreshContents(); |
---|
3514 | 3703 | } |
---|
.. | .. |
---|
3526 | 3715 | String pigment = Object3D.GetPigment(tex); |
---|
3527 | 3716 | //String bump = Object3D.GetBump(tex); |
---|
3528 | 3717 | |
---|
3529 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3718 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3719 | + |
---|
| 3720 | + try |
---|
| 3721 | + { |
---|
| 3722 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3723 | + } |
---|
| 3724 | + catch (Exception e) |
---|
| 3725 | + { |
---|
| 3726 | + System.err.println("FAIL: " + node); |
---|
| 3727 | + } |
---|
3530 | 3728 | |
---|
3531 | 3729 | double s = v.s; |
---|
3532 | 3730 | |
---|
.. | .. |
---|
3614 | 3812 | |
---|
3615 | 3813 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3616 | 3814 | |
---|
3617 | | - boolean random = CameraPane.RANDOM; |
---|
3618 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3815 | + boolean random = CameraPane.SWITCH; |
---|
| 3816 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3619 | 3817 | lowres.linkVerticesThis(null); |
---|
3620 | 3818 | lowres.linkVerticesThis(sn); |
---|
3621 | | - CameraPane.RANDOM = random; |
---|
| 3819 | + CameraPane.SWITCH = random; |
---|
3622 | 3820 | |
---|
3623 | 3821 | System.err.flush(); |
---|
3624 | 3822 | |
---|
.. | .. |
---|
3658 | 3856 | return; |
---|
3659 | 3857 | |
---|
3660 | 3858 | Object3D poses = group.selection.get(0); |
---|
3661 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3859 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3662 | 3860 | |
---|
3663 | 3861 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3664 | 3862 | |
---|
.. | .. |
---|
3852 | 4050 | |
---|
3853 | 4051 | void ClipMesh() |
---|
3854 | 4052 | { |
---|
3855 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4053 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3856 | 4054 | { |
---|
3857 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4055 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3858 | 4056 | |
---|
3859 | 4057 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3860 | 4058 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3863 | 4061 | // { |
---|
3864 | 4062 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3865 | 4063 | // } |
---|
3866 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4064 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3867 | 4065 | } |
---|
3868 | 4066 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3869 | 4067 | System.out.println("DONE."); |
---|
.. | .. |
---|
3998 | 4196 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3999 | 4197 | |
---|
4000 | 4198 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4001 | | - if(elem != group) |
---|
| 4199 | + if(elem != group || !newWindow) |
---|
4002 | 4200 | { |
---|
4003 | 4201 | // if (!(elem instanceof Composite)) |
---|
4004 | 4202 | // newWindow = false; |
---|
.. | .. |
---|
4112 | 4310 | |
---|
4113 | 4311 | objEditor.SetText(); // jan 2014 |
---|
4114 | 4312 | |
---|
4115 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4313 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4116 | 4314 | CameraPane.flash = true; |
---|
4117 | 4315 | |
---|
4118 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4316 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4119 | 4317 | // a camera |
---|
4120 | 4318 | { |
---|
4121 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4122 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4319 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4320 | + { |
---|
| 4321 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4322 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4323 | + } |
---|
4123 | 4324 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4124 | 4325 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4125 | 4326 | } |
---|
.. | .. |
---|
4203 | 4404 | { |
---|
4204 | 4405 | if (group.selection.isEmpty()) |
---|
4205 | 4406 | return; |
---|
4206 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4407 | + Grafreed.clipboardIsTempGroup = false; |
---|
4207 | 4408 | Composite tGroup = null; |
---|
4208 | 4409 | if (group.selection.size() > 0) // 1) |
---|
4209 | 4410 | { |
---|
4210 | 4411 | tGroup = new cGroup(); |
---|
4211 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4412 | + Grafreed.clipboardIsTempGroup = true; |
---|
4212 | 4413 | } |
---|
4213 | 4414 | |
---|
4214 | 4415 | if (cut) |
---|
.. | .. |
---|
4248 | 4449 | //System.out.println("cut " + child); |
---|
4249 | 4450 | //System.out.println("parent = " + child.parent); |
---|
4250 | 4451 | // tmp.addChild(child); |
---|
4251 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4452 | + if (Grafreed.clipboardIsTempGroup) |
---|
4252 | 4453 | tGroup.add/*Child*/(tmp); |
---|
4253 | 4454 | else |
---|
4254 | | - GrafreeD.clipboard = tmp; |
---|
| 4455 | + Grafreed.clipboard = tmp; |
---|
4255 | 4456 | } |
---|
4256 | 4457 | else |
---|
4257 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4458 | + if (Grafreed.clipboardIsTempGroup) |
---|
4258 | 4459 | tGroup.add/*Child*/(child); |
---|
4259 | 4460 | else |
---|
4260 | | - GrafreeD.clipboard = child; |
---|
| 4461 | + Grafreed.clipboard = child; |
---|
4261 | 4462 | } |
---|
4262 | 4463 | |
---|
4263 | 4464 | //ResetModel(); |
---|
.. | .. |
---|
4289 | 4490 | //System.out.println("cut " + elem); |
---|
4290 | 4491 | //System.out.println("parent = " + elem.parent); |
---|
4291 | 4492 | // tmp.addChild(elem); |
---|
4292 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4493 | + if (Grafreed.clipboardIsTempGroup) |
---|
4293 | 4494 | tGroup.add/*Child*/(tmp); |
---|
4294 | 4495 | else |
---|
4295 | | - GrafreeD.clipboard = tmp; |
---|
| 4496 | + Grafreed.clipboard = tmp; |
---|
4296 | 4497 | } |
---|
4297 | 4498 | else |
---|
4298 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4499 | + if (Grafreed.clipboardIsTempGroup) |
---|
4299 | 4500 | tGroup.add/*Child*/(child); |
---|
4300 | 4501 | else |
---|
4301 | | - GrafreeD.clipboard = child; |
---|
| 4502 | + Grafreed.clipboard = child; |
---|
4302 | 4503 | } |
---|
4303 | 4504 | |
---|
4304 | 4505 | } |
---|
4305 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4306 | | - GrafreeD.clipboard = tGroup; |
---|
| 4506 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4507 | + Grafreed.clipboard = tGroup; |
---|
4307 | 4508 | if (cut) |
---|
4308 | 4509 | { |
---|
4309 | 4510 | ResetModel(); |
---|
.. | .. |
---|
4317 | 4518 | // return; |
---|
4318 | 4519 | boolean first = true; |
---|
4319 | 4520 | |
---|
4320 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4521 | + if (Grafreed.clipboardIsTempGroup) |
---|
4321 | 4522 | { |
---|
4322 | 4523 | Composite temp; |
---|
4323 | 4524 | |
---|
.. | .. |
---|
4328 | 4529 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4329 | 4530 | */ |
---|
4330 | 4531 | Object3D elem; |
---|
4331 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4532 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4332 | 4533 | { |
---|
4333 | 4534 | Object3D child = (Object3D)e.nextElement(); |
---|
4334 | 4535 | |
---|
.. | .. |
---|
4362 | 4563 | //Object3D cb = Applet3D.clipboard; |
---|
4363 | 4564 | //temp.addChild(cb); |
---|
4364 | 4565 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4365 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4366 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4367 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4368 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4369 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4566 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4567 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4568 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4569 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4570 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4370 | 4571 | else |
---|
4371 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4372 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4572 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4573 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4373 | 4574 | } |
---|
4374 | 4575 | |
---|
4375 | 4576 | ResetModel(); |
---|
4376 | 4577 | refreshContents(); |
---|
4377 | 4578 | } |
---|
4378 | 4579 | |
---|
4379 | | - void pasteInto(boolean copyit) |
---|
| 4580 | + void pasteInto(boolean copyit, boolean clone) |
---|
4380 | 4581 | { |
---|
4381 | 4582 | // if (GrafreeD.clipboard == null) |
---|
4382 | 4583 | // return; |
---|
.. | .. |
---|
4405 | 4606 | if (copyit) |
---|
4406 | 4607 | { |
---|
4407 | 4608 | // paste(false); |
---|
4408 | | - CloneClipboard(false); // sept 2014 |
---|
| 4609 | + if (clone) |
---|
| 4610 | + { |
---|
| 4611 | + CloneClipboard(false); // sept 2014 |
---|
| 4612 | + } |
---|
| 4613 | + else |
---|
| 4614 | + { |
---|
| 4615 | + paste(false); |
---|
| 4616 | + } |
---|
4409 | 4617 | } |
---|
4410 | 4618 | else |
---|
4411 | 4619 | { |
---|
4412 | 4620 | boolean first = true; |
---|
4413 | 4621 | |
---|
4414 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4622 | + if (Grafreed.clipboardIsTempGroup) |
---|
4415 | 4623 | { |
---|
4416 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4624 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4417 | 4625 | Object3D copy; |
---|
4418 | 4626 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4419 | 4627 | { |
---|
.. | .. |
---|
4423 | 4631 | } |
---|
4424 | 4632 | } else |
---|
4425 | 4633 | { |
---|
4426 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4634 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4427 | 4635 | } |
---|
4428 | 4636 | } |
---|
4429 | 4637 | } |
---|
.. | .. |
---|
4828 | 5036 | } |
---|
4829 | 5037 | */ |
---|
4830 | 5038 | |
---|
4831 | | - void ImportGFD() |
---|
4832 | | - { |
---|
4833 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4834 | | - browser.show(); |
---|
4835 | | - String filename = browser.getFile(); |
---|
4836 | | - if (filename != null && filename.length() > 0) |
---|
4837 | | - { |
---|
4838 | | - String fullname = browser.getDirectory() + filename; |
---|
4839 | | - |
---|
4840 | | - //Object3D readobj = |
---|
4841 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4842 | | - //makeSomething(readobj); |
---|
4843 | | - } |
---|
4844 | | - } |
---|
4845 | | - |
---|
4846 | 5039 | /* |
---|
4847 | 5040 | public void Callback(Object obj) |
---|
4848 | 5041 | { |
---|
.. | .. |
---|
4866 | 5059 | } |
---|
4867 | 5060 | */ |
---|
4868 | 5061 | |
---|
4869 | | - void ImportVRMLX3D() |
---|
4870 | | - { |
---|
4871 | | - if (GrafreeD.standAlone) |
---|
4872 | | - { |
---|
4873 | | - /**/ |
---|
4874 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4875 | | - browser.show(); |
---|
4876 | | - String filename = browser.getFile(); |
---|
4877 | | - if (filename != null && filename.length() > 0) |
---|
4878 | | - { |
---|
4879 | | - String fullname = browser.getDirectory() + filename; |
---|
4880 | | - LoadVRMLX3D(fullname); |
---|
4881 | | - } |
---|
4882 | | - /**/ |
---|
4883 | | - } |
---|
4884 | | - } |
---|
4885 | | - |
---|
4886 | 5062 | String GetFile(String dialogName) |
---|
4887 | 5063 | { |
---|
4888 | | - if (GrafreeD.standAlone) |
---|
| 5064 | + if (Grafreed.standAlone) |
---|
4889 | 5065 | { |
---|
4890 | 5066 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4891 | 5067 | browser.show(); |
---|
.. | .. |
---|
4949 | 5125 | cButton flashSelectionButton; |
---|
4950 | 5126 | cButton editButton; |
---|
4951 | 5127 | cButton uneditButton; |
---|
| 5128 | + JCheckBox allParamsButton; |
---|
4952 | 5129 | cButton clearpanelButton; |
---|
4953 | | - cButton allParamsButton; |
---|
4954 | 5130 | cButton unselectButton; |
---|
4955 | 5131 | |
---|
| 5132 | + cButton oneStepButton; |
---|
| 5133 | + |
---|
4956 | 5134 | cButton screenfitButton; |
---|
4957 | 5135 | cButton screenfitpointButton; |
---|
4958 | 5136 | cButton snapobjectButton; |
---|
.. | .. |
---|
4983 | 5161 | private MenuItem lookFromItem; |
---|
4984 | 5162 | private MenuItem switchItem; |
---|
4985 | 5163 | private MenuItem cutItem; |
---|
| 5164 | + private MenuItem undoItem; |
---|
| 5165 | + private MenuItem redoItem; |
---|
4986 | 5166 | private MenuItem duplicateItem; |
---|
4987 | 5167 | private MenuItem cloneItem; |
---|
4988 | 5168 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
4996 | 5176 | private MenuItem linkverticesItem; |
---|
4997 | 5177 | private MenuItem relinkverticesItem; |
---|
4998 | 5178 | private MenuItem setMasterItem; |
---|
4999 | | - private MenuItem resetMeshItem; |
---|
| 5179 | + private MenuItem resetAllItem; |
---|
5000 | 5180 | private MenuItem stepAllItem; |
---|
5001 | 5181 | private MenuItem revertMeshItem; |
---|
5002 | 5182 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5007 | 5187 | private MenuItem mergeGeometriesItem; |
---|
5008 | 5188 | private MenuItem copyItem; |
---|
5009 | 5189 | private MenuItem pasteItem; |
---|
| 5190 | + private MenuItem pasteIntoItem; |
---|
5010 | 5191 | private MenuItem pasteLinkItem; |
---|
5011 | 5192 | private MenuItem pasteCloneItem; |
---|
5012 | 5193 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5056 | 5237 | private MenuItem panoTexturesItem; |
---|
5057 | 5238 | |
---|
5058 | 5239 | private MenuItem resetCentroidItem; |
---|
5059 | | - private MenuItem transformgeometryItem; |
---|
| 5240 | + private MenuItem resetCentroidXZItem; |
---|
5060 | 5241 | private MenuItem resetTransformItem; |
---|
| 5242 | + private MenuItem transformGeometryItem; |
---|
| 5243 | + private MenuItem transformChildrenItem; |
---|
5061 | 5244 | private MenuItem hideItem; |
---|
5062 | 5245 | private MenuItem grabItem; |
---|
5063 | 5246 | private MenuItem backItem; |
---|
.. | .. |
---|
5104 | 5287 | private MenuItem blobItem; |
---|
5105 | 5288 | private MenuItem latheItem; |
---|
5106 | 5289 | private MenuItem bezierItem; |
---|
5107 | | - private MenuItem checkerItem; |
---|
| 5290 | + private MenuItem overlayItem; |
---|
5108 | 5291 | private MenuItem meshItem; |
---|
5109 | 5292 | // private MenuItem meshGroupItem; |
---|
5110 | 5293 | private MenuItem springItem; |
---|
.. | .. |
---|
5126 | 5309 | private MenuItem doubleItem; |
---|
5127 | 5310 | private MenuItem tripleItem; |
---|
5128 | 5311 | |
---|
5129 | | - private MenuItem importGFDItem; |
---|
5130 | | - private MenuItem importVRMLX3DItem; |
---|
5131 | | - private MenuItem import3DSItem; |
---|
5132 | | - private MenuItem importOBJItem; |
---|
5133 | | - |
---|
5134 | 5312 | private MenuItem computeAOItem; |
---|
5135 | 5313 | private MenuItem recompileItem; |
---|
5136 | 5314 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5140 | 5318 | private MenuItem analyzeItem; |
---|
5141 | 5319 | private MenuItem dumpItem; |
---|
5142 | 5320 | //boolean freezemodel = false; |
---|
| 5321 | + |
---|
| 5322 | + Menu cameraMenu; |
---|
| 5323 | + MenuItem editCameraItem; |
---|
| 5324 | + MenuItem revertCameraItem; |
---|
5143 | 5325 | } |
---|