コード例 #1
0
        def srf1_picker_refresh(self, sender, evtid):
            if check_selection(ix.selection,
                               is_kindof=[
                                   "MaterialPhysicalStandard",
                                   "MaterialPhysicalBlend", "OfContext"
                               ],
                               min_num=1):
                ctxs = []
                for selection in ix.selection:
                    if selection.is_context():
                        ctx = selection
                    else:
                        ctx = selection.get_context()

                    if not get_mtl_from_context(ctx, ix=ix):
                        return None

                    ctxs.append(str(ctx))
                if srf2_txt.get_text():
                    ctx2 = ix.get_item(srf2_txt.get_text())
                    name_txt.set_text(ctx2.get_name() + MIX_SUFFIX)
                srf1_txt.set_text(str(IMPORTER_PATH_DELIMITER.join(ctxs)))
            else:
                ix.log_warning("Please select a valid material.\n")
                srf1_txt.set_text("")
コード例 #2
0
        def srf2_picker_refresh(self, sender, evtid):
            if check_selection(ix.selection,
                               is_kindof=[
                                   "MaterialPhysicalStandard",
                                   "MaterialPhysicalBlend", "OfContext"
                               ],
                               max_num=1):
                if ix.selection[0].is_context():
                    ctx = ix.selection[0]
                else:
                    ctx = ix.selection[0].get_context()

                if not get_mtl_from_context(ctx, ix=ix):
                    return None

                srf2_txt.set_text(str(ctx))

                ctx2_name = ctx.get_name()
                name_txt.set_text(ctx2_name + MIX_SUFFIX)
                ix.selection.deselect_all()
                ix.selection.add(ctx.get_parent())
            else:
                ix.log_warning("Please select a valid cover material.\n")
                srf2_txt.set_text("")