def gear_ExportGuide_Execute(): if not xsi.Selection.Count: xsi.LogMessage("Select an object from the guide to export", c.siError) return if xsi.Selection(0).Type == "#model": model = xsi.Selection(0) else: model = xsi.Selection(0).Model options = model.Properties("options") if not options: gear.log("Invalid selection", gear.sev_error) return path = uit.fileBrowser("Export Guide", xsi.ActiveProject2.OriginPath, model.Name, ["xml"], True) if not path: return rg = RigGuide() rg.exportToXml(xsi.Selection(0), path)
def gear_GuideToolsUI_export_OnClicked(): if not xsi.Selection.Count: xsi.LogMessage("Select an object from the guide to export", c.siError) return if xsi.Selection(0).Type == "#model": model = xsi.Selection(0) else: model = xsi.Selection(0).Model options = model.Properties("options") if not options: gear.log("Invalid selection", gear.sev_error) return path = uit.fileBrowser("Export Guide", TEMPLATE_PATH, model.Name, ["xml"], True) if not path: return rg = RigGuide() rg.exportToXml(xsi.Selection(0), path) gear_GuideToolsUI_OnInit()