armory3d / armory3d/armory

Batch Materials and spawning an unspawned object has incorrect mesh

Open
#3,002 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
3.3k
Forks
353
Avg merge
3d 16h
Merged PRs (30d)
1

Description

**Description**
When using SpawnObjectByName in either haxe or LogicTree with Batch Materials checked and Spawn turned off the object mesh is not correct.

**To Reproduce**
Armory Project > Renderer > Batch Materials = checked
Object to spawn > Armory Props > Spawn = unchecked
Create a new material and add it to the object to spawn and one other object.

*Note that this issue doesn't happen if the object is spawned on init.
After a delay spawn in the object and it will be a cube that is the equivalent size of the bounds of the original object.

**Expected behavior**
The object should spawn with the correct mesh and size.

**System**
Blender: 3.6.x
Armory: 2024.2.0
OS: Windows 11 Pro
Graphics card: NVIDIA GeForce RTX 2080

**Test File**
*(drag & drop the zipped .blend file here)*
[MaterialBatchingIssue.zip](https://github.com/armory3d/armory/files/14324128/MaterialBatchingIssue.zip)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the SpawnObjectByName entry point in Haxe or LogicTree and reproduce the case using the supplied MaterialBatchingIssue.zip. Compare delayed spawning with spawning on init while Batch Materials is enabled; done means the delayed object uses its correct mesh and size instead of a bounds-sized cube.

Written by the indexing model from the issue text.

Assessment

Tech stack
blender
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.