Comments (4)
Hi! Thanks for the detailed report!
Version 2.8 doesn't change anything regarding how materials are handled, so it probably won't fix your issue. (But it doesn't hurt to upgrade, especially if you plan to move to Godot 3.4 at some point).
Materials are a pain in Godot, but I think this is probably related to issue #46.
- Godot doesn't let you edit mesh resources files directly, (when importing an obj for example, you have to create an inherited scene first).
MultiMeshInstance
doesn't care about this scene and works with the mesh resource directly.- Which means, all the materials from the inherited scene are ignored.
The fix was to save a reference to all the materials when the instancing is done the first time, and restore them on _ready
each time. The issue is, we can't use Material Override
for this because the mesh may have several surfaces, not just one, so we edit the mesh resource instead. But since the add-on just keeps a reference to the original material, not a duplicate, that's probably what's causing the material to become an ExtResource in the last screenshot.
This is a tricky issue, but I'll try to come up with a fix soon.
from scatter.
So, it's rather hard to debug since I haven't figured out the exact steps to recreate the issue (it did happen at some point but I don't know what I did exactly). I haven't managed to trigger the bug again after my changes, so maybe it's fixed? Let me know if it happens again.
I've also added an option under the ScatterItem
node, called Merge target meshes
.
- It uses all the meshes from the source scene, rather than just the first one it can find.
- It still generate a single multimesh but the result is visually identical to what you get when not using instancing.
- The drawback though is that it creates a brand-new mesh resource, directly stored in the current scene.
- It's not an issue for small meshes but may or may not cause issues with meshes with a high polycount so it's disabled by default.
- It's not an issue either if you update the source scene, changes will be updated automatically.
- You probably won't be able to replicate the material issue when this option is enabled
It's pushed on the master branch, commit 53cb1fa.
I'll probably make a release soon, but let me know if you still have issues!
from scatter.
Thanks so much for the quick fix! I haven't tried it in full, I'll let you know if the issue comes up again or if it seems totally fixed.
At the very least, the ability to make new resources to protect the instantiated one sounds like a really good work-around. I don't use scatter for high-poly meshes, and my build size is mostly dictated by textures rather than models, so the added filesize shouldn't be an issue for me. After experimenting with the new release I might go back to the old version to try and find something more consistent for reproduction, cause I have a few ideas I haven't tried yet.
from scatter.
Closing due to lack of activity. Feel free to re-open it if the fix above didn't solve it completely.
from scatter.
Related Issues (20)
- How can I make it so that my trees dont go over roofs and props? HOT 1
- How to make grass not grow inside of buildings? HOT 4
- Errors under Windows with rc1 HOT 2
- Remove from path multiple problems HOT 2
- [4.0] Port the split multimesh feature from 3.0
- How to set shader parameter on ScatterItem mesh in 4.0 version HOT 6
- Load time / pop in (get notified when grass is loaded?) HOT 8
- Grass not working properly in game
- After scattering the collsions are gone? HOT 1
- v4 use_instancing Mesh merging doesn't always work, prints errors HOT 3
- [Suggestion] Save Transforms to Scene HOT 5
- Godot 4 - object is class doesn't work HOT 2
- Readme mentions specific license file for assets which does not exist HOT 1
- Does not work in 4.1 dev3 HOT 2
- ScatterItem broken in v4.0.3.stable.mono.official [5222a99f5] HOT 2
- ScatterItem can't define items(scenes) which have children that are not Node3D or subclasses of it HOT 2
- [Feature] Ability to randomize parameters of instances HOT 4
- Godot V4 non-instance throw HOT 4
- Current v4 branch build does not load, and can crash beta 6 on project load HOT 3
- Suggestion: generate collision model HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scatter.