Author : disting


Reply
Reply
 
Thread Tools Display Modes
equil's Avatar
Old (#1)
▂▄▅▆▇ Unity3D Master Thread ▇▆▅▄▂

Get unity3d:
http://unity3d.com/unity/download/

Useful resources and learning materials:
Forums http://forum.unity3d.com/
Semi-official Wiki http://unifycommunity.com/wiki/index...itle=Main_Page
Q&A http://answers.unity3d.com/index.html
Scripting tutorials http://www.unity3dstudent.com/
Scripting tutorials http://cgcookie.com/unity/

Popular Plugins & tools:
Strumpy Shader Editor: http://forum.unity3d.com/threads/56180

Last edited by equil; 02-10-2012 at 07:15 PM..
Offline , triangle, 292 Posts, Join Date Oct 2008, Location gbg sweden  
   Reply With Quote

Computron's Avatar
Old (#2)
FUCK UNITY.

nah, jus kiddin'
Offline , dedicated polycounter, 1,440 Posts, Join Date May 2011, Location Minnesota, USA  
   Reply With Quote

tristamus's Avatar
Old (#3)
Woohoo! Finally, Unity gets Polycount's love.
My Portfolio - Portfolio
My favorite book - "Meditations" by Marcus Aurelius
Offline , polygon, 647 Posts, Join Date Jul 2008, Location San Francisco, CA Send a message via AIM to tristamus  
   Reply With Quote

e-freak's Avatar
Old (#4)
Crossposting from the Unity Sutup Thread, maybe we can add this to the original post once solved?
Quote:
Originally Posted by e-freak View Post
[...]

is this the correct unit setup or would i set the system unit scale to centimeters as well?
also: monster's solution to the FBX scale import problem:
Quote:
Originally Posted by monster View Post
[...]Put a text file (javascript) in ...\Assets\Editor\ImportSettings.js (make the folder if needed.)

Paste this code into it and save it:

Code:
// This function will over write the default Unity import scale of 0.01.
class DefaultMaxSceneScale extends AssetPostprocessor {
    function OnPreprocessModel () {
        if (assetPath.Contains(".max")) {
            var modelImporter : ModelImporter = assetImporter;
            modelImporter.globalScale = 1.0;
        }
    }
}
I haven't tested this, but I think it will work. You can remove the .max check if you want it to scale all models on import.

As for me, my unit setup in Max is 1 unit = 1 centimeter, and display is set to generic units. I've never had a scale problem. [...]
and the last thing: the axis problem: did anyone ever get rid of it?
Quote:
Originally Posted by e-freak View Post
just found this, which seems to describe the problem pretty spot on. [...]

Cinematic Artist - CVG - Crytek
Linkedin profile
Offline , polygon, 702 Posts, Join Date Sep 2008, Location Germany, Darmstadt  
   Reply With Quote

Maph's Avatar
Old (#5)
The coordinate system conversion is still unsolved and I doubt you'll be able to fix it yourself without writing a custom FBX importer, but you can help UT notice this by voting this up
http://feedback.unity3d.com/forums/1...d-without-game
Offline , polycounter, 952 Posts, Join Date Mar 2011, Location Nottingham, United Kingdom  
   Reply With Quote

Farfarer's Avatar
Old (#6)
Code:
class MyFilePostprocessor extends AssetPostprocessor {
	
	function OnPreprocessModel () {
		// Set imported models to scale 1.
		// Disable swap UV channels.
		var modelImporter : ModelImporter = (assetImporter as ModelImporter);
		modelImporter.globalScale = 1.0;
		modelImporter.swapUVChannels = false;
	}
	
	function OnPostprocessModel ( object : GameObject ) {
		FixMaxImport ( object );
	}
	
	function FixMaxImport ( object : GameObject ) {
		// Unrotate root transform.
		object.transform.rotation = Quaternion.identity;
		
		// Get all meshes and unrotate them.
		var meshFilters : MeshFilter[] = object.GetComponentsInChildren.< MeshFilter > ();
		for ( var j : int = 0; j < meshFilters.length; j++ ) {
			FixMesh ( meshFilters[j].sharedMesh );
		}
	}
	
	function FixMesh ( mesh : Mesh ) {
		var resetTransform : Quaternion = Quaternion.Euler ( -90.0, 0.0, 0.0 );
		
		
		var newMeshVertices : Vector3[] = new Vector3[mesh.vertexCount];
		var newMeshNormals : Vector3[] = new Vector3[mesh.vertexCount];
		for ( var i : int = 0; i < mesh.vertexCount; i++ ) {
			newMeshVertices[i] = resetTransform * mesh.vertices[i];
			newMeshNormals[i] = resetTransform * mesh.normals[i];
		}
		
		mesh.vertices = newMeshVertices;
		mesh.normals = newMeshNormals;
		mesh.RecalculateBounds ();
	}
}
This should unrotate all models that don't have animation on import.

I've tried fixing skeletal animation - got somewhere close on very simple rigs - but it's far harder to fix... the maths and internal workings is a little beyond me.


Also, I have some Unity related tutorials (mostly shader stuff) up on my blog; http://www.farfarer.com/blog/ - might come in handy for some.

Last edited by Farfarer; 02-08-2012 at 03:37 AM..
Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch