mirror of
https://github.com/Relintai/props.git
synced 2025-02-12 16:40:05 +01:00
Reimplemented mesh data instance creation in _prop_preprocess. Also don't set owners, so things won't show up in the editor.
This commit is contained in:
parent
8667cc8eaf
commit
5b71d7a931
@ -114,7 +114,7 @@ void PropInstance::_prop_preprocess(Transform transform, const Ref<PropData> &pr
|
|||||||
|
|
||||||
Node *n = sc->instance();
|
Node *n = sc->instance();
|
||||||
add_child(n);
|
add_child(n);
|
||||||
n->set_owner(this);
|
//n->set_owner(this);
|
||||||
|
|
||||||
Spatial *sp = Object::cast_to<Spatial>(n);
|
Spatial *sp = Object::cast_to<Spatial>(n);
|
||||||
|
|
||||||
@ -153,9 +153,14 @@ void PropInstance::_prop_preprocess(Transform transform, const Ref<PropData> &pr
|
|||||||
if (!mdr.is_valid())
|
if (!mdr.is_valid())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//add to job
|
MeshDataInstance *mdi = memnew(MeshDataInstance);
|
||||||
//job could merge textures if needed
|
add_child(mdi);
|
||||||
//chunk->mesh_data_resource_add(t, mdr, mesh_data->get_texture());
|
//mdi->set_owner(this);
|
||||||
|
mdi->set_transform(t);
|
||||||
|
//not yet sure how it would be best to do this
|
||||||
|
//Maybe giving this class a material, and setting it could work
|
||||||
|
//mdi->set_material();
|
||||||
|
mdi->set_mesh_data(mdr);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user