Ejemplo n.º 1
0
def test(fbx_file):
    fbx_scene, fbx_manager = bfIO.load_fbx_file(fbx_file,
                                                fbx_manager=None,
                                                settings=None,
                                                verbose=True,
                                                err=True)

    cache = BFbxSceneCache(fbx_scene, fbx_manager)
    cache.print_debug_info()
def inspect_properties(file_path):

    fbx_scene, fbx_manager = bfIO.load_fbx_file(file_path,
                                                fbx_manager=None,
                                                settings=None,
                                                verbose=True,
                                                err=True)

    src_count = fbx_scene.GetSrcObjectCount()

    object_1 = fbx_scene.FindSrcObject("object1")
    object_2 = fbx_scene.FindSrcObject("object2")

    if False:
        # debug
        print object_1.GetName()

        root_property = object_1.GetClassRootProperty()

        print "root valid", root_property.IsValid()

        child_property = root_property.GetChild()

        print "test", object_1.GetName()
        print "valid", child_property.IsValid()

        return

        # print properties
        for i in range(src_count):
            src = fbx_scene.GetSrcObject(i)
            print_root_properties(src)
    else:

        # print properties for more than one object
        # to show that the new root properties are shared
        for fbx_object in [object_1, object_2]:

            print fbx_object.GetName()

            fbx_property = fbx_object.GetFirstProperty()

            while fbx_property.IsValid():
                print "  ", fbx_property.GetName()
                fbx_property = fbx_object.GetNextProperty(fbx_property)

    # cleanup
    fbx_manager.Destroy()
    del fbx_manager, fbx_scene

    print "done"
Ejemplo n.º 3
0
    def __init__(self, file_path, parent=None):
        super(Test1, self).__init__(parent=parent)

        self._file_path = file_path

        self._scene, self._fbx_manager = bfIO.load_fbx_file(self._file_path,
                                                            fbx_manager=None)

        self._object_1 = self._scene.FindSrcObject("object1")

        self.create_models()
        self.create_widgets()
        self.create_layout()

        self.setGeometry(
            Qt.QtWidgets.QApplication.desktop().screenGeometry().width() * 0.1,
            Qt.QtWidgets.QApplication.desktop().screenGeometry().height() *
            0.1, 800, 800)

        self.show()
Ejemplo n.º 4
0
def inspect_properties(file_path):

    fbx_scene, fbx_manager = bfIO.load_fbx_file(file_path,
                                                fbx_manager=None,
                                                settings=None,
                                                verbose=True,
                                                err=True)

    src_count = fbx_scene.GetSrcObjectCount()

    # print properties
    for i in range(src_count):
        src = fbx_scene.GetSrcObject(i)
        print_object_properties(src)

    # cleanup
    fbx_manager.Destroy()
    del fbx_manager, fbx_scene

    print "done"
    def __init__(self):
        super(Test, self).__init__()

        self._scene, self.fbx_manager = bfIO.load_fbx_file(os.path.join(
            DUMP_DIR, TEST_FILE),
                                                           fbx_manager=None,
                                                           settings=None,
                                                           verbose=True,
                                                           err=True)

        # find constraints and nodes
        constraints = []

        src_count = self._scene.GetSrcObjectCount()

        for i in range(src_count):
            src = self._scene.GetSrcObject(i)
            if isinstance(src, fbx.FbxConstraint):
                constraints.append(src)

        print constraints
def property_test(fbx_file):
    #     fbx_manager = fbx.FbxManager.Create()
    #     fbx_scene = fbx.FbxScene.Create(fbx_manager, "scene")
    #     fbx_object = fbx.FbxObject.Create(fbx_manager, "test")
    #
    #     fbx_scene.ConnectSrcObject(fbx_object)

    fbx_scene, fbx_manager = bfIO.load_fbx_file(
        fbx_file,
        fbx_manager=None,
        settings=None,
        verbose=True,
        err=True
    )

#     fbx_object = fbx_scene.GetRootNode()

    fbx_object = fbx_scene.FindSrcObject("object1")

    cache = BFbxPropertyCache(fbx_object)

    cache.root().debug()
    def __init__(self, file_path, parent=None):
        super(Test2, self).__init__(parent=parent)

        self._file_path = file_path

        self._scene, self._fbx_manager = bfIO.load_fbx_file(
            self._file_path,
            fbx_manager=None
        )

        self.model_manager = bfModelManagers.BfSceneModelManager()
        self.model_manager.set_scene(self._scene, self._fbx_manager)

        self.create_widgets()
        self.create_layout()

        self.setGeometry(
            Qt.QtWidgets.QApplication.desktop().screenGeometry().width() * 0.1,
            Qt.QtWidgets.QApplication.desktop().screenGeometry().height() * 0.1,
            800,
            800
        )

        self.show()