Exemplo n.º 1
0
    def populateAttributeModel(self, model):
        valid = uiutils.isValidQtObject(model)
        if valid is False:
            return
        col = lib_state.get_active_collection()
        attr_list = []
        if col is not None:
            attr_list = lib_attr.get_attributes_from_collection(col)

        def update_func():
            if uiutils.isValidQtObject(self) is False:
                return
            self.updateAttributeModel()
            return

        # Add Callbacks
        #
        # When querying attributes, we must make sure they have a Maya
        # callback attached to the node to update the UI.
        callback_manager = self.getCallbackManager()
        if callback_manager is not None:
            lib_attr.add_callbacks_to_attributes(
                attr_list,
                update_func,
                callback_manager
            )
        root = convert_to_ui.attributesToUINodes(attr_list)
        model.setRootNode(root)
        return
    def populateModel(self, model, col):
        s = time.time()
        valid = uiutils.isValidQtObject(model)
        if valid is False:
            return
        attr_list = []
        show_anm = const.ATTRIBUTE_TOGGLE_ANIMATED_DEFAULT_VALUE
        show_stc = const.ATTRIBUTE_TOGGLE_STATIC_DEFAULT_VALUE
        show_lck = const.ATTRIBUTE_TOGGLE_LOCKED_DEFAULT_VALUE
        if col is not None:
            attr_list = lib_attr.get_attributes_from_collection(col)
            show_anm = lib_col.get_attribute_toggle_animated_from_collection(
                col)
            show_stc = lib_col.get_attribute_toggle_static_from_collection(col)
            show_lck = lib_col.get_attribute_toggle_locked_from_collection(col)

        # Add Callbacks
        #
        # When querying attributes, we must make sure they have a Maya
        # callback attached to the node to update the UI.
        callback_manager = self.callback_manager
        if callback_manager is not None:
            lib_attr.add_callbacks_to_attributes(
                attr_list,
                callback_manager,
            )
        root = convert_to_ui.attributesToUINodes(col, attr_list, show_anm,
                                                 show_stc, show_lck)
        model.setRootNode(root)

        e = time.time()
        LOG.debug('populateModel: %r', e - s)
        return
    def populateModel(self, model):
        valid = uiutils.isValidQtObject(model)
        if valid is False:
            return
        col = lib_state.get_active_collection()
        attr_list = []
        show_anm = const.ATTRIBUTE_TOGGLE_ANIMATED_DEFAULT_VALUE
        show_stc = const.ATTRIBUTE_TOGGLE_STATIC_DEFAULT_VALUE
        show_lck = const.ATTRIBUTE_TOGGLE_LOCKED_DEFAULT_VALUE
        if col is not None:
            attr_list = lib_attr.get_attributes_from_collection(col)
            show_anm = lib_col.get_attribute_toggle_animated_from_collection(
                col)
            show_stc = lib_col.get_attribute_toggle_static_from_collection(col)
            show_lck = lib_col.get_attribute_toggle_locked_from_collection(col)

        def update_func():
            if uiutils.isValidQtObject(self) is False:
                return
            self.dataChanged.emit()
            return

        # Add Callbacks
        #
        # When querying attributes, we must make sure they have a Maya
        # callback attached to the node to update the UI.
        callback_manager = self.callback_manager
        if callback_manager is not None:
            lib_attr.add_callbacks_to_attributes(attr_list, update_func,
                                                 callback_manager)
        root = convert_to_ui.attributesToUINodes(col, attr_list, show_anm,
                                                 show_stc, show_lck)
        model.setRootNode(root)
        return
Exemplo n.º 4
0
    def populateAttributeModel(self, model):
        col = lib_state.get_active_collection()
        if col is None:
            return
        attr_list = lib_attr.get_attributes_from_collection(col)

        # Add Callbacks
        #
        # When querying attributes, we must make sure they have a Maya
        # callback attached to the node to update the UI.
        callback_manager = self.getCallbackManager()
        if callback_manager is not None:
            lib_attr.add_callbacks_to_attributes(
                attr_list,
                self.updateAttributeModel,
                callback_manager
            )
        root = convert_to_ui.attributesToUINodes(attr_list)
        model.setRootNode(root)
        return