Bind material enabling and hide properly in viewport
This commit is contained in:
parent
9940c6f10d
commit
8bfa2293a8
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -174,7 +174,7 @@ namespace Bfres.Structs
|
|||||||
return ((FMDL)Parent.Parent).GetResFileU();
|
return ((FMDL)Parent.Parent).GetResFileU();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Enabled = true;
|
public bool Enabled { get; set; } = true;
|
||||||
public bool isTransparent = false;
|
public bool isTransparent = false;
|
||||||
|
|
||||||
public override void OnClick(TreeView treeView)
|
public override void OnClick(TreeView treeView)
|
||||||
|
@ -602,11 +602,13 @@ namespace FirstPlugin
|
|||||||
if (m.lodMeshes[m.DisplayLODIndex].faces.Count <= 3)
|
if (m.lodMeshes[m.DisplayLODIndex].faces.Count <= 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
var mat = m.GetMaterial();
|
||||||
|
|
||||||
if (shader != normalsShaderProgram)
|
if (shader != normalsShaderProgram)
|
||||||
{
|
{
|
||||||
SetRenderPass(m.GetMaterial(), shader, m, m.DisplayId);
|
SetRenderPass(mat, shader, m, m.DisplayId);
|
||||||
SetUniforms(m.GetMaterial(), shader, m, m.DisplayId);
|
SetUniforms(mat, shader, m, m.DisplayId);
|
||||||
SetTextureUniforms(m.GetMaterial(), m, shader);
|
SetTextureUniforms(mat, m, shader);
|
||||||
}
|
}
|
||||||
SetBoneUniforms(shader, mdl, m);
|
SetBoneUniforms(shader, mdl, m);
|
||||||
ApplyTransformFix(mdl, m, shader);
|
ApplyTransformFix(mdl, m, shader);
|
||||||
@ -616,7 +618,7 @@ namespace FirstPlugin
|
|||||||
// if (!mdl.Skeleton.bones[m.boneIndx].Visible)
|
// if (!mdl.Skeleton.bones[m.boneIndx].Visible)
|
||||||
// m.Checked = false;
|
// m.Checked = false;
|
||||||
|
|
||||||
if (m.Checked && mdl.Skeleton.bones.Count > 0 && mdl.Skeleton.bones[m.BoneIndex].Visible)
|
if (m.Checked && mdl.Skeleton.bones.Count > 0 && mdl.Skeleton.bones[m.BoneIndex].Visible && mat.Enabled)
|
||||||
{
|
{
|
||||||
shader.SetVector3("materialSelectColor", new Vector3(0));
|
shader.SetVector3("materialSelectColor", new Vector3(0));
|
||||||
if (m.GetMaterial().IsSelected)
|
if (m.GetMaterial().IsSelected)
|
||||||
|
@ -92,7 +92,7 @@
|
|||||||
this.chkboxVisible.TabIndex = 43;
|
this.chkboxVisible.TabIndex = 43;
|
||||||
this.chkboxVisible.Text = "Visible";
|
this.chkboxVisible.Text = "Visible";
|
||||||
this.chkboxVisible.UseVisualStyleBackColor = true;
|
this.chkboxVisible.UseVisualStyleBackColor = true;
|
||||||
this.chkboxVisible.CheckedChanged += new System.EventHandler(this.chkboxVisible_CheckedChanged_1);
|
this.chkboxVisible.CheckedChanged += new System.EventHandler(this.chkboxVisible_CheckedChanged);
|
||||||
//
|
//
|
||||||
// label3
|
// label3
|
||||||
//
|
//
|
||||||
|
@ -64,7 +64,7 @@ namespace FirstPlugin.Forms
|
|||||||
|
|
||||||
SetActiveGameByShader(material.shaderassign.ShaderArchive, material.shaderassign.ShaderModel);
|
SetActiveGameByShader(material.shaderassign.ShaderArchive, material.shaderassign.ShaderModel);
|
||||||
|
|
||||||
chkboxVisible.Checked = mat.Enabled;
|
chkboxVisible.Bind(material, "Enabled");
|
||||||
|
|
||||||
FillForm();
|
FillForm();
|
||||||
|
|
||||||
@ -235,9 +235,8 @@ namespace FirstPlugin.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void chkboxVisible_CheckedChanged(object sender, EventArgs e)
|
private void chkboxVisible_CheckedChanged(object sender, EventArgs e) {
|
||||||
{
|
LibraryGUI.Instance.UpdateViewport();
|
||||||
material.Enabled = chkboxVisible.Checked;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textureRefListView_SelectedIndexChanged(object sender, EventArgs e)
|
private void textureRefListView_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
@ -314,9 +313,5 @@ namespace FirstPlugin.Forms
|
|||||||
private void textBoxShaderModel_TextChanged(object sender, EventArgs e) {
|
private void textBoxShaderModel_TextChanged(object sender, EventArgs e) {
|
||||||
material.shaderassign.ShaderModel = textBoxShaderModel.Text;
|
material.shaderassign.ShaderModel = textBoxShaderModel.Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void chkboxVisible_CheckedChanged_1(object sender, EventArgs e) {
|
|
||||||
material.Enabled = chkboxVisible.Enabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user