SyntaxHighlighter

Thursday 11 July 2013

Day 24: final prep for Animation13

Set up in Martin Harris, everything is good to go.

Ftp transfer and the 123D area

Fixed the sftp issue: it did work over wifi, but we just realised we could automate ssh logins and just use scp to move the files about so we did that. This was necessary because sftp was messing about with file permissions when the gifs were pushed to the live web folder to be displayed on the rotating head gallery. All works now that we use scp and changed Toby's umask about (I think 002 was what worked).

Set up the photography area, it really is fantastic with some lovely models coming out of 123D Catch now that we have Xin on the photography job with his professional photography skills - skills so professional they are rivalled only by Toby himself!

All about heads

Sought out and fixed a bunch of bugs, automated the adding of heads so that you just:

  1. change one variable (e.g. numHeads = 50)
  2. import placer files
  3. update a bit of code mapping number keys on the keyboard to new model sets only if you need them - one model set holds 10 new models, and is mapped to one number key on the keyboard
... and the code does the rest automatically. Currently the keyboard keys 1 and 2 are reserved for the inbuilt model sets (i.e. everything except for heads), and 3/4/5 will be used for three sets of 10 heads each. 30 placer head files are in place and everything is ready to go. I'll probably update it to handle 50 tomorrow (using number keys 6 and 7).

How to add a head

To do the actual addition of a head while the AR Demo is running, you need to paste correctly configured .xnb files (named 1.xnb and t1_0.xnb, or replace 1 with whatever number you're on) into the GoblinXNAv4.1/bin/Content/heads folder (I think that's the one), overwriting the existing files in there. Then you simply click inside the AR Demo window so that it has focus, and press M followed by Z. Pressing M enables a new model to be loaded, pressing Z loads the next model into the next head space in order.

The order that heads will be added when you hit an M-Z sequence is into the number 3 model set first, and you can have 10 heads in there (for the 10 marker cards - bear in mind the heads on the two bigger marker cards will be humongous!) before the next head is automatically added to the number 4 model set. Then the number 5 model set fills up and that's it - after it's full the addition of heads is permanently disabled (of course if I've extended it to take 50 heads then the number 6 and 7 model sets will also be available before it fills).

Bit more detail on adding model sets

Although we will likely only need the 30 or 50 heads programmed as it is, if we did want to add more heads here's a little more info: regarding importing correctly configured placer files for every extra head you want you need a texture and an fbx, with the fbx pointing to that specific texture (the texture has a unique name and is in the same directory). The way I make a correctly configured fbx is by copying the same original placer fbx repeatedly (you can copy any fbx but it has to point to a texture, and only one texture), opening the copied fbx in Notepad++ (it's all in ASCII) and editing the texture filepaths to point to ./t1 or ./t2 or whatever number this fbx is. So the final placer files are named 1.fbx and t1.fbx (replace 1 with whatever number you're on).

When XNA generates .xnb's out of models and textures, the .xnb files store inside them exactly where all the corresponding textures are (i.e. they point to specific .xnb texture files) so you must ensure each of the placer fbx models points to a unique texture file with no overlap of any sort (that's why copy-pasting an identical placer model file is not enough, each one must have a uniquely named texture and point to that texture).



So. It begins.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.