Hi Marsel,
Yes, it's works using maxscript. But I'm using c# inside visual Studio.
My code in c# to list all state sets is this:
var StateSetObjs = Autodesk.Max.StateSets.Plugin.Instance;
var masterState = StateSetObjs.EntityManager.RootEntity.MasterStateSet;
lv_StateSets.BeginUpdate();
lv_StateSets.Items.Clear();
for (int i = 1; i <= masterState.Children.Count; i++)
{
if (masterState.Children[(i - 1)].Name != "Objects")
lv_StateSets.Items.Add((masterState.Children[(i-1)].Name).ToString());
}
lv_StateSets.EndUpdate();
lv_StateSets.Refresh();
and my code to activate each state sets is:
var StateSetsObjs = Autodesk.Max.StateSets.Plugin.Instance;
var masterState = StateSetsObjs.EntityManager.RootEntity.MasterStateSet;
StateSetsObjs.ShowMainFrame(); // Show State Sets Window
for (int i = 0; i < lv_StateSets.Items.Count; i++)
{
if (lv_StateSets.Items[i].Checked)
{
MessageBox.Show("Rendering State Set... \n\nID: " + i + "\nName: " + (lv_StateSets.Items[i].Text).ToString(), "Local Render");
}
}
masterState.Refresh(); // Refresh List
StateSetsObjs.HideMainFrame(); // Hide StateSets Window
What I would like is change the "MessageBox.Show" to a line code for activate each state set that is checked on my listview
Thanks