Assimp.Net GetTextureCoords missing from Assimp.Mesh - c#

I'm facing a very strange error in my VS2010 project that uses c# + OpenTK + Assimp.net (The packages of the last 2 are from NuGet, so I suppose them updated to their latest version)
When I try to iterate the vector3 of the UV coordinates using:
model.Meshes[n].GetTextureCoords(0)[i]
I get the following error:
error CS1061: 'Assimp.Mesh' does not contain a definition for
'GetTextureCoords' and no extension method 'GetTextureCoords'
accepting a first argument of type 'Assimp.Mesh' could be found (are
you missing a using directive or an assembly reference?)
I don't understand why! Can someone please help me?
AssimpNet is correctly referenced (I'm able to load and visualize any 3D model correctly if I comment the UV part)
And in the using part:
using System;
using System.Collections.Generic;
using System.IO; //Required by Assimp-net
using System.Reflection; //Required by Assimp-net
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using OpenTK.Platform;
using Assimp; //Required by Assimp-net
using Assimp.Configs; //Required by Assimp-net
EDIT: I also tried to change the order of the "using"s... or to remove some of them to see if there was some sort of namespace clashing but without any success

It's simply Mesh.TextureCoordinateChannels[0][i]. GetTextureCoords() does not exist. If you saw it anywhere in a tutorial, let me know where.

Related

I've got error CS0234 when I tried to build my 2D project in Unity

I'am new in Unity, so don't be angry)
I tried to build my game, but I've got those errors:
-Assets\Scripts\PlayerMovement.cs(5,19): error CS0234: The type or namespace name 'WSA' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
-Assets\Scripts\SpawnMovePoint.cs(4,19): error CS0234: The type or namespace name 'Build' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
-Error building Player because scripts had compiler errors
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEditor.Build.Reporting; // Problem Line
using UnityEngine;
using UnityEngine.SceneManagement;
public class SpawnMovePoint : MonoBehaviour
{
public Transform left, right, _point;
float MinX, MaxX;
public void Start()
{
MinX = left.position.x;
MaxX = right.position.x;
}
public void CreatePoint()
{
_point.position = new Vector3(Random.Range(MinX,
MaxX),_point.position.y,_point.position.z);
}
}
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine.WSA;//Problem Line
public class PlayerMovement : MonoBehaviour
What should I do to fix them?
How can I make these references?
What does it mean, what 'Build' does not exist in 'UnityEditor'?
'-Error building Player because scripts had compiler errors'
This simply means that the script cannot be compiled because it contains some errors, pretty straight forward.
Can you tell me why do you need 'UnityEditor.Build.Reporting and WSA ??
Also, you should share more code so we can see where and why you are using a certain namespace and whether the code will work without them or not.
Please Include more information to help me as well as others to understand and help fix your problem. Make sure to also show any research you have done to try and fix this problem.

Does not contain a definition for ToGridModel

I can't seem to resolve the following error that states:
"System.Linq.IQueryable' does not contain a definition for
'ToGridModel' and no extension method 'ToGridModel' accepting a first argument of type
'System.Linq.IQueryable'could be found (are you missing a using directive or an assembly reference?)"
Any ideas about how I can resolve this issue?
Am I missing a "using" statement at the top of my file somewhere, or do I need to modify
ToGridModel to some other kind of command?
I'm using Telerik UI for ASP.NET Mvc, Kendo UI,
and Telerik Data Access extensions by the way.
I'm also receiving similar errors for the Viewbag as well in my Controller files.
I'm not too sure how to fix that major issue either.
Any help would be greatly appreciated. Thanks
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using System.IO;
using System.Text;
using System.Collections;
using Kendo.Mvc;
using KendoGridBinder;
using NPOI.HSSF.UserModel;
namespace AssetMgr_TeleMVC.Controllers
{
public class SharedController : Controller
{
// GET: Shared
// Exports the whole selected grid to csv in comma separated format
public ActionResult ExportCsv(int page, string orderBy, string filter)
{
// IEnumerable orders = GetOrders().AsQueryable().ToGridModel(page, 10, orderBy, string.Empty, filter).Data;
using (Model_OpenAccess_AssetMgr.ctx_OpenAccess_AssetMgr dbContext = new Model_OpenAccess_AssetMgr.ctx_OpenAccess_AssetMgr())
{ IEnumerable TableRows = dbContext.Assets.AsQueryable().ToGridModel(page, 10, orderBy, string.Empty, filter).Data;
MemoryStream output = new MemoryStream();
StreamWriter writer = new StreamWriter(output, Encoding.UTF8);
writer.Write("HSC TAG,");
writer.Write("Asset Name,");
The equivalent method in UI for ASP.NET MVC is ToDataSourceResult. You need to import the Kendo.Mvc.Extensions namespace.
Just add Telerik.Web.Mvc.Extensions to your 'using' section. that's all

Error while trying use project's classes into another project

i have this structure:
Entity:(It's a Project named "Entity" - type: ClassLib)
Class 1;
Class 2;
Class 3;
DataBase:(It's a Project named "DataBase" - Type: ClassLib)
Class 1;
Class 2;
Class 3;
MainProject: (Windows Form)
Some Forms;
Then what I did was:
Added both projects into MainProject's references
Wrote on the codebehind:
using DataBase;
Worked perfect... But when I try to add the DataBase Project into the codebehind, it doesn't show up while I'm typing and also give me this error:
Error 2 The type or namespace name 'DataBase' could not be found (are you missing a using directive or an assembly reference?)
Ps: All the Classes of the projects (Class 1,2,3...) have the same namespaces wich is the project's name.
I tried some stuff I found on the internet, but nothing worked... Any Idea why?
UPDATE
My Code:
MainProject
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Entity; ( WORKED ! I can acess Entity's Class)
using DataBase; <---------------------------------- (ERROR HERE)

How to change State/Status in CRM 2013 using c#

How do I change State and/or Status of an entity in CRM 2013 using C#?
Neither CRM 2011's SetStateRequest nor the earlier SetStateDynamicEntityRequest are being recognized.
Searching online didn't seem to help either... Am I missing a namespace or something?
Thanks in advance
Namespaces:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Discovery;
using Microsoft.Xrm.Sdk.Messages;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Web.Services.Protocols;
The function:
private void changeUserStatus(Guid userId, IOrganizationService service, int state)
{
SetStateRequest setStateRequest = new SetStateRequest
{
EntityMoniker = new EntityReference("systemuser", userId),
State = new OptionSetValue(state),
Status = new OptionSetValue(-1),
};
service.Execute(setStateRequest);
}
IMPORTANT: My SetStateRequest is NOT recognized by visual studio 2012, so unlike the above example it's not highlighted and actually red underlined with the "the type or namespace not found" message displayed when hovering
Edit: I see the question got downvoted and I'm sorry if I'm missing something but I really have no more information to provide apart from the fact that I've spent 4 hours yesterday looking for this online (including stackoverflow) without any avail. I may be using the wrong search criteria or looking in the wrong places, but if that's the case could anyone at least point me in the right direction? I'm a beginner on all of this (both stackoverflow and crm2013) and I'm kind of stuck on this. Thanks again
You are not referencing microsoft.crm.sdk.proxy.dll and its namespace Microsoft.Crm.Sdk.Messages
so the code will be
using Microsoft.Crm.Sdk.Messages;
Another thing, be sure that the int values for State and Status are valid for the entity (in your case systemuser)

Problems converting VB.NET to C#

I am trying to convert some vb.net to C#, but I keep getting errors. At the moment, I am getting the following error:
The name 'Strings' does not exist in the current context
The problem line is:
strUser = Strings.LCase(Strings.Trim(strUserInitials[strUserInitials.GetUpperBound(0)])).ToString();
Anyone know why this is happening?
I have the following namespaces set:
using System;
using System.Web;
using System.Web.Services;
using System.Web.Script;
using System.Web.Script.Services;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
I am working on a webservice (asmx file).
The Strings utility class is in the Microsoft.VisualBasic namespace.
You can add a reference to the library and use it from your C# code, or rewrite the calls:
strUser = strUserInitials[strUserInitials.GetUpperBound(0)].ToString().Trim().ToLower();
In c# there is no Strings class in System namespace. and in the string change LCase to ToLower, So:
strUser = string.ToLower(string.Trim(strUserInitials[strUserInitials.GetUpperBound(0)]));

Categories