this is great but
It breaks when using more than 1 plugin
Construct 3 3DObject Plugin
Major Update - now supports gltf and animations
(Also bless the big tippers for helping with inspiration!)
This plugin loads a 3D Model into Construct 3, similar to the new built-in 3DShape plugin, but the 3D object can be a more complicated 3D model, loaded from a 3D model file format and texture. It also supports 3D animations.
Note - currently does not support rendering in the editor with gltf, 3D rendering will occur at runtime.
Big thanks to r0j0hound on the Construct forums for sharing the gltf parsing and animation code which I used as a base for the gltf integration in this plug-in.
Breaking change from 1.x.x plug-in. Now only supports gltf embedded format (with a separate texture png file) obj/mtl no longer supported. The change to gltf was to support animations (and eventually embedded textures if possible.)
This Work in Progress. If you are not used to working with 3D models, I suggest waiting for a more polished version of this project.
Again, please leave feedback or tag @kindeyegames on Twitter, this is in early development!
- Rotation on objects with multiple meshes may not work correctly.
3D Model file requirements:
- Must be gltf embedded format and a single texture (png, jpg formats are ok)
- If there is a not a single texture/material, try using a 3D tool (e.g. blender to bake all the textures down to a single texture.)
- The texture does _not_ need to be embedded in the gltf (turn off materials export in blender gltf exporter). Texture is applied to the object separately.
- Must be textured, not a solid color.
- Be aware of the 0,0,0 origin relative to the model center (affects rotation center and position.) This can be changed as needed with the Set local center ACE.
- Be aware of the relative scale of the model in model units. This can be scaled up/down with the Set scale ACE or property.
- 3D models are available on CGTrader and Turbosquid, but you may need to find the ones that have gltf and texture support. If there are multiple textures, usually look for the ones labeled diffuse or albedo. These will be the base color textures (e.g. not normal maps, bump maps, etc.) You can only use models that have one diffuse/albedo texture. (If you have expertise with blender you can load a model with multiple textures and then bake them to a single texture and export texture and gltf embedded file.)
- If the texture does not render correctly, try using the image editor to mirror the texture around the Y-axis or X-axis or rotate the texture.
- If a model you use is not available in gltf file format, try loading the model into blender and exporting with the gltf embedded file format. You must also be able to extract the texture to a separate file for this to work.
- Rotation for models that are more complicated, with multiple parts may not work yet.
- Merge multiple animations into a single file gltf file.
- I am not an animation expert, but frame based animation (e.g. mixamo style animation) works well, I am not sure about other formats.
- If you are importing fbx to blender consider using plug-in to improve fbx import to blender: https://blendermarket.com/products/better-fbx-importer--exporter
- Rendering performance is not optimized
- Animating models require additional performance
- You can control the animation rate to reduce the required CPU performance.
- Change the Project Setting: Advanced -> Rendering Mode -> 3D.
- Add a 3DObject to the project
- Add gltf embedded file to the project.
- Open 3DObject image editor loads the texture file into the image. Note image size must be larger than the Project's setting for spritesheet size (e.g. 512-4096), resize the image larger if needed in the image editor.
- Test! You can use the normal position ACEs to move in x,y direction and position related behaviors should work (though I tend to lock the 3DObject with other sprites w/ behaviors using events)
- To change z position, use the setZ elevation ACE (other behaviors or actions which affect zElevation should also work, e.g. sine behavior, drag and drop, etc.)
- Set the zHeight to match the relative zHeight of the object (used for C3 3D viewport clipping.) Use zScale for scaling of model Z.
- Set the 3DObject zScale to the 3D Camera expression zScale, whenever layout size changes and on initialization.
- Please post feedback and pix/vid of your tests.
Future state if this goes well:
- *DONE* Support multiple instances of one 3DObject
- *DONE* More animation ACEs (end of animation trigger, etc.)
- Add expression for current animation time or frame.
- Support correct rotation (for mixed multiple node types)
- Blend between animation changes
- Runtime loading of new model types (low priority, I suggest using more 3DObjects instead.)
Fire elemental model credit: https://sketchfab.com/3d-models/fire-elemental-05fe96ef7fca472ba0bf753686216002
Again, please leave feedback or tag @kindeyegames on Twitter, this is in early development!
Some possible tips for managing models and animations:
Version 1.6.1 supports obj/mtl models (deprecated)
Version 2.x.x+ supports gltf models
Click download now to get access to the following files:
- Add animation blending10 days ago
- Add scale and zScale expressions13 days ago
- Add CurrentAnimationTime/Frame Expressions15 days ago
- Thanks to the big tipper and effects.23 days ago
- Optimize animation processing when offscreen37 days ago
- Fix for flickering animation on animation change38 days ago
- Add set z height ACE42 days ago
- Animation rate fix43 days ago
Log in with itch.io to leave a comment.
this is great but
Check if the image texture size is larger than the project sprite sheet size. Set the project sprite sheet size to 512 and resize the image texture size to be 512 or greater.
I tested my loypolycar gltf on babylon its working fine on babylon but when i used it on c3 it shows white screen i didnot add any texture on babylon but it shows the texture but when i import it on c3 it shows white screen plz help
Did you follow all the instructions in the usage notes? Did you add a texture image to the 3DObject?
check your UV map in blender before export. you need to bake mutiple textures/materials into one. > add 3d object alpha > open texture diffuse/color map with edit and set path for gltf mesh > done
Can I request more expressions and conditions like what the current frame is and get the position data of a specific bone?
Yes, current animation time / frame. In terms of specific bone, can you give an example in terms of the gltf model?
"Failed to open project. Check it is a valid Construct 3 single-file (.c3p) project." when i try open all your c3p projects
Which version of C3 are you using? For this plug-in, I recommend the latest beta. Some of the earlier C3 stable versions did not have the latest C3 SDK which this plug-in depends on.
Its possible to import to c3 3d model without purhase "better fbx importer / exporter" ? i try use original export option from blender 2.93.5. On preview i see 3d model in game but on layout editor is not visible.
EDIT, i try using BLENDER and 3DsMax to export simple gltf models, but this dont work correctly
good job, but I am not much techy, i tried few models exported from blender but in c3 its not showing up when added path in 3dobject . thanks
Check out the example projects, look at the documentation for the project requirements for the gltf. 3D models and game engines tend to be techy unfortunately!
Hey, i have another idea... Would be possible to change gltf patch with events? Something like that: if situation x will happen so change gltf patch from "fire.gltf" to "rogue.gltf"?
Incredible job, i made piramid in blender and i added it in Construct 3 and its working!!! Really icredible, this is something from dreams, we dreamed about this all time! However some things don't working, for example if i will add effect to 3DObject so in editor is all good, but when i start preview so there 3DObject is invisible (i talking now about monstercreature). With my piramid, so the object is visible, but it had only one color (gray). I know this is in work, this is only alpha/beta version, but really i want to tell You made something really great!! This is something very very big, its miracle!!! I love it!!! Please don't give up with this, we love Your work, this project is totally brilliant!!!
Hmmmm.... wait, i was experimenting with other effects (Contrast) and its working correctly!!! Its dont working with Pixellate effect, i go now test other effects and i will see which effects working for 3DObjects and which not. Again, this is really crazy stuff, from dreams, big big love for this project!
Ok so i found that only 1 effect is working with 3DObjects. If we will add more than 1 so they will don't working correctly. Anyway this is don't problem for me for now. Would be possible to change texture by events? For example if "x" object will hit "monster creature", so "monster creature" will change texture from that lava to blue water texture (or other). For now there is impossible to do that right? Because i dont see option for that. Maybe in future if You will can add that so it will be great feature too!
Hmmmm.... i was think about that, and it may be possible with animations, so this is really awesome!
That's correct, with how C3 handles 3D and effects. Only a single Color type effect will work. Other effects like Distortion and Blend are unlikely to work.
There is a new effect compositor in the latest C3 beta (r270) which may allow for more effect possibilities though!
Will animation blending ever be possible in future? This is a great tool!
That is on the future to-do list.
if i put any obj or gltf 3d models it did not show the 3d models it shows only white help me plz
With the latest version, you can only use 3DObject with gltf models. Try out the sample projects. Also, check the dev console for errors. Try out your gltf models in Babylon sandbox to make sure they render. Also, follow the step by step instructions on how to add a 3DObject into a project.
I had upgraded from a version using obj/mtl, and my models were working fine. I updated the plugins and had to export the obj in the gltf format, but one of my models won't show at all, and all the others are wildly deformed. Importing the gltf in blender displays it as normal. Is there anywhere I can download previous versions of the plugin and go back to the obj/mtl version?
Sure, I exposed the older version (note there will not be updates for obj/mtl support.)
You are a life saver, thank you so much! I'll figure out what's wrong with my gltf exports and upgrade eventually, but I have a game due on Halloween so I just wanted to work with the obj method. Thanks again, and thanks for making such an incredible plugin!
I wanted to suggest a new feature for c3_spine_plugin for commission, but I can't find a way to get in touch with you.
Would it be possible to add a "spine" object to the "Use object image for faces" of construct 3 3DShape?
Sorry for the translation, I'm not good at English.
I know exactly what you mean and it would be nice to have. However, this is not under my control. It’s a request for Scirra to allow other objects to be used as textures for the 3D Shape. Please contact them though C3 forum and their aha suggestion platform. I am also on the Construct Community Discord.
An alternative would be to create a C3 3D billboard plug-in which accepts other textures, but that’s a bit of work to add another 3D plug-in just to work around 3D Shape limitations.
will this work in construct 2?
If I can add a suggestion, Can you make it possible to change the model using a string?
You mean at runtime?
I really like it! If you need help with more 3d formats, meshes, poly reduction etc. let me know maybe i can help. In beta this could be a real game changer.
By the way is it possible to get FunkyquadZ again? It is discontinued i know, but i would like to take a look again. Purchased it long ago.
ok, let’s connect on the Construct Community Discord to discuss both topics. I am Mikal on the CC Discord.
Construct keeps crashing after rotating and reloading the project. Also the model doesn't appear in the viewport.
Thanks for th report. Which version of C3 are you using?
Thanks to the big tipper (you know who you are!) I will release a version with in editor render this coming week.
I tried importing a model, but it's texture is all squashed and repeating. I popped it in blender to check, and it displays just fine. I've scoured the example project, but I can't tell if I'm missing a step or if there's a bug. Very impressive plugin though! A few more updates and this could be a huge addition to construct 3!
thanks for checking it out! If you can share a zip with the obj/mtl/png, I can take a look.
Thanks for the quick response, good luck with your plugin!