From d32f24f147068e6cbecb31c7f98047f68bc8b58a Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Sun, 21 Jul 2019 19:03:28 -0400 Subject: [PATCH] Embed texture. --- Object3D.java | 80 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 79 insertions(+), 1 deletions(-) diff --git a/Object3D.java b/Object3D.java index 750acd4..2ccc4c6 100644 --- a/Object3D.java +++ b/Object3D.java @@ -29,6 +29,9 @@ Object3D saveskeleton; // + byte[] versions[]; + int versionindex = -1; + ScriptNode scriptnode; void InitOthers() @@ -215,6 +218,9 @@ // o.transientrep = this.bRep.support; // o.bRep.support = null; // } + o.selection = this.selection; + o.versions = this.versions; + o.versionindex = this.versionindex; if (this.support != null) { @@ -268,6 +274,11 @@ { this.support.bRep = o.transientrep; } + + this.selection = o.selection; + + this.versions = o.versions; + this.versionindex = o.versionindex; // July 2019 if (this.bRep != null) // this.bRep.support = o.transientrep; // this.support = o.support; @@ -415,6 +426,7 @@ } boolean live = false; + transient boolean keepdontselect; boolean dontselect = false; boolean hide = false; boolean link2master = false; // performs reset support/master at each frame @@ -3106,7 +3118,7 @@ { if (bRep != null) { - bRep.GenerateNormalsMINE(); + bRep.MergeNormals(); //.GenerateNormalsMINE(); Touch(); } } @@ -5409,6 +5421,51 @@ blockloop = false; } + void ResetSelectable() + { + if (blockloop) + return; + + blockloop = true; + + keepdontselect = dontselect; + dontselect = true; + + Object3D child; + int nb = Size(); + for (int i = 0; i < nb; i++) + { + child = (Object3D) get(i); + if (child == null) + continue; + child.ResetSelectable(); + } + + blockloop = false; + } + + void RestoreSelectable() + { + if (blockloop) + return; + + blockloop = true; + + dontselect = keepdontselect; + + Object3D child; + int nb = Size(); + for (int i = 0; i < nb; i++) + { + child = (Object3D) get(i); + if (child == null) + continue; + child.RestoreSelectable(); + } + + blockloop = false; + } + boolean IsSelected() { if (parent == null) @@ -5718,6 +5775,27 @@ } } + void EmbedTextures() + { + if (blockloop) + return; + + CameraPane.EmbedTextures(texture); + + int nb = Size(); + for (int i = 0; i < nb; i++) + { + Object3D child = (Object3D) get(i); + + if (child == null) + continue; + + blockloop = true; + child.EmbedTextures(); + blockloop = false; + } + } + void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) { Draw(display, root, selected, blocked); -- Gitblit v1.6.2