3d object doesn't show up in game

ERROR:GAMESYS: Failed to create Model component. Material vertex space option VERTEX_SPACE_LOCAL does not support skinning.
WARNING:RESOURCE: Unable to create resource: /_generated_91034f4d.modelc: NOT_SUPPORTED
WARNING:RESOURCE: Unable to create resource: /_generated_eff192e8.goc: NOT_SUPPORTED
ERROR:GAMEOBJECT: Could not instantiate game object from prototype /_generated_eff192e8.goc.
WARNING:RESOURCE: Unable to create resource: /game/minigames/guest-service/shelving/shelving.collectionc: FORMAT_ERROR

Originally I got this error when trying to play the game after importing my 3d object and the textures with it so I changed the vertex space to world, however it’s still black, which confuses me. I was reading up on Defold materials manual and am thinking it might have to do with render.enable_material() or something along those lines but am not sure what I should do now.


The model has no animations so I left it blank, but I think I imported everything in correctly after reading 3D models in Defold? Thanks in advance to anyone who replies.

You have an error in the console there, is that relevant?

Otherwise, I’d look into that the lighting of your shader works.
E.g. set the output color of the pixel shader to something related to the incoming light.
Then move on to the normals, to make sure they seem correct.

Hi there, so there is no skeleton for your model and no animations - what happens if you leave these fields blank and just fill in the fields for mesh, material and texture? At least the error should be gone then.

1 Like

Hello, as @anon95708182 mentioned the animation fields are not blank and should be if no animation is provided.

image
These 3 properties are the animation properties for your model. So it assumes that the provided (.dea) has a skeleton and also if the (Animations) property also has no animation there is no need to add anything to this field and the (default animation) is there for when you have provided animations in a set or a single animation and can choose a default animation to play. If you remove the .dea url from these fields the error should go away and then you can focus on the textures showing on the model.

1 Like

Thanks for the idea guys but I just tried that and it still hasn’t worked. I wonder if it’s due to lack of lighting? I don’t have a normal map or shadows attached to it, and it’s not a sprite even.

Yes it could be lighting, you are using the built-in model.material which does take in a lighting constant. Also could be the rendering script. Did you start your project from the template basic 3d? The basic 3d template provides a render script which renders the model predicate, otherwise you would need a custom renderscript with model rendering. Default empty project renderscript is 2d oriented.

1 Like

I did not, and that was my bad, I decided to switch to using 3d models last second to reuse them so I was using the desktop template beforehand. Should I just make a project using the basic 3d template, then copy the render scripts from there and import them? Thanks MasterMind for replying. Or could I just modify the material so it doesn’t take in 3d lighting and instead is only texture based?

You could copy or download the main.render and main.render_script from the basic 3d template and add it to your project and make sure to add it to the project setting > main> bootstrap > Render . You could also study the basic 3d template to learn about the light and add it to your project or copy the model.material + model.vp + model.fp add it to your project and edit the fragment program to be unlit( you would also need to set the .vp and .fp in the copied material).

Here’s the template on github you can copy or download it from here or you can just create a project straight from defold if you’d like

1 Like

Thanks, will get back to you if I have more troubles with applying this.

You could also share your project here and pehaps someone will take a closer look at whats wrong.

2 Likes

Thanks Mathias, will do soon, I have to figure out another problem first before this one, and unfortunately I do have a time limit. :sweat_smile:

Hi Mathias, I’m back, I read up more on shaders (still not entirely clicking but I think with time I’ll get it eventually), and am trying to apply defold-things/shadowmap at master · Dragosha/defold-things · GitHub in my own project.

Currently I have a light game object and script modified from the controller script in the original project and I want to modify it in editor, not necessarily in game, do you know if there’s any way to visualise the size of the light or the effects of it somehow in the editor or if that’s programmable, or do I have to make a sprite to represent the size and direction of it?

Another thing is that I don’t entirely understand how render_view works in the original project, I read the function and it makes some sense to me, but why were

	self.yaw   = 0
	self.pitch = 45
	self.zoom  = 40
	self.time  = 0

	self.light_yaw       = 60
	self.light_pitch     = 45
	self.light_zoom      = 20

these specific values,

I’m eventually going to modify them to be based on the light’s position, rotation, scale values. Is there any way to combine these sets of values (get rid of the top four) and pass it onto render_view()in the default.render_script.

Or I think in my case would it be better to try to just do render_scene() since I’m not actually changing the light placement in game. I don’t entirely understand the difference between render_view() and render_scene().

Thanks for reading my long TedTalk if you do. Sorry for late response.


Looking at the light game object in the example, it has a value of 0 for rotation, so is that why the light values are set to how they are? Oh I think I get that part somewhat now. So in my case if I want to set it in editor, I’d have to set the yaw and pitch to the rotation of my light game object, I think, but what is ‘zoom’ supposed to be?

If I do get the rotation of my game object, then I think I’d have to convert the quaternion value to yaw, pitch, and roll, which there is an equation for that. Actually I don’t think I need to get the yaw, pitch, or roll, I’d just set self.light_rotation = go.get_rotation("."), because since it already returns a quaternion I wouldn’t need to go through the hassle of what the original code was trying to do in the first place.

I guess for the location of where the light is pointing from, I’d have to grab the forward vector of it.