public void EditProperty(string objName, string propName, string value) { try { xpTakeItem takeItem = Item; if (takeItem != null && takeItem.GetPublishedObjectByName(objName, out xpPublishedObject publishedObject)) { int propCount = publishedObject.PropertyCount; // Loop through all properties until we find the one with our selected name for (int propID = 0; propID < propCount; propID++) { publishedObject.GetPropertyInfo(propID, out string tempName, out PropertyType propType); // Check if name is what we are looking for if (tempName.Equals(propName, StringComparison.OrdinalIgnoreCase)) { switch (propType) { case PropertyType.pt_String: publishedObject.SetPropertyString(propID, value.Trim()); break; case PropertyType.pt_Boolean: bool val; if (bool.TryParse(value.Trim(), out val)) { publishedObject.SetPropertyBool(propID, val); } break; case PropertyType.pt_Material: int face = 0; if (!string.IsNullOrEmpty(value)) { if (takeItem.Project.GetMaterialByName(value, out xpMaterial material)) { publishedObject.SetPropertyMaterial(propID, face, material); } } break; } } } takeItem.UpdateThumbnail(); } } catch { }; }
public void SetTakeMode(int id, bool mode) { xpBaseTakeItem takeItem; xpTakeItem item = new xpTakeItem(); if (_engine.Sequencer.GetTakeItemByID(id, out takeItem)) { if (mode) { takeItem.Execute(); } else { takeItem.SetOffline(); } } }
public XPN_TakeItem(string name, int cID, xpTakeItem item) { Name = name; ID = cID; Item = item; }