memory access violation

Blitz3D Forums/Blitz3D Programming/memory access violation

DareDevil(Posted 2006) [#1]
i have a problem, what use a load object command the message is "memory access violation"
the command is :
Objet_def = LoadAnimMesh ( "../GFX/Obj/Obj.b3d",ScaneBase )
what is a problem? the software function for big macchines

excuse for the my english


degac(Posted 2006) [#2]
1. Probably you missed some files or directory when you move from the other computer. Check the path "../GFX/Obj/..."
2. the obj.3d is TOO BIG (too many polys?) and on a low level machine Blitz3d crash.


Dreamora(Posted 2006) [#3]
have you called Graphics3D before trying to load a model?


Pinete(Posted 2006) [#4]
Have you debug enabled?
Maybe with debug enabled you could obtain a more specific error message.
Some of the error messages are just 'MAV' when debug is disabled. Be sure debug is enabled.

Maybe is a problem in the exportation, try to export the animmesh again and try...

I've experienced that kind of errors when all was ok but
I forget to do something with the mesh when exported.

Good luck!


DareDevil(Posted 2006) [#5]
thanks all

>Have you debug enabled?

yes

>Maybe with debug enabled you could obtain a more specific error message.

whats message?

the message is also with Debug disable


VIP3R(Posted 2006) [#6]
Check the file exists with the FileType(filename$) function before loading it...

File$="../GFX/Obj/Obj.b3d"
If FileType(File$)=0 Then RuntimeError "Can't see file!"
Objet_def = LoadAnimMesh ( File$,ScaneBase )

The file may be in the correct directory, but Blitz might be looking for it in the wrong place. Check the current directory...

Debuglog "Current Directory: "+CurrentDir$()

You can also check to make sure it has loaded ok by doing the following after using LoadAnimMesh()...

If Objet_def=0 Then RuntimeError "Load Failed!"



DareDevil(Posted 2006) [#7]
Thanks VIP3R,

i have applicate the your code the path load is OK!!
Hmm...

the software start on others macchine

bye bye


Sir Gak(Posted 2006) [#8]
The error "Memory Access Violation " means you are trying to use a graphics file that does not exist. The main number one reason it occurs, more than any other, is that a graphics object did not load into memory.

I see from the above posts that your filepath is OK. Maybe Blitz does not see your file as a legitimate graphics file and therefore does not load it. Also, the file being loaded might be a graphics file but isn't for some reason loading into memory. When troubleshooting, NEVER assume anything! Try the following:

Objet_def = LoadAnimMesh ( "../GFX/Obj/Obj.b3d",ScaneBase )
if Objet_def=0 then RuntimeError "File not loaded!"

In the above code snippet, checking AFTER you attempt a load, is the best way to see if it worked OK. If the load attempt results in 0 (zero), then the load attempt did not work, and you can then try tracking down what the problem might be.

If the Objet_def handle DOES load correctly (ie you get a non-zero value), then check other things. For instance, is "ScaneBase" specified in the load a real parent object? When troubleshooting, don't overlook the obvious.