SyntaxHighlighter

Tuesday 9 July 2013

Day 22: Full 123D Catch workflow preparation stage 1

Hoops

... is the name of the new Lenovo laptop we'd been having trouble with!

Hoops was still causing problems, we couldn't install Ubuntu because the installer couldn't see the Windows 7 NTFS partition on the disk at all - and installing then would mean it would carve up the disk to its own desires, likely resulting in wiping the windows partition whether we like it or not.

Nothing we did fixed the issue. We deleted the entire disk completely and made a new Ubuntu install but now Win 7 refused to install. It told us it could not create a system partition or find an existing system partition.

We deleted the entire disk, made a new Windows friendly NTFS partition and tried again but to no avail, Win 7 just flat out did not want to install on this disk no matter what kind of wiping we subjected it to. We made a new partition tree, we made a FAT32 partition, we did all sorts of gimmickry. We eventually decided to reactivate UEFI mode, see if we can get Win 7 to install with UEFI in the mix. No luck, it got stuck at the starting setup screen as it had before. At long last we succumbed and decided to install Windows 8 from the UEFI and try and get a UEFI Ubuntu install to go with it, foregoing Win 7 entirely.

Yet out of nowhere, as we were resignedly copying the Windows 8 installer to our bootable USB drive, a rogue google link led us to a forum post wherein someone had used fixparts to fix their partitions after they had encountered problems that greatly resembled our own. With nothing to lose, We booted from the Ubuntu LiveUSB and did just that, deleted the disk and starting running every fixpart command we could find!

Well it worked, Win 7 installed successfully. We tried Windows 8 non-UEFI version because we felt like going triple boot but it didn't work - a similar error to that which Win 7 had thrown many times before (unable to install to selected partition). Instead of fighting with it we switched to the Ubuntu installer and installed that. At last everything works fine with the two most important OS's installed correctly.

123D Catch Workflow

Tested a little hack today which allows us to add models to the AR demo program as it is running, and have those models incorporated into the AR program in real time and available to interact with!

This will allow us to add 123D generated heads (generated in one room) of the children, to the AR program (running in another room) in real time, so that their friends at the AR demo can perform dastardly acts to them. Importantly, we won't have to restart the AR program or recompile it when we wish to add models.

The method of doing this is quite simply a hack, and far from ideal if this were a robust, expandable piece of software. Thankfully the only aim right now is to get this working in time for animation13 tomorrow, so the "how" of it is overlooked. Which is great, because the code I'm going to write for this is despicable by any standards of software engineering!

I'm going to expand the current AR demo, not by programming a complex and brilliant for loop that can account for any number of models at once creating all the required machinations by simply incrementing a variable; but rather by simply copying and pasting a bunch of code and rewriting the same thing 30 times with slight differences so that we have space for 30 or so new head models.

Now the hacky bit, the AR Demo will be fed a placer model in place of each of these models (because the actual head models we want don't exist yet). XNA compiles all models to .xnb format upon compilation of the program, and this is what programs use when they run. So a bunch of empty .xnb files corresponding to our placers will be made when we run AR demo, but importantly I will instruct the AR demo to not load these models until I press a button.

...which I won't do until we get the new models from 123D Catch, and compile them to .xnb, and replace the placer .xnb files with these correct .xnb heads! AR demo has no clue that the xnb's have been switched and will load the new xnb's instead when I press the magic button, resulting in a fresh new model straight from 123D Catch appearing in the AR demo program as it runs, without interruption.

There is quite a lot of preparation going on after a 123D model is made. A model comes in a model file and a texture file, and unfortunately the model file needs to be edited so that the relative file path of the texture file is somewhere that exists (123D spits out models with the most randomly ridiculous relative path to textures, you wouldn't belieeeeve it). This is done using the following regular expressions:

Find:
Filename: "[.\\a-zA-Z ()0-9~_"]*

Replace with:
Filename: ".\\2_tex_0.jpg"

(replace 2 with whatever number we are up to)

Should perform four replacements every time

The workflow after getting an fbx from 123D Catch is something like this:

  1. get fbx and its texture
  2. rename to 1.fbx and 1.jpg
  3. Use regex to fix the expected filepath of the texture, replaces 4 lines.
  4. place them in C:\Users\ARdemo\Desktop\ARdemo\GoblinXNAv4.1\projects\ExportJPEGs\ExportJPEGs\ExportJPEGsContent
  5. Open ExportJPEGs in Visual Express, import 1.fbx, edit the code so that it loads "1.fbx", run in debug mode (this makes 36 jpg's of a head and sticks them in C:\Export).
  6. convert jpg's to animated GIF in C:\Export, upload it to the webpage etc etc..
  7. take 1.xnb and 1_0.xnb from C:\Users\ARdemo\Desktop\ARdemo\GoblinXNAv4.1\projects\ExportJPEGs\ExportJPEGs\ExportJPEGs\bin\x86\Debug\Content and replace the xnb's in C:\Users\ARdemo\Desktop\ARdemo\GoblinXNAv4.1\bin\Content
  8. hit the key on LowryDemo to load that corresponding model


(then increment the 1 to 2 and repeat)

Testing of the entire workflow shall commence tomorrow at 2pm sharp.

No comments:

Post a Comment

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