isi-vista / adam

Abduction to Demonstrate an Articulate Machine
MIT License
10 stars 4 forks source link

Extract individual components of hierarchical objects #591

Closed chris-jenkins-isi closed 4 years ago

chris-jenkins-isi commented 4 years ago

We would like to be able to manipulate individual components of hierarchical objects (or at least easily point to each piece) within the visualization system. Currently, all custom models are imported as one contiguous piece of geometry. The following is a process for exporting each piece separately.

a/the general process for exporting separate pieces of a model is as follows:

1.) Go into edit mode
    - If anything is already selected, you can toggle 'A' to select all / deselect all
2.) Shift+R-click to select edges/vertices
    - Selecting all edges around a face selects that face
    - It may be helpful to enter fly mode (shift + F) to reposition the camera
    - You may need to delete edges / faces around your target area to more easily select it
    - Circle select (shortcut: C) is also very helpful, but you select with the left mouse button with it instead of the right.
3.) When you have selected the entirety of the target geometry, press 'p' to split it into a new model (select split by selection)
4.) Delete the rest of the original model
5.) Save as a new .blend file (don't overwrite the original!)
6.) Select all (A)
7.) Export to .egg. (Warning: .egg files are ignored by our .gitignore!)
8.) Check to see that exported .egg file actually contains vertices and etc
    - If not, just try again

File naming conventions:

- Prefer to list sides in x/y/z order (e.g. left_back_top)
- If object has a 'canonical' facing (perspectival for animate objects, the direction that cars drive when not in reverse gear, etc), use that

- Otherwise, orient descriptions based on the 'canonical' view of the object as seen when importing it into Panda3d using the utility script in panda3d_interface.py

Example: table-leg_left_front (for the leg of a table)
chris-jenkins-isi commented 4 years ago

.blend files are located at /nas/home/cjenkins/adam-graphics/blender-models-sliced

We still need to find / make a model for the cookie. Everything I'm seeing online is either not free, requires attribution, or is insanely detailed.

chris-jenkins-isi commented 4 years ago

Another tip: in order for the models to receive the correct color settings at run time, you may need to remove any material currently in place on a model when exporting from Blender.

Screen Shot 2020-02-25 at 10 14 21

Granted, there are probably some cases where we want to give some object a definite color within Blender (if it never changes in a curriculum)

chris-jenkins-isi commented 4 years ago

In cases where you want part of an object to have a specific color that isn't determined by the curriculum, strangely the field that YABEE looks at when creating an .egg file is not under Surface/Color (what's shown in this screenshot) but instead under Settings/Viewport Color.

Screen Shot 2020-02-27 at 11 06 25

chris-jenkins-isi commented 4 years ago

I also found a much easier way of testing whether an .egg file has successfully been created! (instead of using my script in panda3d_interface)

Panda3d includes a program called pview, which you can run on the command line + an .egg file.

Controls:

jamart28 commented 4 years ago

Since the car model included color do I need to go back and remove that color? @chris-jenkins-isi

chris-jenkins-isi commented 4 years ago

@jamart28 for the car body, yes, as they can be one of several colors. For the tires, no, as they are always the same. You can check adam/ontology/phase1_ontology.py

gabbard commented 4 years ago

Visualization is on hold.