Ejemplo n.º 1
0
void CStatMeshViewer::Draw2D()
{
	CObjectViewer::Draw2D();

	if (!Mesh->Lods.Num())
	{
		DrawTextLeft(S_RED "Mesh has no LODs");
		return;
	}

	const CStatMeshInstance *MeshInst = static_cast<CStatMeshInstance*>(Inst);
	const CStaticMeshLod &Lod = Mesh->Lods[MeshInst->LodNum];

	DrawTextLeft(S_GREEN "LOD    : " S_WHITE "%d/%d\n"
				 S_GREEN "Verts  : " S_WHITE "%d\n"
				 S_GREEN "Tris   : " S_WHITE "%d\n"
				 S_GREEN "UV Set : " S_WHITE "%d/%d",
				 MeshInst->LodNum+1, Mesh->Lods.Num(),
				 Lod.NumVerts, Lod.Indices.Num() / 3,
				 MeshInst->UVIndex+1, Lod.NumTexCoords);

	// code similar to CLodMeshViewer::Draw2D(), but using different fields
	DrawTextLeft(S_GREEN "Sections: " S_WHITE "%d", Lod.Sections.Num());
	if (Inst->bColorMaterials)
	{
		for (int i = 0; i < Lod.Sections.Num(); i++)
			PrintMaterialInfo(i, Lod.Sections[i].Material, Lod.Sections[i].NumFaces);
		DrawTextLeft("");
	}
}
Ejemplo n.º 2
0
void CVertMeshViewer::Draw2D()
{
	guard(CVertMeshViewer::Draw2D);

	CMeshViewer::Draw2D();

	CVertMeshInstance *MeshInst = static_cast<CVertMeshInstance*>(Inst);
	const ULodMesh *Mesh = static_cast<ULodMesh*>(Object);

	// mesh
	DrawTextLeft(S_GREEN "Verts   : " S_WHITE "%d\n"
				 S_GREEN "Tris    : " S_WHITE "%d",
				 Mesh->Wedges.Num(),
				 Mesh->Faces.Num());

	// materials
	if (Inst->bColorMaterials)
	{
		for (int i = 0; i < Mesh->Materials.Num(); i++)
		{
			int TexIndex = Mesh->Materials[i].TextureIndex;
			if (TexIndex >= 0 && TexIndex < Mesh->Textures.Num())
				PrintMaterialInfo(i, MATERIAL_CAST(Mesh->Textures[TexIndex]), 0);
		}
		DrawTextLeft("");
	}

	// animation
	const char *AnimName;
	float Frame, NumFrames, Rate;
	MeshInst->GetAnimParams(AnimName, Frame, NumFrames, Rate);

	DrawTextBottomLeft(S_GREEN "Anim:" S_WHITE " %d/%d (%s) rate: %g frames: %g",
		AnimIndex+1, MeshInst->GetAnimCount(), AnimName, Rate, NumFrames);
	DrawTextBottomLeft(S_GREEN "Time:" S_WHITE " %.1f/%g", Frame, NumFrames);

	unguard;
}
Ejemplo n.º 3
0
void CSkelMeshViewer::Draw2D()
{
	CMeshViewer::Draw2D();

	if (!Mesh->Lods.Num())
	{
		DrawTextLeft(S_RED "Mesh has no LODs");
		return;
	}

	CSkelMeshInstance *MeshInst = static_cast<CSkelMeshInstance*>(Inst);
	const CSkelMeshLod &Lod = Mesh->Lods[MeshInst->LodNum];

	if (ShowUV)
	{
		DisplayUV(Lod.Verts, sizeof(CSkelMeshVertex), &Lod, MeshInst->UVIndex);
	}

#if UNREAL4
	if (Mesh->OriginalMesh->IsA("SkeletalMesh4"))
	{
		USkeletalMesh4* Mesh4 = static_cast<USkeletalMesh4*>(Mesh->OriginalMesh);
		if (Mesh4->Skeleton)
			DrawTextLeft(S_GREEN"Skeleton: " S_WHITE "%s", Mesh4->Skeleton->Name);
	}
#endif // UNREAL4

	// mesh
	DrawTextLeft(S_GREEN "LOD     : " S_WHITE "%d/%d\n"
				 S_GREEN "Verts   : " S_WHITE "%d\n"
				 S_GREEN "Tris    : " S_WHITE "%d\n"
				 S_GREEN "UV Set  : " S_WHITE "%d/%d\n"
				 S_GREEN "Bones   : " S_WHITE "%d",
				 MeshInst->LodNum+1, Mesh->Lods.Num(),
				 Lod.NumVerts, Lod.Indices.Num() / 3,
				 MeshInst->UVIndex+1, Lod.NumTexCoords,
				 Mesh->RefSkeleton.Num());
	//!! show MaxInfluences etc

	// materials
	if (Inst->bColorMaterials)
	{
		for (int i = 0; i < Lod.Sections.Num(); i++)
			PrintMaterialInfo(i, Lod.Sections[i].Material, Lod.Sections[i].NumFaces);
		DrawTextLeft("");
	}

	// show extra meshes
	for (int i = 0; i < TaggedMeshes.Num(); i++)
		DrawTextLeft("%s%d: %s", (TaggedMeshes[i]->pMesh == MeshInst->pMesh) ? S_RED : S_WHITE, i, TaggedMeshes[i]->pMesh->OriginalMesh->Name);

	// show animation information
	const CAnimSet *AnimSet = MeshInst->GetAnim();
	if (AnimSet)
	{
		DrawTextBottomLeft("\n" S_GREEN "AnimSet : " S_WHITE "%s", AnimSet->OriginalAnim->Name);

		const char *OnOffStatus = NULL;
		switch (MeshInst->RotationMode)
		{
		case EARO_AnimSet:
			OnOffStatus = (AnimSet->AnimRotationOnly) ? "on" : "off";
			break;
		case EARO_ForceEnabled:
			OnOffStatus = S_RED "force on";
			break;
		case EARO_ForceDisabled:
			OnOffStatus = S_RED "force off";
			break;
		}
		DrawTextBottomLeft(S_GREEN "RotationOnly:" S_WHITE " %s", OnOffStatus);
		if (AnimSet->UseAnimTranslation.Num() || AnimSet->ForceMeshTranslation.Num())
		{
			DrawTextBottomLeft(S_GREEN "UseAnimBones:" S_WHITE " %d " S_GREEN "ForceMeshBones:" S_WHITE " %d",
				AnimSet->UseAnimTranslation.Num(), AnimSet->ForceMeshTranslation.Num());
		}

		const CAnimSequence *Seq = MeshInst->GetAnim(0);
		if (Seq)
		{
			DrawTextBottomLeft(S_GREEN "Anim:" S_WHITE " %d/%d (%s) " S_GREEN "Rate:" S_WHITE " %g " S_GREEN "Frames:" S_WHITE " %d",
				AnimIndex+1, MeshInst->GetAnimCount(), *Seq->Name, Seq->Rate, Seq->NumFrames);
			DrawTextBottomRight(S_GREEN "Time:" S_WHITE " %4.1f/%d", MeshInst->GetAnimTime(0), Seq->NumFrames);
#if ANIM_DEBUG_INFO
			const FString& DebugText = Seq->DebugInfo;
			if (DebugText.Num())
				DrawTextBottomLeft(S_RED"Info:" S_WHITE " %s", *DebugText);
#endif
		}
		else
		{
			DrawTextBottomLeft(S_GREEN "Anim:" S_WHITE " 0/%d (none)", MeshInst->GetAnimCount());
		}
	}
}