imagination XD

realizing dream


2 Comments

[Tutorial] MMD 4 Unity

Flawless, I wish Bullet Physic comes to Unity 5. VMD Anim + FBX Anim demo.

 

So I found out how to Import PMD / PMX to Unity. My old trick uses Blender, PMD Importer, and FBX Exporter. It was like this below, (mine was old anyway…) *keep scrolling for a simpler way*

Recipe

  1. One Teaspoon of Blender (I use 2.71)
  2. A cup of Sugiany Blender MMD Tools
  3. a PMD Model of course
  4. And 1Kg of Patients








Stereoarts’ MMD4Mecanim

And it was really long and hard and it doesn’t even have an automatic physics configuring! And then I found this good guy posts about MMD4Mecanim which only import PMD / PMX to Unity Assets folder and it’ll automatically do the magic and poof! You got PMD model on Unity.

MMD4U9

Any motions can be played with this

 

Why MMD4Unity ? Isn’t MMD just enough ?

  • Unity has Mecanim, it’s easier (for me) to animate especially a lazy person like me (too lazy to reanimate every locomotion for every model)
  • Unity 5 now has full access of epic post processing. Depth of Field! Bloom! Motion Blur! Edge Detection!
  • And many more…

What you’ll need for MMD4Mecanim,

  1. Unity
  2. Stereoarts’ MMD4Mecanim (download is on MMD4Mecanim_Beta_*.zip)
  3. A PMD / PMX Model.

And here’s how to import your PMD / PMX Model to Unity

  1. Download and extract PMD / PMX Model, copy whole folder to Unity Assets folder
  2. MMD4U1
  3. Then you’ll found there’s a MMD4Mecanim assets file (It has Unity logo)
  4. MMD4U2
  5. Read the License agreement and then click process.
  6. If you have a VMD File (MMD’s Motion data), copy your VMD data to Unity Assets and put your VMD to Animation Clip field.
  7. MMD4U3
  8. Then press process
  9. MMD4U5
  10. Always remember to set Animation Type to Humanoid then press Apply. If you not, no animation can be played unless you import a VMD file.
  11. MMD4U6
  12. Remember to select your Animator controller and Check Apply Root Motion and turn on Bullet Physics
  13. Now add your processed FBX to your scene, it’s now compatible for all your Mecanim like ThirdPersonHumanoid. If you want to add VMD to your mecanim, just Create a New state then put your anim-ized VMD there, and play.
  14. MMD4U7
  15. MMD4U8
  16. Flawless isn’t it ?


Leave a comment

[Blog Post] Unity 5 Realtime Rendered Animation ?

Everyone was making games with Unity, so I make animation with Unity. Unity was such a good guy greg, Unity 5 free now supports every post processing / pro features. So I decided making animation with Unity. One thing that confused me, why 3D Animation software doesn’t have Mecanim / autorig like features ? I know there’s one named “Motion builder”, but it’s not easy or good as Animeeple or Mecanim. Anyway, I know making animation is not easy, but my mission is to find the easiest, most efficient, fastest and quickest way to make animation, it’s not 1980 anymore.

At first I was going to use Physical Renderer but to render basic environment + 2 characters with my 3D Software physical renderer and it took 4 hours to render 150 frames. It was so long, meanwhile using Unity only took 0.03 seconds per frame (Final render took only 1 to 2 seconds per frame).

As I said before I have a plan on making Original Net Anime with 3D Software but haven’t decided which I’ll use. But before jumps making Original Net Anime, I have to practice or make animation experiments so the viewer can’t yell **** about it. Seriously, I make this free and I didn’t beg even a penny from you or begging for crowdfunding.

These are animation experiment I’m gonna making :

  1. Cosmos – kirin PV
  2. Wedding Dress – Tae Yang dance scene
  3. Kyoani Challenge (Rising, Run > Jump > Hanging, Turn back and scared, Manual Walk)
  4. Nichijou Challenge (Rock paper scissor)
  5. Mecanim Challenge (Running through corridors, Run + Jump on rooftop, Manual Walk / Run, Natural Motion + Facial)
  6. Project Imaginechan shorts
  7. Mitsubishi FTO TVC
  8. Full length PV of my music Colorshift 2 / Signed in
  9. Project Imaginechan Opening Intro
  10. A Certain Musical Vocaloid

Every experiments has different workflow, for instance, wedding dress, I’m gonna make the motion from MMD then export VMD to Unity and start decorating. Cosmos PV will only use Unity 5. Kyoani Challenge will use Unity + Cinema 4D.

Unity 2015-04-23 00-15-21-47.avi_snapshot_00.00_[2015.04.23_19.16.54]Unity 2015-04-23 00-15-21-47.avi_snapshot_00.07_[2015.04.23_19.17.18] Unity 2015-04-23 00-15-21-47.avi_snapshot_00.08_[2015.04.23_19.17.10]

Unity Personal - 2-ZoomIndoor.unity - New Unity Project - PC, Mac & Linux Standalone DX11 APR16CosmosPV (1)

Therefore, I still have so many things to research. Making animation in Unity isn’t easy as you see. You have to deal with Unity’s spline interpolation.

sacac

Plus to make your character walking in unity using mecanim isn’t easy like playing games, you have to know how much speed and crossfade time while walking unless you are using Nav Mesh like my realtime animation back then. I put “Speed” state on Mecanim which controlled by NavMesh current speed.

It is so hard that you have to predict when NavMesh will arrive to destination (that’s why it’s easier to use Transform cause Unity wont give you a Live Preview of Mecanim). But making animation using MMD is much easier I say and the physics also looks flawless.

MikuMikuDance


Leave a comment

[Unity] Save Game with ArrayPrefs2

I already use this script since Catapult. This is the best saving script I ever use, but this is not really easy to use. I also developing my own format but it’s not really better than this. My own format will going to be use in Personified Fear or above game. Works with indie don’t worry.

You can see the script here.

It can save any types, but the most i liked is the Array function. It’s easier and much more safe.

For example, if you want to save sound volumes setting information (Javascript for example)

  1. In your Menu GUI Script, put var volumes = new float[5];
  2. Also set the awake / default value of volumes if Player haven’t set the volumes. like if(!PlayerPrefs.HasKey(“KeyName”)){ awakeVolumes[0] = Camera.main.audio.volume; awakeVolumes[1] = AudioListener.volume; volumes = awakeVolumes; PlayerPrefsX.SetFloatArray(“KeyName”, volumes);}
  3. Then set on start / awake function, if(PlayerPrefs.HasKey(“KeyName”)){ volumes = PlayerPrefsX.GetFloatArray(“KeyName”, awakeVolumes); }
  4. On your Scroll bar GUI of main volume (volumes[1]) or music volume (volumes[0]), the scrollbar value must be volumes[0] for music volume scrollbar. Whatever you set it, when player press Save, just put PlayerPrefsX.SetFloatArray(“KeyName”,volumes);
  5. To delete user data, just simply put PlayerPrefs.DeleteKey(“KeyName”)

Okay, this is the script example of Menu GUI

var volumes = new float[5]; // volumes has 5 array of float with 0 value...
private var awakeVolumes = new float[5]; //must be same array with volumes above

function Awake(){

awakeVolumes[0] = Camera.main.audio.volume; //music volume
awakeVolumes[1] = AudioListener.volume;

if(HasKey("Game Volumes")){
volumes = PlayerPrefsX.GetFloatArray("Game Volumes", awakeVolumes);
Camera.main.audio.volume = volumes[0];
AudioListener.volume = volumes[1];
}else{
PlayerPrefsX.SetFloatArray("Game Volumes", awakeVolumes);
volumes = awakeVolumes;
}

function OnGUI(){

// let's skip making window process
GUILayout.Label("Music Volume");
volumes[0] = GUILayout.HorizontalScrollbar(volumes[0],0.0,1.0);
GUILayout.Label(volumes[0].ToString());

GUILayout.Label("Main Volume");
volumes[1] = GUILayout.HorizontalScrollbar(volumes[1],0.0,1.0);
GUILayout.Label(volumes[1].ToString());

if(GUILayout.Button("Save")){
PlayerPrefsX.SetFloatArray("Game Volumes", volumes);
}
if(GUILayout.Button("Delete")){
PlayerPrefs.DeleteKey("Game Volumes");
}

}

}

My New 2013 saver use something like XML but i’ll make own format to keep player to change every value on XML.


4 Comments

[Personal] An Unusual Update

Hello everyone, I know I’ve been gone for so long, but I really don’t know what to do to make this site still active since I haven’t post for a long while.. I’ll probably broaden up this site. This site actually focus on Unity game research, but I’ll widen it up with animation research…

So today, I haven’t sleep yet, I see that Unreal Engine is finally free to download but such a misfortune that it didn’t support my computer. Unreal Engine needs 64 bit Windows and 8GB RAM, meanwhile i use good ol’ 32 bit Windows with 3GB RAM. That’s pathetic… You can download Unreal Engine here.

But, Unity 5 finally released, now I can back making games. :D
I hope Unity 5 will support my old 32Bit PC…

I recently had lost some ideas on making everything (games and animation). I wonder where my Inspiration lost. I can’t think such something to post here, Animation Plot, and Game designing…

It is true I’ve been improved a lot on my modelling skills in 1 year, but I’m still not pleased with it. I’m suck at texturing, and rigging.

Also I was making my first light animation, but before jumps to far, I need to make some render researches. It makes me such heartbroken looking at the render result of 3 hours of Global Illumination and Toon. Indeed I really suck at texturing, and rigging. Just look at that horrible faces. I’m not sure this will be good.

AH1_0113

What do you think ? What should I do ? I need critiques please…

I should be using Unity to render my animation because it’s easier and faster but my model can’t export the blend shape that I’ve done hard…

You know what’s more painful than stepping on a lego ? Re-skinning every different outfit on same character. I always got 3D Tumors everytime I tried to fix it. But in future, I’ll probably just use cloth physics not skinned cloth. But, I think graphics doesn’t matter. Yeah but if the plot was poor ?

I have 728 days to accomplish this, everything must be perfect. I still have time to remodel every character.

  • Animate Cosmos – Kirin PV
  • Animate Colorshift PV
  • Animate A Certain Musical Vocaloid
  • Animate Project Imaginechan ONA
  • Develop Moe Unite MMOFPS Game
  • Develop Nitro Racer XD 2 MMORacing game


2 Comments

[Unity Editor Tool] Set Tag Recursively

This tool will set all object children tag to parent’s tag. Without this, you would have to set every children tag one by one, with this, you’ll only need to drag one parent object to Object to change and every child object’s tag will be same with parent’s. But remember! The tag you want to change must add to Unity Tags (Unity > Edit > Project Settings > Layers and Tags).

Change Tags Recursively

This can be really useful you know since Unity wont let to change tags recursively.

Save it as javascript and put it on Editor folder… Ah yes, I put it on SKiPPER > Set Tag to launch this tool


class SetTagRecursively extends ScriptableWizard
{
	var objToChange : GameObject;
	var tag : String;
	
	function OnWizardUpdate () {
		//objToChange = Selection.gameObject;
	}
	
	function OnWizardCreate () {
		//for(x in objToChange){
			var x = objToChange.GetComponentsInChildren(Transform);
			for(var z in x) z.tag = tag;
		//}
	}
	
	@MenuItem("SKiPPER/Set Tag")
	static function TagRecursively () {
		ScriptableWizard.DisplayWizard("Change Tags Recursively", SetTagRecursively, "Touch to Henshin...");
	}
}


2 Comments

[Unity] Keyed Lipsync using Blendshape + Tagarela

edfedfe

I still research on how to make automated keyless lipsync. So, I found this plug in, it’s free, and it’s easy to use so I got that goin’ for me, which is nice.

Recipe (What you’ll need) :

  • PC with Unity 4.3 or above
  • Tagarela
  • Mesh that has blendshape (If you don’t know how to make blendshape, read this)
  • Blendshape that has at least A,I,U,E,O keys. (if you are too lazy to make E key, you can use I for every E)

