<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Import FBX/ABC files using PYMXS in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/import-fbx-abc-files-using-pymxs/m-p/9772314#M6288</link>
    <description>&lt;P&gt;I'm fairly new to 3ds MAX and from what I can gather there is a way to import FBX files from the main 3ds MAX program itself. I was just wondering if there was any way to write a script (using pymxs) to do the same thing. Moreover, I was wondering if I could do the same thing with ABC files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TL;DR : Is there a way to import FPX and ABC files using a pymxs script&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:42:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-28T14:42:27Z</dc:date>
    <item>
      <title>Import FBX/ABC files using PYMXS</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/import-fbx-abc-files-using-pymxs/m-p/9772314#M6288</link>
      <description>&lt;P&gt;I'm fairly new to 3ds MAX and from what I can gather there is a way to import FBX files from the main 3ds MAX program itself. I was just wondering if there was any way to write a script (using pymxs) to do the same thing. Moreover, I was wondering if I could do the same thing with ABC files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TL;DR : Is there a way to import FPX and ABC files using a pymxs script&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:42:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/import-fbx-abc-files-using-pymxs/m-p/9772314#M6288</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-28T14:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Import FBX/ABC files using PYMXS</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/import-fbx-abc-files-using-pymxs/m-p/9781151#M6289</link>
      <description>&lt;P&gt;Yes! you can import any type of object with pymxs.&lt;/P&gt;&lt;P&gt;You have to set properties for the importer documented &lt;A href="https://help.autodesk.com/view/MAXDEV/2021/ENU/?guid=GUID-E6BB0B2F-5913-4949-B2FF-9EB7B9811A1E" target="_blank" rel="noopener"&gt;here&lt;/A&gt; (in this script I set two properties of the FBX importer | Skin and Animation) then import it to the scene by &lt;A href="https://help.autodesk.com/view/MAXDEV/2021/ENU/?guid=GUID-624D3D05-B15D-4A97-9F15-DA35CDB0DDD2#importing-files" target="_blank" rel="noopener"&gt;importFile&lt;/A&gt;. Importing ABC files also have the same process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Python.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/826565i82CD9F9D5064983F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Python.jpg" alt="Python.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from PySide2 import QtCore
from PySide2 import QtGui
from PySide2 import QtWidgets
from PySide2.QtWidgets import QCheckBox, QLineEdit, QFileDialog, QSpacerItem 
import qtmax
from pymxs import runtime as mxs


class PyMaxDockWidget(QtWidgets.QDockWidget):
    def __init__(self, parent=None):
        super(PyMaxDockWidget, self).__init__(parent)
        self.setWindowFlags(QtCore.Qt.Tool)
        self.setWindowTitle('Python FBX Importer')
        self.variables()
        self.initUI()
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)

    def initUI(self):
        main_layout = QtWidgets.QVBoxLayout()
        path_layout = QtWidgets.QHBoxLayout()

        self.skin_check = QtWidgets.QCheckBox("Skin", self)
        main_layout.addWidget(self.skin_check)  
        
        self.anim_check = QtWidgets.QCheckBox("Animation", self)
        main_layout.addWidget(self.anim_check)        
        
        self.path_string = QtWidgets.QLineEdit(self)
        self.path_string.setReadOnly(True)
        path_layout.addWidget(self.path_string)
        
        self.path_btn = QtWidgets.QPushButton("...")
        self.path_btn.setMaximumWidth(24)
        path_layout.addWidget(self.path_btn)
        
        v_widget = QtWidgets.QWidget()
        v_widget.setLayout(path_layout)
        
        main_layout.addWidget(v_widget)
        
        self.import_btn = QtWidgets.QPushButton("Import")
        main_layout.addWidget(self.import_btn)
        
        widget = QtWidgets.QWidget()
        widget.setLayout(main_layout)
        self.setWidget(widget)
        
        self.path_btn.clicked.connect(self.set_path)
        self.import_btn.clicked.connect(self.import_FBX)

    def import_FBX(self):
        
        if (self.file_path):
            self.FBX_import(self.file_path, self.skin_check.isChecked(), self.anim_check.isChecked())
        else:
            print("select a file")

    def FBX_import(self, path, skin, animation):
        
        mxs.FBXExporterSetParam("Mode", mxs.readvalue(mxs.StringStream('#create')))
        mxs.FBXExporterSetParam("Skin", skin)
        mxs.FBXExporterSetParam("Animation", animation)

        mxs.importFile(path, mxs.readvalue(mxs.StringStream('#noPrompt')))


    def set_path(self):
        print("pressed")
        fname = list(QFileDialog.getOpenFileName(self, 'Open file', filter="*.fbx"))
        
        if fname:
            print(fname[0])
            self.file_path = fname[0]
            self.path_string.setText(fname[0])
                
    def variables(self):
        self.file_path = None
        
def main():
    main_window = qtmax.GetQMaxMainWindow()
    w = PyMaxDockWidget(parent=main_window)
    w.setFloating(False)
    w.show()

if __name__ == '__main__':
    main()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 15:12:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/import-fbx-abc-files-using-pymxs/m-p/9781151#M6289</guid>
      <dc:creator>xxshirzadxx</dc:creator>
      <dc:date>2020-10-02T15:12:10Z</dc:date>
    </item>
  </channel>
</rss>

