Skip to content

Commit

Permalink
Update for prefab2 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
EspeuteClement committed Jan 22, 2024
1 parent 67c9ec8 commit 3fc4979
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion h3d/prim/ModelCache.hx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ class ModelCache {
} else {
local3d = new h3d.scene.Object();
}
var ctx2 = p.make(local3d);
var sh = new hrt.prefab.ContextShared(res, p?.findFirstLocal2d(), local3d);
var ctx2 = p.make(sh);
if( parent != null ) {
// only return object if a single child was added
// if not - multiple children were added and cannot be returned as a single object
Expand Down
9 changes: 4 additions & 5 deletions hxd/fmt/hmd/Library.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ private class FormatMap {
private class ContextShared extends hrt.prefab.ContextShared {
var customLoadTexture : String -> h3d.mat.Texture;

public function new(loadTexture : String -> h3d.mat.Texture, ?res : hxd.res.Resource) {
super(res);
public function new(loadTexture : String -> h3d.mat.Texture, ?res : hxd.res.Resource, ?root2d: h2d.Object = null, ?root3d: h3d.scene.Object = null) {
super(res, root2d, root3d);
this.customLoadTexture = loadTexture;
}

Expand Down Expand Up @@ -765,10 +765,9 @@ class Library {
materialContainer = new h3d.scene.Mesh(null, mat, null);

#if prefab2
var shared = new ContextShared(loadTexture, null);

var shared = new ContextShared(loadTexture, null, materialContainer);
materialContainer.material = mat;
m.make(materialContainer,shared);
m.make(shared);
#else
var ctx = new hrt.prefab.Context();
ctx.shared = new ContextShared(loadTexture, null);
Expand Down

0 comments on commit 3fc4979

Please sign in to comment.