Alright let’s start! I’ll use Kagamine Len by Animasa model as example.

  1. After finished download, open it in Unity.
  2. Select an object that has blendshape / skinned mesh renderer on it. Open Component > Tagarela. After that insert Audio Clip and then press Add.lt1
  3. Click Open Editor then press Create New Animation, choose Audio Sync, name it whatever you want, press save.lt2
  4. First, slide the tiny slider near audio’s start, then press + to add new keyframe, locate the new keyframe at the middle of audio, and adjust the blendshape below.
    lt3
  5. I use Unity chan’s konnichiwa (こんにちは私ユニティちゃん). 1 is all Zero, 2 is 100% 001 (O (I forgot to change name), 3 is also zero because it’s closing its mouth when saying kon’, and 4 is 100% i, when it says ni.
    lt4
  6. Set it till near perfection. Also remember to set keyframe to zero on all flat audio which is mute (does your mouth open when you say nothing ? unless you breathing with mouth, like me). For example, your voice was “Hello World”, 1 all zero keyframe was located before Hello, 2 keyframe was located in ‘He’ has 100% ‘E’, and 3 keyframe was located in the ‘llo” has 100% ‘O’ and 0% ‘E’, at the end of ‘Hello’ add 4 keyframe that is zero keyframe, and 5 keyframe was located at the beginning of ‘World’ which also zero. 6 keyframe repat like 2 keyframe but with different value.
    lt5
  7. After you done naturalising the lipsync, always remember to put zero keyframe at the start of audio not voice. and then save it. You may ask how to use it on gameplay, well, you’ll only need to put this GetComponent<Tagarela>().Play( <Your animation number (mine is 0 because it’s the first animation)> ); on a C# script. Also attach this script on the same place where your blendshape mesh.
    lt6
  8. Ta-da… Not bad I see. I also forgot to add some Mecanim animator, so it looks like stupid people says “Hello, I’m Unity-chan” but actually you are Len Kagamine.

Next, I’ll research much easier to use lipsync or Anime-like lipsync. Most anime I watch, they only use 1 key. Even they say “What the hell are you doing”, their mouth will be always open and close only, no wide or narrow. Also remember to make it jagged, so it’ll look like Anime. I also researching on how to combine cloth shader with Toon shader like cloth crumple shadow in usual anime.

Ah and Imagine-chan’s model has finished, and it’ll release probably this november. I think I’ll need to remodel, because her head looks ridiculous. However, morphless FBX and PMX download will be available. I’m kinda busy working. My supervisor wont let me to do this, so that’s why I wont upload this model soon.


Leave a comment

[Unity] Taking In-Game Screenshot

Hello, everyone, Sorry I didn’t post something here in long time. I’m very busy, leveling up my CG skills. I also post some random unity things.

So, basically, taking screenshot in Unity is very easy. Copy this script below, and attach it in Main Camera

var folderName : String = "DCIM";
var captureSound : AudioClip;
var quality : float; //Set screenshot resolutions, default is 1. 1 equals your monitor size.
private var screenshotFader : GameObject;

function LateUpdate(){
 if(screenshotFader){ //Flashing effect
 screenshotFader.guiTexture.color.a -= Time.deltaTime;
 if(screenshotFader.guiTexture.color.a < 0){
 Destroy(screenshotFader);
 screenshotFader = null;
 }
 }
 
 if(Input.GetKeyDown("C") && !screenshotFader){
 if (!System.IO.Directory.Exists(folderName)) System.IO.Directory.CreateDirectory(folderName);
 
 screenshotFilename = folderName+"/DSC_"+System.DateTime.Now.Day.ToString()+"_"+System.DateTime.Now.Hour.ToString()+System.DateTime.Now.Minute.ToString()+System.DateTime.Now.Second.ToString()+".png";
 if(!System.IO.File.Exists(screenshotFilename)){
 Application.CaptureScreenshot(screenshotFilename,quality);
 AudioSource.PlayClipAtPoint(captureSound,transform.position);
 DrawWhiteItem();
 }
 }
}

function DrawWhiteItem(){
 yield new WaitForSeconds(0.5); //wait for a few frames so the application can capture before the white flash comes out.
 screenshotFader = DrawFader();
}

static function DrawFader() : GameObject{
 var fdt = new Texture2D(1,1);
 fdt.SetPixel(0,0,Color.white);
 fdt.Apply();
 
 var fadex = new GameObject("CSader");
 fadex.AddComponent(GUITexture);
 fadex.transform.position = Vector3(.5,.5,1000);
 fadex.guiTexture.texture = fdt;
 
 return fadex;
}

now it’ll save the screenshot on your game root folder / DCIM (you can change the folder name).

Follow

Get every new post delivered to your Inbox.

Join 722 other followers