U3 UV problem with Beast

hello everyone,
i’m generating via an editor script a simple hard-coded cube, i need the UV to be greater than 1 so that i can have tiled textures without changing the material tiling, everything is working fine except it seems Beast is not generating any UV2 and the lightmap is grey…
UV (not UV2), normals, tangent are working fine…
Am i missing something while generating the mesh?
Here’s the code is use for generating the cube (i stripped the coordinates for lenght reason, if necessary i can post them :smile: )

var brush : GameObject = new GameObject ("Brush");
brush.AddComponent (MeshFilter);
brush.AddComponent (MeshCollider);
brush.AddComponent (MeshRenderer);
var cubeMesh = new Mesh ();
var newVertices : Vector3[] = [ ... ]; 	// 24 vertices
var newUV : Vector2[] = [ ... ];	// 24 UVs
var newUV2 : Vector2[] = [ ... ];	// 24 UV2s
var newNormals : Vector3[] = [ ... ];	// 24 normals
cubeMesh.vertices = newVertices;
cubeMesh.triangles = [	...  ];		// 12 triangles
cubeMesh.uv = newUV;
cubeMesh.uv2 = newUV2;
cubeMesh.normals = newNormals;
cubeMesh.name = "Brush Cube";
TangentSolver (cubeMesh);	// here i calculate tangents
//cubeMesh.Optimize();
//cubeMesh.RecalculateNormals();
//cubeMesh.RecalculateBounds();
	
brush.GetComponent (MeshFilter).mesh = cubeMesh;
brush.GetComponent ("MeshCollider").mesh = cubeMesh;
brush.renderer.sharedMaterial = new Material(Shader.Find("Diffuse"));
brush.renderer.sharedMaterial.mainTexture = tex;
Selection.activeGameObject = brush;

BTW if i don’t input any UV2 at all i get a warning saying Beast requires UV coordinates between (0, 1)
Also, sorry for my bad engligh :sweat_smile:
EDIT: i attached a couple of images
this is the cube with a simple red point light

same cube, with baked lighting

here’s the cube lightmap

any help is greatly appreciated :smile:

bump

i really need this to work, is there any documentation about Beast out yet?

I’ve also noticed the same thing. Prior to today, I’ve been doing most of my Beast tests with Unity’s primitives, and I had been under the impression that the UV2 unwraps were being done automatically. Now that I’ve done a test with an imported mesh, it’s clear that UV2 isn’t being automatically generated.

I’d understand this if there already existed a second UV channel, but this is not the case (my imported mesh only has one UV set).

Isn’t UV2 supposed to be handled by Beast if it’s not already present?

if you click on the “generate uv” button and allow it to generate UV2 data in the import settings, then yes

Otherwise no :slight_smile:

Oh good lord, I hadn’t noticed that before. I kept hunting around the various lightmap tabs, since I knew I’d seen something to that effect at some point.

Cheers, that saves me a headache! :slight_smile:

But my mesh is not imported, so i don’t have any magic button…
I can’t believe there is no way to automatically generate the UV2 of a not-imported mesh… :frowning:

Found! :smile:

Unwrapping.GenerateSecondaryUVSet (mesh);

I didn’t know i have all the new documentation in the unity folder… :sweat_smile: