Forum Discussion
AI Complaint Department
Here's an update. My application runs so well and silently that I had to break something to fix the app and keep it from turning off the HDM, IE my tv disconnects, while using Dirct3D. Added the feature arguments for the heartbeat and my monitor is still on so I guess it worked. AI offered about 2 pages of code for something I corrected with creating a list capturing a data point then clearing a list after it was used. If you need to load and display a texture and you see 3 pages of code from Ai something is wrong. Took me exactly 3 lines of code. If anyone runs into the problem look for this
// Prevent Windows display sleep
[DllImport("kernel32.dll")]
static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
[Flags]
enum EXECUTION_STATE : uint
{
ES_CONTINUOUS = 0x80000000,
ES_DISPLAY_REQUIRED = 0x00000002,
ES_SYSTEM_REQUIRED = 0x00000001
}
// Keep display active
SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS | EXECUTION_STATE.ES_DISPLAY_REQUIRED);
- SafariCalvinOct 27, 2026Copper Contributor
To reproduce that problem. Right click on your project in Visual Studio 2026. Add new object Graphics, Scene .obj, open the object and close it a few times watch how many meshes you get in the file name. Export from blender view the files in text editor they are clean. Open that obj in visual studio 2026 and watch how it keeps adding mesh to all the internal file names.
- SafariCalvinOct 27, 2026Copper Contributor
Here is the issue with the PNG OBJ and MTL. All the files were producing these names, and I still have one that is unusual. This one was running through Visual Studio.
// This does not look like a normal file name. Cylinder Mesh Mesh_Cylinder Mesh_Cylinder_Phong[32] it should be Mesh_Cylinder_Phong[32] or even better Phong[32] and everything was getting named like this plus. I believe this issue corrupted one of my png's and it was parsed as path Mesh about 10 times then lightening png.png which is unusual. Even the AI was complaining about these names when I was debugging. Either visual studio was or is giving wild names, or something internally was adding them. You have to open the files and view the source code to see the issue. Every file I had in the assets did this applying Mesh about times or this Mesh_Cylinder to each name. This is one I might have missed, and it was made in the Graphics Designer. I thought might have been Blender that did this but do not recall running this one through blender. It was test png with a red texture and I all I did was change the name to a new PNG called lightning to test the texture in my Visual Studio app. Embedded resources
newmtl Cylinder Mesh Mesh_Cylinder Mesh_Cylinder_Phong[32] illum 2 Ka 1.000000 1.000000 1.000000 Kd 1.000000 1.000000 1.000000 Ks 0.000000 0.000000 0.000000 Ns 1.000000 map_Kd Lightning.png this is the OBJ example mtllib Cylinder.mtl # # Cylinder Mesh Mesh # g Cylinder Mesh Mesh # # Cylinder Mesh Mesh_Cylinder Mesh_Cylinder_Phong[32] # usemtl Cylinder Mesh Mesh_Cylinder Mesh_Cylinder_Phong[32] v 1.000000 2.500000 0.000000 v 0.951057 2.500000 0.309017 v 0.951057 -2.500000 0.309017 v 1.000000 -2.500000 0.000000 v 0.000000 2.500000 0.000000 v 0.000000 -2.500000 0.000000- SafariCalvinOct 27, 2026Copper Contributor
It might be addressed already but as descriptive as possible. The problem occurs when you use Object Viewer. Ocne you have scene.obj you click that file. You have to add an object like a teapot for example. You click on the mesh of the teapot and in the right panel there will be an option to add a texture. There is a down arrow on the edge where it says name or something similar where it says texture. That's where you pick the earth.png for example and it applies to the model. Save the file and look at your mtl file names they will be normal. Close the mtl file normally. Click on the obj file so everything opens in the viewer again. Do same thing you did earlier just changing the name of the png to a different png in the object viewer and you'll see the texture applies to the model. Save the file. Open your mtl file and see what changed bedsides the png file name. All your paths will say mesh mesh or something similar. So when you have 3 materials for a mesh they all would change to mesh mesh mesh material1 for example. So every time you edit something and save in the object viewer you get another mesh added to the other files names from just loading object viewer making a change and then saving the file.