CuHe – Developer Diary

27.11.2014 – CuHe Version 1.0 Project cleanup

Unity has released Unity 4.6 final. And so the project comes to an end. The app has its own page now, and this page has become the developer diary for it. The old developer versions are removed now.

Have fun with it 🙂

11.11.2014 – CuHe Version 1.0

After a relative long wait Unity has released a Unity 4.6 Beta version where the input field does what it should. Means i was able to fix the last remaining quirk here. The manual is finished too. And so the current CuHe executable is the final version.

The project needs to stay in beta for a while longer though since Unity 4.6 is still not final. So i cannot make the project file final neither. I have to wait here. I will most probably port it over to Unity 5 once it comes out. But besides that the project is finished.

Last and final big change: CuHe is now Open Source under the very free MIT license.

24.9.2014 – CuHe Beta Version 0.9.5

Unity has finally released the new GUI system. So i was finally able to finish my UI.

The new Unity GUI is unfortunately still buggy. And that’s the reason why i still have to use a string to display the value for my scale factor. I cannot set the text of the edit box.

But i didn’t want to wait another four or eight weeks until this bug is fixed. That’s why i release it now. And it is the first beta release because this is the release where everything is at its place now.

Besides the UI i have also added a skycube to have a neater background.

Beware, this version was made with Unity 4.6 Beta. No problem for the exe version. But the project file could make trouble with later Untiy releases. Use at own risk!

To Do: Code cleanup and adding more and better comments. Waiting for the Unity fixes …

19.8.2014 – CuHe Version 0.9.1

And next version. Biggest changing is that the project file comes in both popular languages. The scripts are in c# and js now. Not that it would make any difference in the speed of the tool. It is equal fast no matter if i build the c# version or the js version. That was one of the things that i was interested in.

But making the c# version had the benefit that i found out that list is much, and i mean much faster than the Unity array that i had in use for the js version.  The mesh creation got another speed boost by using list. It is three times faster now.

The code got some more cleanup. There are a few more comments in the code. The load file dialog shows jpeg and png at the same time now. The status line for mesh creation shows the creation time now. Fixed a bug with the editor method of the file browser. Forgot to parse for the big letters with the umlauts too. And blocked the buttons now when the mesh creation is in progress.

Many thanks goes to Silveryard and Marrrk who helped me with some code issues, and to translate the code to C#. I had quite a few white areas here. And you never stop learning.

17.8.2014 – CuHe Version 0.9.0

Here we go with a new file browser method. The code for that method is not from me, but from delspeedy from the german Unity Insider forum. Many thanks for this. This is the best file browsing method so far, because this method displays icons too. It uses the GetOpenFileDialog method.

The System.Windows.Form.dll is obsolete in this version therefore. And not longer on board.

I couldn’t manage to solve the umlauts problem directly. But i use a workaround now. I replace umlauts with their non umlauts substitutes. Ü becomes UE then. And voila.

That was it. I am through, except of the UI. And here i still wait for Unity 4.6. Next week is Unite, maybe we will see it appear then.

13.8.2014 – CuHe Version 0.8.5

I managed to implement a file browser. I’m not really happy about it at the moment though. The method has too much flaws. Well, it works. But that’s already the best that i can tell about it.

The current file browser implementation uses the System.Windows.Forms.dll from the Unity Mono folder. The original System.Windows.Forms.dll crashes Unity. And the Unity version of this dll is feature cut down. It gives a warning when compiling to exe that the method is not supported and that i should expect various failurs. As told, it seems to work, so this isn’t really an issue.

The main issues are: It doesn’t show thumbnails. Which is bad because i want to browse for images to load. It doesn’t show localized. And it writes a mwf_config into the my documents folder with every useage. Mono is having a funtime here.

So i will most probably try another method. Somebody told me about the GetOpenFilename method and provided even working code. Which worked like a charm, including showing icons. It doesn’t even require to include a windows dll.  So next halt is to rewrite the open and save file dialogs to that methods.

And i have to catch a bug with german umlauts.

7.8.2014 – CuHe Version 0.8

Achtung! When you want to rebuild this method to call the file dialog then you have to change the used Net method. Go to Edit, Project Settings, Player, and in the player settings for windows change the Optimization level from .NET 2.0 Subset to .Net 2.0

Some code cleanup and refactoring later …

– fixed the flipped normals at export.
– fixed a problem with comparing two floats, and saved quite a few accidentally created tris by that.
– added an application icon.
– added the name of the app to the settings
– the mesh gets cleared and all values resetted before recreation now.
– mesh creation runs in one loop again instead of three, which saves time.
– added a scale factor to set the height at mesh creation.
– added a timer to check creation time. This one is just for debug. It runs in the inspector.
– added a few message strings so that for example a click at save tells you that the mesh gots created.
– some minor other cleanups.
– Changed the startup image. This is the CuHe logo now.
– Made windowed the default startup.

To Do:

– Graphical UI – This has to wait for Unity 4.6. I want to use the new GUI solution.
– Optional: File Browser – I need also here the new GUI solution.

5.8.2014 – CuHe Version 0.5

When i made my terrain meshes for Alister i was always busy for quite a few hours to sweep out the needed areas to get a terrain mesh with straight cliffs. This tool saves me this task now. All i need is the heightmap. And one click converts the baby into a mesh then. A time saver.

I am sure that the used method is of use for some of you. The method can with some modifications also be used to create games like Minecraft. That’s why i decided to make the current project file open source. The scripts are written in Unity’s Javascript. But it shouldn’t be too hard to convert them to C#.

Roadmap:

Not really sure. This is a one trick tool. And it does already what it should, even when the result is still a bit buggy. I can fix the flaws in Blender though. So i don’t really eagerly need it to be any better. My developer heart bleeds a bit though. I hate to deliver half baked stuff. There is surely some things to improve left. Refactoring. And i will of course do bug fixing when i find something and when i am able to.

Currently the normals are flipped for example. And i still search for a way to flip them back. Unity refuses in the corresponding line to give a +1 result with calculating -1*-1. Something that works a few lines higher just fine. And i have no clue what is going on here.

But i am unsure what to do any further. Adding a proper UI will definitely have to wait until Unity gets its new UI stuff. Promised since 3 years or so. I am also unsure what to do regarding a file browser. I don’t really need this tool very often.

We will see 🙂

Known and open Bugs:

The normals are flipped after export.

2 thoughts on “CuHe – Developer Diary

  1. -smn-

    Nice!

    Do you think you would be able to implement file browser?
    As far as I know it is not possible in Unity

  2. Reiner Post author

    Thanks 🙂
    There is an example in the Unity Wiki that uses some kind of selfmade file browser. But i haven’t got it to work yet. And then there’s a way to use a special Mono dll to get access to the Windows file browser. So it is possible. But is quite an effort. And i’m simply not sure if it is worth it.

Leave a Reply

Your email address will not be published. Required fields are marked *