Full Code of cogitas3d/OrtogOnBlender for AI

master 881e93f5beb2 cached
47 files
1.1 MB
286.6k tokens
1369 symbols
1 requests
Download .txt
Showing preview only (1,111K chars total). Download the full file or copy to clipboard to get everything.
Repository: cogitas3d/OrtogOnBlender
Branch: master
Commit: 881e93f5beb2
Files: 47
Total size: 1.1 MB

Directory structure:
gitextract_2f2snxll/

├── AjustaTomo.py
├── AlinhaObjetos.py
├── AlinhaRedimensiona.py
├── AtualizaScript.py
├── BooleanaOsteo.py
├── CalculaPontos.py
├── Cefalometria.py
├── CompareOnBlender.py
├── CompareTools.py
├── ConfOsteotomiaAuto.py
├── CortaOssoFibula.py
├── CriaSplint.py
├── DesenhaGuia.py
├── DesenhaObjetos.py
├── DinamicaMole.py
├── FerrFisica.py
├── FerrImgTomo.py
├── FerrMalhas.py
├── FerrMedidas.py
├── FerrSegmentacao.py
├── ForensicObj.blend
├── ForensicOnBlender.py
├── ForensicTools.py
├── FotogrametriaMeshroom.py
├── FotogrametriaOpenMVG.py
├── FotogrametriaOpenMVGWinWSL.py
├── FotogrametriaSMVS.py
├── GeraModelosTomo.py
├── GeraRelatorio.py
├── ImportaObjMat.py
├── ListaArquivos.txt
├── MicrosGenerate3D.mlx
├── NomePaciente.py
├── OrtogMeshes.py
├── OtherOnBlender.py
├── Poisson.py
├── PontosAnatomicos.py
├── README.md
├── RelatorioAnimacao.py
├── RhinOnBlender.py
├── RhinOpenGL.py
├── RhinTools.py
├── SegmentaImagens.py
├── TomoReconsRapida.py
├── Version.py
├── __init__.py
└── objetos.blend

================================================
FILE CONTENTS
================================================

================================================
FILE: AjustaTomo.py
================================================
import bpy
import os
import os.path
import json
import re
import shutil
# from datetime import datetime
import tempfile
import os
import platform
import subprocess
import pydicom as dicom
import csv
import fnmatch
from os.path import expanduser

from .GeraModelosTomo import *

if platform.system() == "Darwin" or platform.system() == "Linux":
    import pyexifinfo as p

def AjustaTomoDef(self, context):


    scn = context.scene


    #Cria diretorios temporarios e copia o conteudo para um deles
    #os.chdir('DEL')

#    scene = context.scene
#    rd = scene.render

    if scn.my_tool.path == "":
        bpy.ops.object.dialog_operator_informe_dicom('INVOKE_DEFAULT')
        return {'FINISHED'}

    else:

        tmpdirCopy = tempfile.mkdtemp()

        tmpdirTomo = tempfile.mkdtemp()

        shutil.copytree(scn.my_tool.path, tmpdirCopy+'COPY')

        # Lista os arquivos e salva arquivo de texto

        # Testa se existe e remove
        if os.path.exists('ListaArquivos.txt'):
            os.remove('ListaArquivos.txt')


        #for dirname, dirnames, filenames in os.walk('.'):
        for dirname, dirnames, filenames in os.walk(tmpdirCopy+'COPY'):
            # print path to all subdirectories first.
        #    for subdirname in dirnames:
        #        print(os.path.join(dirname, subdirname))

            for filename in filenames:
                #print(os.path.join(dirname, filename))
                ArquivosListados = os.path.join(dirname, filename)+'\n'

                with open("ListaArquivos.txt", "a") as arq:
                    arq.write(ArquivosListados)
                    arq.close()


        # Conta linhas do arquivo

        def obter_n_linhas (nomeDoArquivo):
            arquivo = open(nomeDoArquivo, "r")
            n_linhas = sum(1 for linha in arquivo)
            arquivo.close()
            return n_linhas


        def InstanceNumber(Arquivo):


            try:
                ds = dicom.dcmread(Arquivo, force=True) # Diretório e arquivo concatenados
                #ds = dicom.dcmread(Arquivo, force=True) # Diretório e arquivo concatenados


                instance_number = ds.data_element("InstanceNumber")
                instanceLimpa1 = str(instance_number).split('IS: ')
                instanceLimpa2 = str(instanceLimpa1[1]).strip('"')


            except:
                print("Não rolou leitura do DICOM!")
                instanceLimpa2 = "Error"

            return instanceLimpa2

        NumeroLinhas = obter_n_linhas ('ListaArquivos.txt')

        #-----------------------------------------------------------

        # Le arquivo e cria pastas

        #ContadorLinhas = 0

        with open('ListaArquivos.txt','r') as f:
                ListaArquivos=f.readlines()
                print("Criado Lista Arquivo1")

        DCMNum = 0

        for x in range(NumeroLinhas):
            ArquivoAtual = ListaArquivos[x].strip('\n') # mostra linha 1 sem o caractere de quebra de linha
        #	print(ArquivoAtual)

            DCMInstanceNumber = InstanceNumber(ArquivoAtual)
            os.chdir(tmpdirTomo)

            shutil.copy(ArquivoAtual, "Copy-"+DCMInstanceNumber.zfill(5)+"-"+str(DCMNum))
            print("Copiado de: ", ArquivoAtual, " Para: ", "Copy-"+DCMInstanceNumber+"-"+str(DCMNum))
    #        shutil.copy(ArquivoAtual, str(datetime.now()).replace(":","").replace(".","").replace(" ","").replace("-",""))
    #        print("Copiado de: ", ArquivoAtual, " Para: ", str(datetime.now()).replace(":","").replace(".","").replace(" ","").replace("-",""))
        #	os.chdir('..')
            DCMNum += 1

        # Lista os arquivos e salva arquivo de texto

        # Testa se existe e remove
        if os.path.exists('ListaArquivos.txt'):
            os.remove('ListaArquivos.txt')
            print("Apagado ListaArquivo")



        #for dirname, dirnames, filenames in os.walk('.'):
        for dirname, dirnames, filenames in os.walk(tmpdirTomo):
            # print path to all subdirectories first.
        #    for subdirname in dirnames:
        #        print(os.path.join(dirname, subdirname))

            for filename in filenames:
                #print(os.path.join(dirname, filename))
                ArquivosListados = os.path.join(dirname, filename)+'\n'

                with open('ListaArquivos.txt', "a") as arq:
                    print("Criado ListaArquivo 2")
                    arq.write(ArquivosListados)
                    arq.close()


        # Conta linhas do arquivo

        def obter_n_linhas (nomeDoArquivo):
            arquivo = open(nomeDoArquivo, "r")
            n_linhas = sum(1 for linha in arquivo)
            arquivo.close()
            return n_linhas


        NumeroLinhas = obter_n_linhas ('ListaArquivos.txt')


        # Le arquivo e cria pastas

        #ContadorLinhas = 0

        with open('ListaArquivos.txt','r') as f:
                ListaArquivos=f.readlines()

    # PYEXIFINFO

        if platform.system() == "Darwin" or platform.system() == "Linux":
            print("EH MAC E LIN")
            for x in range(NumeroLinhas):
                ArquivoAtual = ListaArquivos[x].strip('\n') # mostra linha 1 sem o caractere de quebra de linha
        #	print(ArquivoAtual)

                data = p.get_json(ArquivoAtual)

                data2 = json.dumps(data, sort_keys=True, indent=4, separators=(',', ': '))

                with open("deletar.txt", "a") as arq:
                    arq.write(data2)
                    arq.close()

                    palavra = "SeriesNumber"

                    for line in open("deletar.txt"):
                        if palavra in line:
                            SeriesRaw = line
                            SeriesLimpa1 = SeriesRaw.strip('"DICOM:SeriesNumber": "')
                            SeriesLimpa2 = SeriesLimpa1.strip('",'+'\n')
                            SeriesLimpo = SeriesLimpa2.strip(" ")
                            print("SERIES", SeriesLimpo)

                            if SeriesLimpo != '':
                                if not os.path.exists(SeriesLimpo):
                                    os.mkdir(SeriesLimpo)

                            if SeriesLimpo != '':
                                shutil.copy(ArquivoAtual, SeriesLimpo)
                                print("Copiado de: ", ArquivoAtual, " Para: ", SeriesLimpo)
                                os.remove(ArquivoAtual)


                    os.remove('deletar.txt')

    # PYTHON DICOM

        if platform.system() == "Windows":
            print("EH WIN")
            for x in range(NumeroLinhas):
                ArquivoAtual = ListaArquivos[x].strip('\n') # mostra linha 1 sem o caractere de quebra de linha
                print("AQUIVO ATUAL: "+ArquivoAtual)

                try:
                    ds = dicom.dcmread(ArquivoAtual)

                    series_number = ds.data_element("SeriesNumber")

                    SeriesLimpa1 = str(series_number).strip('(0020, 0011) Series Number IS:')
                    SeriesLimpo2 = SeriesLimpa1.strip('"')
                    SeriesLimpo = SeriesLimpo2.strip(" ")

                except:
                    print("Não rolou leitura do DICOM!")
                    SeriesLimpo = "Error"


                if not os.path.exists(SeriesLimpo):
                    os.mkdir(SeriesLimpo)
                    print("Diretorio "+SeriesLimpo+" criado")

                #os.chdir(tmpdirTomo)
                shutil.copy(ArquivoAtual, SeriesLimpo)
                print("Copiado de: ", ArquivoAtual, " Para: ", SeriesLimpo)
                os.remove(ArquivoAtual)



            #os.remove('deletar.txt')
    #        os.remove('deletar.txt')
        try:
            shutil.rmtree(tmpdirCopy+'COPY')
            shutil.rmtree(tmpdirCopy)
        except:
            print("Erro de permissão ao apagar os diretório do TMP!")

        print("CT-SCAN ready!")

# Lista diretórios e arquivos
        try:
            tmpdirCSV = tempfile.mkdtemp()

            diretorio = tmpdirTomo+"/"

            lista_compara = []

            lista = [ name for name in os.listdir(diretorio) if os.path.isdir(os.path.join(diretorio, name)) ]

            #print(lista)
            try:
                for i in lista:
                #    print("\n")
                #    print("Directory:", i)
                #    print(os.listdir(diretorio+i)[0])
                #    print("Number of files:", len(os.listdir(diretorio+i)))
                    ArquivoAtual = os.listdir(diretorio+i)[0]
                #    print(diretorio+i+"/"+ArquivoAtual)
                    ds = dicom.dcmread(diretorio+i+"/"+ArquivoAtual, force=True)

                    if ds.data_element("SeriesDescription"):
                        SeriesDescription = ds.data_element("SeriesDescription")
                        SeriesDescriptionLimpa1 = str(SeriesDescription).split('LO: ')
                        SeriesDescriptionLimpa2 = str(SeriesDescriptionLimpa1[1]).strip('"')
                    #    print(SeriesDescriptionLimpa2)
                    #    print("Directory:", i, "|| Number of files:", len(os.listdir(diretorio+i)), "||", SeriesDescriptionLimpa2, "\n")
                        lista_compara.append([len(os.listdir(diretorio+i)), i, SeriesDescriptionLimpa2])
                        lista_compara.sort(reverse = True)
                        #print("LISTA COMPARA!!!")
                        #print(lista_compara)
                    if not ds.data_element("SeriesDescription"):
                        SeriesDescriptionLimpa2 = ("Erro O!")
                    #    print(SeriesDescriptionLimpa2)
                    #    print("Directory:", i, "|| Number of files:", len(os.listdir(diretorio+i)), "||", SeriesDescriptionLimpa2, "\n")
                        lista_compara.append([len(os.listdir(diretorio+i)), i, SeriesDescriptionLimpa2])
                        lista_compara.sort(reverse = True)
            except:
                print("Erro no SeriesDescription")
                try:
                    SeriesDescriptionLimpa2 = ("Erro 1!")
                #    print(SeriesDescriptionLimpa2)
                #    print("Directory:", i, "|| Number of files:", len(os.listdir(diretorio+i)), "||", SeriesDescriptionLimpa2, "\n")
                    lista_compara.append([len(os.listdir(diretorio+i)), i, SeriesDescriptionLimpa2])
                    lista_compara.sort(reverse = True)
                except:
                    print("Problema ao inserir o SeriesDescription!")


            lista_diretorios_mole = []
            print("LISTA COMPARA MOLE", lista_compara)

            try:

                print("lista compara:",lista_compara)
                for i in lista_compara:
                    print("Comecou a comparar!")
                    print("i Atual:", i)
                    if fnmatch.fnmatchcase(str(i[2]), "*PM*") or fnmatch.fnmatchcase(str(i[2]), "*P/M*") or fnmatch.fnmatchcase(str(i[2]), "*Soft*") or fnmatch.fnmatchcase(str(i[2]), "*Sft Tissue*") or fnmatch.fnmatchcase(str(i[2]), "*STD*") or fnmatch.fnmatchcase(str(i[2]), "*PARTES MOLES*") or fnmatch.fnmatchcase(str(i[2]), "*Head*") or fnmatch.fnmatchcase(str(i[2]), "*SEM CONTRASTE*") or fnmatch.fnmatchcase(str(i[2]), "*FACE*") or fnmatch.fnmatchcase(str(i[2]), "*Recon 3*") or fnmatch.fnmatchcase(str(i[2]), "*ARQUIVO*") or fnmatch.fnmatchcase(str(i[2]), "*RECON*") or fnmatch.fnmatchcase(str(i[2]), "*Cranio*") or fnmatch.fnmatchcase(str(i[2]), "*VOLUME STD*")  or fnmatch.fnmatchcase(str(i[2]), "*VOL*") or fnmatch.fnmatchcase(str(i[2]), "*Imagens Processadas*"):
                            print("Encontrou!")
                            lista_diretorios_mole.append(i[1])
                    else:
                        print("Não encontrou!")

                    global diretorio_final_reconstruir_mole

                    try:
                        print("Diretorio final:", lista_diretorios_mole[0] )
                        print("Comparou!")

                        diretorio_final_reconstruir_mole = lista_diretorios_mole[0]

                    except:
                        print("Diretorio final:", lista_diretorios_mole ) # Não sei pq!!! Se coloco index dá erro!
                        print("Comparou!")

                        diretorio_final_reconstruir_mole = lista_diretorios_mole

            except:
                print("Problema para encontrar diretório com tecido mole na tomo!")



            with open(tmpdirCSV+'/C-Scan_DATA.csv', mode='w') as centroid_file:
                report_writer = csv.writer(centroid_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
                report_writer.writerow(['DIRECTORY', 'NUMBER OF FILES', 'DESCRIPTION'])


                if lista_compara == []:
                    report_writer.writerow(["No data", "No data", "No data"])

                if lista_compara != []:
                    for linha in lista_compara:
                        report_writer.writerow([linha[1],linha[0],linha[2]])
                        print("Directory:", linha[1], "|| Number of files", linha[0], "|| Description:", linha[2])


            try:
                if platform.system() == "Linux":
                #    abrir_diretorio(tmpdir)
                    subprocess.Popen("libreoffice "+tmpdirCSV+"/C-Scan_DATA.csv", shell=True)

                if platform.system() == "Windows":
                #    abrir_diretorio(tmpdir)
                    subprocess.Popen('cd "C:/Program Files/LibreOffice/program/" & dir & soffice.bin '+tmpdirCSV+"/C-Scan_DATA.csv", shell=True)

                if platform.system() == "Darwin":
                #    abrir_diretorio(tmpdir)
                    subprocess.Popen('/Applications/LibreOffice.app/Contents/MacOS/soffice '+tmpdirCSV+"/C-Scan_DATA.csv", shell=True)
            except:
                print("Não há programa atribuído ao CSV!")
        except:
            print("Algum problema aconteceu com a leitura dos dados do tomógrafo.")


            try:

                with open(tmpdirCSV+'/C-Scan_DATA.csv', mode='w') as centroid_file:
                    report_writer = csv.writer(centroid_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
                    report_writer.writerow(['DIRECTORY', 'NUMBER OF FILES', 'DESCRIPTION'])

                    if lista_compara == []:
                        report_writer.writerow(["No data", "No data", "No data"])

                    if lista_compara != []:
                        for linha in lista_compara:
                            report_writer.writerow([linha[1],linha[0],linha[2]])
                            print("Directory:", linha[1], "|| Number of files", linha[0], "|| Description:", linha[2])

                try:
                    if platform.system() == "Linux":
                    #    abrir_diretorio(tmpdir)
                        subprocess.Popen("libreoffice "+tmpdirCSV+"/C-Scan_DATA.csv", shell=True)

                    if platform.system() == "Windows":
                    #    abrir_diretorio(tmpdir)
                        subprocess.Popen('cd "C:/Program Files/LibreOffice/program/" & dir & soffice.bin '+tmpdirCSV+"/C-Scan_DATA.csv", shell=True)

                    if platform.system() == "Darwin":
                    #    abrir_diretorio(tmpdir)
                        subprocess.Popen('/Applications/LibreOffice.app/Contents/MacOS/soffice '+tmpdirCSV+"/C-Scan_DATA.csv", shell=True)
                except:
                    print("Não há programa atribuído ao CSV!")
            except:
                print("Problemas com o CSV!")

# Atualiza path

#        abrir_diretorio(tmpdirTomo)

        scn.my_tool.path = tmpdirTomo+"/"


        try:
            with open(tmpdirTomo+'/AUTOEXPDIR.txt', "a") as arq:
                if diretorio_final_reconstruir_mole:
                    arq.write(tmpdirTomo+"/"+diretorio_final_reconstruir_mole)
                if not diretorio_final_reconstruir_mole:
                    arq.write(tmpdirTomo+"/")
                arq.close()

        except:
            print("Algum problema com a variável global do tecido mole!")


class AjustaTomo(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.ajusta_tomo"
    bl_label = "Ajusta Tomo"


    def execute(self, context):
        AjustaTomoDef(self, context)
        return {'FINISHED'}

# ---------------------------------------

def abrir_diretorio(path):
    if platform.system() == "Windows":
        os.startfile(path)
    elif platform.system() == "Darwin":
        subprocess.Popen(["open", path])
    else:
        subprocess.Popen(["xdg-open", path])

def AbreTMPDef(self, context):

    scn = context.scene

    tmpdir = tempfile.gettempdir()
    abrir_diretorio(tmpdir)

def CorrigeDicomDef(self, context):

    scn = context.scene

    homeall = expanduser("~")

    if scn.my_tool.path == "":
        bpy.ops.object.dialog_operator_informe_dicom('INVOKE_DEFAULT')
        return {'FINISHED'}

    else:

    #    scene = context.scene
    #    rd = scene.render

        tmpdirFIXED = tempfile.mkdtemp()

        # Cria arquivo com o nome do diretorio FIXED para ser acessado

        DirTemporario = tempfile.gettempdir()

        if os.path.isfile(DirTemporario+"/tmpdirFIXED.txt"):
            print("Apagando tmpdirFIXED.txt!")
            os.remove(DirTemporario+"/tmpdirFIXED.txt")

        if not os.path.isfile(DirTemporario+"/tmpdirFIXED.txt"):
            with open(DirTemporario+"/tmpdirFIXED.txt", 'w') as arquivo:
                arquivo.write(str(tmpdirFIXED))


        print("DIRETÓRIO CORREÇÂO:", tmpdirFIXED)

        os.chdir(scn.my_tool.path)
        dirDICOM = scn.my_tool.path
        #os.makedirs("FIXED")
        if platform.system() == "Linux":
            os.system("dicomtodicom -o "+tmpdirFIXED+" *")
    #        os.system("for i in *; do gdcmconv -X $i FIXED/$i; done")
    #        print("TOMO AJUSTADA PELO GDCM")

        if platform.system() == "Darwin":
            os.system(homeall+"/Programs/OrtogOnBlender/vtk-dicom/./dicomtodicom --verbose -o "+tmpdirFIXED+" *")
        print("DICOM FIXED")


        if platform.system() == "Windows":


            os.chdir(scn.my_tool.path)
            os.system("C:\\OrtogOnBlender\\dicomtools\\dicomtodicom --verbose -o "+tmpdirFIXED+" *")

            print("C:\\OrtogOnBlender\\dicomtools\\dicomtodicom --verbose -o "+tmpdirFIXED+" *")

            a = os.path.isfile(tmpdirFIXED+"\\"+"IM-0001-0001.dcm")
            print("teste", a)
            print("Diretorio FIXED: ", tmpdirFIXED+"\\"+"IM-0001-0001.dcm")

            #print("DICOM FIXED")
            if os.path.isfile(tmpdirFIXED+"\\"+"IM-0001-0001.dcm"):
                print("EXISTE O ARQUIVO EM FIXED!")
                scn.my_tool.path = tmpdirFIXED

                return tmpdirFIXED

            if not os.path.isfile(tmpdirFIXED+"\\"+"IM-0001-0001.dcm"):
                tmpdirFIXED2 = tempfile.mkdtemp()
                print("TENTA WSL FIXED!!!")
                tmpdirFIXEDAtual = str(tmpdirFIXED2).replace("\\", "/").replace('\\', "/").replace("C:", "/mnt/c")
                #dirDICOMAtual = str(dirDICOM).replace("\\", "/").replace('\\', "/").replace("C:", "/mnt/c")

                os.chdir(dirDICOM)
                #print("wsl \"dicomtodicom\" -o \""+tmpdirFIXEDAtual+"\" \""+dirDICOMAtual+"\"")
                #print("wsl \"dicomtodicom\" -o \""+tmpdirFIXEDAtual+"\" *")

                #subprocess.call("wsl \"dicomtodicom\" -o \""+tmpdirFIXEDAtual+"\" \""+dirDICOMAtual+"\"", shell=True)
                subprocess.call("wsl \"dicomtodicom\" -o \""+tmpdirFIXEDAtual+"\" *", shell=True)

                scn.my_tool.path = tmpdirFIXED2


class CorrigeDicom(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.corrige_dicom"
    bl_label = "Corrige DICOM"

    def execute(self, context):
        CorrigeDicomDef(self, context)
        return {'FINISHED'}


================================================
FILE: AlinhaObjetos.py
================================================
import bpy
import math

from .FerrMalhas import *

# MENSAGENS

class MessageSelecioneObjAlinhar(bpy.types.Operator):
    bl_idname = "object.dialog_operator_selecione_alinhar"
    bl_label = "Please, select the object to be aligned!"

    def execute(self, context):
        message = ("Please, select an object before!")
        self.report({'INFO'}, message)
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self)

bpy.utils.register_class(MessageSelecioneObjAlinhar)


class MessageFaltaPontoObj(bpy.types.Operator):
    bl_idname = "object.dialog_operator_falta_ponto_obj"
    bl_label = "Doesn't have one or more points or object!"

    def execute(self, context):
        message = ("Doesn't have one or more points or object!")
        self.report({'INFO'}, message)
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self)

bpy.utils.register_class(MessageFaltaPontoObj)


class MessageFaltaPonto(bpy.types.Operator):
    bl_idname = "object.dialog_operator_falta_ponto"
    bl_label = "Doesn't have one or more point!"

    def execute(self, context):
        message = ("Doesn't have one or more points!")
        self.report({'INFO'}, message)
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self)

bpy.utils.register_class(MessageFaltaPonto)

# Origin

def EMP1aDef(self, context):

    context = bpy.context
    obj = context.active_object
    scn = context.scene

    bpy.ops.object.empty_add(type='PLAIN_AXES')
    bpy.context.object.name = "EMP1a"
    #bpy.context.object.empty_draw_size = 3
    bpy.context.object.empty_display_size = 3


class EMP1a(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.emp1a"
    bl_label = "EMP1a"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'EMP1a' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False


    def execute(self, context):
        context = bpy.context
        obj = context.object

        if bpy.context.selected_objects == []:
            bpy.ops.object.dialog_operator_selecione_alinhar('INVOKE_DEFAULT')
            return {'FINISHED'}
        else:
            EMP1aDef(self, context)
            bpy.ops.object.select_all(action='DESELECT')
            obj.select_set(True)
            context.view_layer.objects.active = obj
        return {'FINISHED'}

def EMP2aDef(self, context):

    context = bpy.context
    obj = context.active_object
    scn = context.scene

    bpy.ops.object.empty_add(type='PLAIN_AXES')
    bpy.context.object.name = "EMP2a"
    #bpy.context.object.empty_draw_size = 3
    bpy.context.object.empty_display_size = 3


class EMP2a(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.emp2a"
    bl_label = "EMP2a"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'EMP2a' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False


    def execute(self, context):
        context = bpy.context
        obj = context.object

        if bpy.context.selected_objects == []:
            bpy.ops.object.dialog_operator_selecione_alinhar('INVOKE_DEFAULT')
            return {'FINISHED'}
        else:
            EMP2aDef(self, context)
            bpy.ops.object.select_all(action='DESELECT')
            obj.select_set(True)
            context.view_layer.objects.active = obj
        return {'FINISHED'}

def EMP3aDef(self, context):

    context = bpy.context
    obj = context.active_object
    scn = context.scene

    bpy.ops.object.empty_add(type='PLAIN_AXES')
    bpy.context.object.name = "EMP3a"
    #bpy.context.object.empty_draw_size = 3
    bpy.context.object.empty_display_size = 3


class EMP3a(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.emp3a"
    bl_label = "EMP3a"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'EMP3a' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False


    def execute(self, context):
        context = bpy.context
        obj = context.object

        if bpy.context.selected_objects == []:
            bpy.ops.object.dialog_operator_selecione_alinhar('INVOKE_DEFAULT')
            return {'FINISHED'}
        else:
            EMP3aDef(self, context)
            bpy.ops.object.select_all(action='DESELECT')
            obj.select_set(True)
            context.view_layer.objects.active = obj
        return {'FINISHED'}

 # Align

def EMP1bDef(self, context):

    context = bpy.context
    obj = context.active_object
    scn = context.scene

    bpy.ops.object.empty_add(type='PLAIN_AXES')
    bpy.context.object.name = "EMP1b"
    #bpy.context.object.empty_draw_size = 3
    bpy.context.object.empty_display_size = 3


class EMP1b(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.emp1b"
    bl_label = "EMP1b"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'EMP1b' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False


    def execute(self, context):
        context = bpy.context
        obj = context.object

        if bpy.context.selected_objects == []:
            bpy.ops.object.dialog_operator_selecione_alinhar('INVOKE_DEFAULT')
            return {'FINISHED'}
        else:
            EMP1bDef(self, context)
            bpy.ops.object.select_all(action='DESELECT')
            obj.select_set(True)
            context.view_layer.objects.active = obj
        return {'FINISHED'}

def EMP2bDef(self, context):

    context = bpy.context
    obj = context.active_object
    scn = context.scene

    bpy.ops.object.empty_add(type='PLAIN_AXES')
    bpy.context.object.name = "EMP2b"
    #bpy.context.object.empty_draw_size = 3
    bpy.context.object.empty_display_size = 3


class EMP2b(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.emp2b"
    bl_label = "EMP2b"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'EMP2b' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False


    def execute(self, context):
        context = bpy.context
        obj = context.object

        if bpy.context.selected_objects == []:
            bpy.ops.object.dialog_operator_selecione_alinhar('INVOKE_DEFAULT')
            return {'FINISHED'}
        else:
            EMP2bDef(self, context)
            bpy.ops.object.select_all(action='DESELECT')
            obj.select_set(True)
            context.view_layer.objects.active = obj
        return {'FINISHED'}


def EMP3bDef(self, context):

    context = bpy.context
    obj = context.active_object
    scn = context.scene

    bpy.ops.object.empty_add(type='PLAIN_AXES')
    bpy.context.object.name = "EMP3b"
    #bpy.context.object.empty_draw_size = 3
    bpy.context.object.empty_display_size = 3


class EMP3b(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.emp3b"
    bl_label = "EMP3b"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'EMP3b' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False


    def execute(self, context):
        context = bpy.context
        obj = context.object

        if bpy.context.selected_objects == []:
            bpy.ops.object.dialog_operator_selecione_alinhar('INVOKE_DEFAULT')
            return {'FINISHED'}
        else:
            EMP3bDef(self, context)
            bpy.ops.object.select_all(action='DESELECT')
            obj.select_set(True)
            context.view_layer.objects.active = obj
        return {'FINISHED'}

def AlinhaTresPontosDef(self, context):

    context = bpy.context
    objAlinhar = context.active_object

#    if bpy.context.selected_objects == []:
#        bpy.ops.object.dialog_operator_selecione_alinhar('INVOKE_DEFAULT')
#        return {'FINISHED'}

    if bpy.data.objects.get('EMP1a') and bpy.data.objects.get('EMP2a') and bpy.data.objects.get('EMP3a') and bpy.data.objects.get('EMP1b') and bpy.data.objects.get('EMP2b') and bpy.data.objects.get('EMP3b'):

        # Adiciona plano Origem
        bpy.ops.mesh.add_mesh_alinha_origi()
        bpy.context.object.name = "MeshAlignOrigi" # Força nome para não dar erro

        # Seleciona pontos
        bpy.ops.object.mode_set(mode = 'OBJECT')
        obj = bpy.context.active_object
        bpy.ops.object.mode_set(mode = 'EDIT')
        bpy.ops.mesh.select_mode(type="VERT")
        bpy.ops.mesh.select_all(action = 'DESELECT')
        bpy.ops.object.mode_set(mode = 'OBJECT')
        obj.data.vertices[0].select = True
        obj.data.vertices[1].select = True
        obj.data.vertices[2].select = True
        bpy.ops.object.mode_set(mode = 'EDIT')

        # Seleciona os pontos de rotação
        bpy.ops.maplus.quickalignplanesgrabdest()

        # Sai do modo de edição
        bpy.ops.object.mode_set(mode='OBJECT')

        # Adiciona plano a Alinhar
        bpy.ops.mesh.add_mesh_alinha_alinha()
        bpy.context.object.name = "MeshAlignAlign" # Força nome para não dar erro

        objMalhaAlinha = context.active_object

        # Seleciona os pontos
        bpy.ops.object.mode_set(mode = 'OBJECT')
        obj = bpy.context.active_object
        bpy.ops.object.mode_set(mode = 'EDIT')
        bpy.ops.mesh.select_mode(type="VERT")
        bpy.ops.mesh.select_all(action = 'DESELECT')
        bpy.ops.object.mode_set(mode = 'OBJECT')
        obj.data.vertices[0].select = True
        obj.data.vertices[1].select = True
        obj.data.vertices[2].select = True
        bpy.ops.object.mode_set(mode = 'EDIT')

        bpy.ops.object.mode_set(mode='OBJECT')

        # Sai do modo de edição
        bpy.ops.object.select_all(action='DESELECT')
        objAlinhar.select_set(True)
        objMalhaAlinha.select_set(True)
        bpy.context.view_layer.objects.active = objMalhaAlinha

        # Agrupa malha e objeto

        bpy.ops.object.parent_set()

        bpy.ops.object.select_all(action='DESELECT')
        objMalhaAlinha.select_set(True)
        bpy.context.view_layer.objects.active = objMalhaAlinha

        # Alinha planos
        bpy.ops.maplus.quickalignplanesobject()

        # Desparenteia rotacionado
        bpy.ops.object.select_all(action='DESELECT')
        objAlinhar.select_set(True)
        bpy.context.view_layer.objects.active = objAlinhar

        bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')


        # Apaga objetos
        bpy.ops.object.select_all(action='DESELECT')
        bpy.data.objects['EMP1a'].select_set(True)
        bpy.data.objects['EMP2a'].select_set(True)
        bpy.data.objects['EMP3a'].select_set(True)
        bpy.data.objects['EMP1b'].select_set(True)
        bpy.data.objects['EMP2b'].select_set(True)
        bpy.data.objects['EMP3b'].select_set(True)
        bpy.data.objects['MeshAlignOrigi'].select_set(True)
        bpy.data.objects['MeshAlignAlign'].select_set(True)
        bpy.context.view_layer.objects.active = objMalhaAlinha

        bpy.ops.object.delete(use_global=False)

        # Seleciona objeto alinhado
        bpy.ops.object.select_all(action='DESELECT')
        objAlinhar.select_set(True)
        bpy.context.view_layer.objects.active = objAlinhar
    else:
        bpy.ops.object.dialog_operator_falta_ponto('INVOKE_DEFAULT')

    '''
	context = bpy.context
	ObjAlinha = context.object

	EMP1a = bpy.data.objects['EMP1a']
	EMP2a = bpy.data.objects['EMP2a']
	EMP3a = bpy.data.objects['EMP3a']

	# EMP4a
	bpy.ops.object.empty_add(type='SPHERE', location=((EMP2a.location[0]+EMP3a.location[0])/2, (EMP2a.location[1]+EMP3a.location[1])/2, (EMP2a.location[2]+EMP3a.location[2])/2))

	bpy.context.object.name = "EMP4a"
	EMP4a = bpy.data.objects['EMP4a']

	EMP1b = bpy.data.objects['EMP1b']
	EMP2b = bpy.data.objects['EMP2b']
	EMP3b = bpy.data.objects['EMP3b']

	bpy.ops.object.empty_add(type='SPHERE', location=((EMP2b.location[0]+EMP3b.location[0])/2, (EMP2b.location[1]+EMP3b.location[1])/2, (EMP2b.location[2]+EMP3b.location[2])/2))

	bpy.context.object.name = "EMP4b"
	EMP4b = bpy.data.objects['EMP4b']

	# Alinha no molde

	EMP1b.select_set(True)
	EMP2b.select_set(True)
	EMP3b.select_set(True)
	ObjAlinha.select_set(True)

	bpy.ops.object.parent_set()

	# Alinha com o EMP4b ao EMP4a

	bpy.ops.object.select_all(action='DESELECT')

	EMP4b.select_set(True)
	context.view_layer.objects.active = EMP4b

	bpy.context.object.location = EMP4a.location

	bpy.ops.object.select_all(action='DESELECT')
	EMP1b.select_set(True)
	EMP2b.select_set(True)
	EMP3b.select_set(True)
	ObjAlinha.select_set(True)
	bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')

	# Calcula grau

	A = math.sqrt((EMP2b.location[0] - EMP4a.location[0])**2 + (EMP2b.location[2] - EMP4a.location[2])**2)

	B = math.sqrt((EMP2b.location[0] - EMP2a.location[0])**2 + (EMP2b.location[2] - EMP2a.location[2])**2)

	C = math.sqrt((EMP2a.location[0] - EMP4a.location[0])**2 + (EMP2a.location[2] - EMP4a.location[2])**2)

	AngEMP4ab = (C**2 + A**2 - B**2) / (2 * C * A) # Parênteses importantes!!!

	# Radianos
	RotacaoY = math.acos(AngEMP4ab)

	# Ângulo
	math.acos(AngEMP4ab)* 180/math.pi

	bpy.ops.object.select_all(action='DESELECT')
	EMP1b.select_set(True)
	EMP2b.select_set(True)
	EMP3b.select_set(True)
	ObjAlinha.select_set(True)
	EMP4b.select_set(True)
	context.view_layer.objects.active = EMP4b
	bpy.ops.object.parent_set()

	bpy.ops.object.select_all(action='DESELECT')
	EMP4b.select_set(True)
	context.view_layer.objects.active = EMP4b

	# Rotação Y

	if EMP2a.location[2] < EMP2b.location[2]:
	    bpy.ops.transform.rotate(value=RotacaoY, orient_axis='Y', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(False, True, False), mirror=True, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

	if EMP2a.location[2] > EMP2b.location[2]:
	    bpy.ops.transform.rotate(value=-abs(RotacaoY), orient_axis='Y', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(False, True, False), mirror=True, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

	# Desagrupa para cálculo

	bpy.ops.object.select_all(action='DESELECT')
	EMP1b.select_set(True)
	EMP2b.select_set(True)
	EMP3b.select_set(True)
	ObjAlinha.select_set(True)
	bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')

	A = math.sqrt((EMP1b.location[1] - EMP4a.location[1])**2 + (EMP1b.location[2] - EMP4a.location[2])**2)

	B = math.sqrt((EMP1b.location[1] - EMP1a.location[1])**2 + (EMP1b.location[2] - EMP1a.location[2])**2)

	C = math.sqrt((EMP1a.location[1] - EMP4a.location[1])**2 + (EMP1a.location[2] - EMP4a.location[2])**2)

	AngEMP4ab = (C**2 + A**2 - B**2) / (2 * C * A)

	# Radianos
	RotacaoX = math.acos(AngEMP4ab)

	# Ângulo
	math.acos(AngEMP4ab)* 180/math.pi

	bpy.ops.object.select_all(action='DESELECT')
	EMP1b.select_set(True)
	EMP2b.select_set(True)
	EMP3b.select_set(True)
	ObjAlinha.select_set(True)
	EMP4b.select_set(True)
	context.view_layer.objects.active = EMP4b
	bpy.ops.object.parent_set()

	bpy.ops.object.select_all(action='DESELECT')
	EMP4b.select_set(True)
	context.view_layer.objects.active = EMP4b

	if EMP1a.location[2] < EMP1b.location[2]:
	    bpy.ops.transform.rotate(value=RotacaoX, orient_axis='X', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(True, False, False), mirror=True, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
	if EMP1a.location[2] > EMP1b.location[2]:
	    bpy.ops.transform.rotate(value=-abs(RotacaoX), orient_axis='X', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(True, False, False), mirror=True, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

	# Desagrupa para cálculo

	bpy.ops.object.select_all(action='DESELECT')
	EMP1b.select_set(True)
	EMP2b.select_set(True)
	EMP3b.select_set(True)
	ObjAlinha.select_set(True)
	bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')

	A = math.sqrt((EMP1b.location[0] - EMP4a.location[0])**2 + (EMP1b.location[1] - EMP4a.location[1])**2)

	B = math.sqrt((EMP1b.location[0] - EMP1a.location[0])**2 + (EMP1b.location[1] - EMP1a.location[1])**2)

	C = math.sqrt((EMP1a.location[0] - EMP4a.location[0])**2 + (EMP1a.location[1] - EMP4a.location[1])**2)

	AngEMP4ab = (C**2 + A**2 - B**2) / (2 * C * A)
	print("Angulo grosso", AngEMP4ab)

	# Radianos
	RotacaoZ = math.acos(AngEMP4ab)

	# Ângulo
	AnguloZ = math.acos(AngEMP4ab)* 180/math.pi

	bpy.ops.object.select_all(action='DESELECT')
	EMP1b.select_set(True)
	EMP2b.select_set(True)
	EMP3b.select_set(True)
	ObjAlinha.select_set(True)
	EMP4b.select_set(True)
	context.view_layer.objects.active = EMP4b
	bpy.ops.object.parent_set()

	bpy.ops.object.select_all(action='DESELECT')
	EMP4b.select_set(True)
	context.view_layer.objects.active = EMP4b

	if EMP1a.location[0] > EMP1b.location[0]:
	    bpy.ops.transform.rotate(value=RotacaoZ, orient_axis='Z', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(False, False, True), mirror=True, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
	if EMP1a.location[0] < EMP1b.location[0]:
	    bpy.ops.transform.rotate(value=-abs(RotacaoZ), orient_axis='Z', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(False, False, True), mirror=True, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

	# Apaga referências
	bpy.ops.object.select_all(action='DESELECT')
	EMP1a.select_set(True)
	EMP2a.select_set(True)
	EMP3a.select_set(True)
	EMP4a.select_set(True)
	EMP1b.select_set(True)
	EMP2b.select_set(True)
	EMP3b.select_set(True)
	EMP4b.select_set(True)
	bpy.ops.object.delete()
    '''

class AlinhaTresPontos(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.alinha_tres_pontos"
    bl_label = "Align 3 Points"

    @classmethod
    def poll(cls, context):

        if len(bpy.context.selected_objects) == 1:
            return True
        else:
            if len(bpy.context.selected_objects) != 1:
                return False

    def execute(self, context):
        AlinhaTresPontosDef(self, context)
        return {'FINISHED'}


def AlinhaCranioFrankfurtDef():

    context = bpy.context

    if bpy.data.objects.get('Bones') and bpy.data.objects.get('Orbital right') and bpy.data.objects.get('Orbital left') and bpy.data.objects.get('Po left') and bpy.data.objects.get('N point'):

        def CriaLinhaALinha(Obj1, Obj2, Nome):
            Ponto1 = bpy.data.objects[Obj1].location

            Ponto2 = bpy.data.objects[Obj2].location

            verts = [Ponto1,
                     Ponto2,
                    ]

            edges = [[0,1]]

            faces = []

            mesh_data = bpy.data.meshes.new("Apaga")
            mesh_data.from_pydata(verts, edges, faces)
            mesh_data.update()

            obj = bpy.data.objects.new(Nome, mesh_data)

            context = bpy.context
            scene = bpy.context.scene
            #scene.objects.link(obj)
            bpy.context.collection.objects.link(obj)

            bpy.ops.object.select_all(action='DESELECT')
            obj.select_set(True)
            context.view_layer.objects.active = obj


        CriaLinhaALinha('Orbital right', 'Orbital left', 'LinhaOrbAlinha')
        ObjDestino = context.view_layer.objects.active
        print(ObjDestino.name)

        bpy.ops.mesh.add_linhabase(location=(0, 0, 0), rotation=(0, -1.5708, 0))
        ObjOrigem = context.view_layer.objects.active
        print(ObjOrigem.name)

        bpy.ops.object.mode_set(mode = 'EDIT')
        bpy.ops.maplus.quickalignlinesgrabdest()
        bpy.ops.object.mode_set(mode = 'OBJECT')

        # Parenteia objetos à Linha
        bpy.ops.object.select_all(action='DESELECT')

        ListaObjetos = ['Bones', 'Orbital right', 'Orbital left', 'Po left', 'N point']

        for i in ListaObjetos:
            bpy.ops.object.select_all(action='DESELECT')
            bpy.data.objects[i].select_set(True)
            ObjDestino.select_set(True)
            context.view_layer.objects.active = ObjDestino
            bpy.ops.object.parent_set()

        bpy.ops.object.select_all(action='DESELECT')
        ObjDestino.select_set(True)
        context.view_layer.objects.active = ObjDestino
        bpy.ops.object.mode_set(mode = 'EDIT')
        bpy.ops.maplus.quickalignlinesobject()
        bpy.ops.object.mode_set(mode = 'OBJECT')

        # Desagrupa

        for i in ListaObjetos:
            bpy.ops.object.select_all(action='DESELECT')
            bpy.data.objects[i].select_set(True)
            context.view_layer.objects.active = bpy.data.objects[i]
            bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')

        bpy.ops.object.select_all(action='DESELECT')
        ObjDestino.select_set(True)
        ObjOrigem.select_set(True)
        bpy.ops.object.delete(use_global=False)

        #LINHA LATERAL

        bpy.ops.mesh.add_linhabase(location=(200, 0, 0), rotation=(1.5708, 0, 0))
        ObjOrigem2 = context.view_layer.objects.active
        print("Origem:", ObjOrigem2.name)

        bpy.ops.object.mode_set(mode = 'EDIT')
        bpy.ops.maplus.quickalignlinesgrabdest()
        bpy.ops.object.mode_set(mode = 'OBJECT')


        CriaLinhaALinha('Orbital left', 'Po left', 'LinhaOrbAlinha2')
        ObjDestino2 = context.view_layer.objects.active
        print(ObjDestino2.name)


        bpy.ops.transform.resize(value=(0, 1, 1), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(True, False, False), mirror=True, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
        bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)


        # Parenteia objetos à Linha
        bpy.ops.object.select_all(action='DESELECT')

        ListaObjetos = ['Bones', 'Orbital right', 'Orbital left', 'Po left', 'N point']

        for i in ListaObjetos:
            bpy.ops.object.select_all(action='DESELECT')
            bpy.data.objects[i].select_set(True)
            ObjDestino2.select_set(True)
            context.view_layer.objects.active = ObjDestino2
            bpy.ops.object.parent_set()

        bpy.ops.object.select_all(action='DESELECT')
        ObjDestino2.select_set(True)
        context.view_layer.objects.active = ObjDestino2
        bpy.ops.object.mode_set(mode = 'EDIT')
        bpy.ops.maplus.quickalignlinesobject()
        bpy.ops.object.mode_set(mode = 'OBJECT')

        # Desagrupa

        for i in ListaObjetos:
            bpy.ops.object.select_all(action='DESELECT')
            bpy.data.objects[i].select_set(True)
            context.view_layer.objects.active = bpy.data.objects[i]
            bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')

        bpy.ops.object.select_all(action='DESELECT')
        ObjDestino2.select_set(True)
        ObjOrigem2.select_set(True)
        bpy.ops.object.delete(use_global=False)

        # MOVE AO CENTRO

        bpy.ops.object.select_all(action='DESELECT')

        ListaObjetos2 = ['Bones', 'Orbital right', 'Orbital left', 'Po left']

        PontoCentral = bpy.data.objects['N point']

        for i in ListaObjetos2:
            bpy.ops.object.select_all(action='DESELECT')
            bpy.data.objects[i].select_set(True)
            PontoCentral .select_set(True)
            context.view_layer.objects.active = PontoCentral
            bpy.ops.object.parent_set()

        PontoCentral = bpy.context.object.location = 0,0,0

        # Desagrupa

        for i in ListaObjetos2:
            bpy.ops.object.select_all(action='DESELECT')
            bpy.data.objects[i].select_set(True)
            context.view_layer.objects.active = bpy.data.objects[i]
            bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')

    else:
        bpy.ops.object.dialog_operator_falta_ponto_obj('INVOKE_DEFAULT')

class AlinhaCranioFrankfurt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.alinha_cranio_frankfurt"
    bl_label = "Align 3 Points"

    def execute(self, context):
        AlinhaCranioFrankfurtDef()
        return {'FINISHED'}

bpy.utils.register_class(AlinhaCranioFrankfurt)


class OcultaMole(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.oculta_mole"
    bl_label = "Hide Face"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        bpy.data.objects['SoftTissue'].hide_viewport=True
        return {'FINISHED'}

bpy.utils.register_class(OcultaMole)

def PreparaMandibulaCmDef():

    SelecionaObjeto("cm")

    bpy.ops.object.duplicate()
    bpy.context.object.name = "cm_COPY"

    objeto = bpy.data.objects["cm_COPY"]
    objeto.animation_data_clear()

    bpy.data.objects["cm"].hide_viewport = True

    ListaMateriais = []
    MateriaisCena = bpy.data.materials

    for i in MateriaisCena:
        ListaMateriais.append(i.name)

    for x in objeto.material_slots:
        objeto.active_material_index = 0
        bpy.ops.object.material_slot_remove()

    if 'MatMandibulaAlinha' in ListaMateriais:
        activeObject = objeto
        mat = bpy.data.materials["MatMandibulaAlinha"]
        activeObject.data.materials.append(mat)
        bpy.context.object.active_material.diffuse_color = (0.19, 0.5, 0.8, 1)
    else:
        activeObject = objeto
        mat = bpy.data.materials.new(name="MatMandibulaAlinha")
        activeObject.data.materials.append(mat)
        bpy.context.object.active_material.diffuse_color = (0.19, 0.5, 0.8, 1)

class PreparaMandibulaCm(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.prepara_mandibula_cm"
    bl_label = "Prepare Mandible cm"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'cm_COPY' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        PreparaMandibulaCmDef()
        return {'FINISHED'}

bpy.utils.register_class(PreparaMandibulaCm)


def FinalizaMandibulaCmDef():

    bpy.context.scene.frame_current = 100

    bpy.data.objects["cm"].hide_viewport = False

    SelecionaObjeto("cm")

    cmCopyLoc = bpy.data.objects['cm_COPY'].location
    cmCopyRoc = bpy.data.objects['cm_COPY'].rotation_euler

    cm = bpy.data.objects['cm']
    cm.location = cmCopyLoc
    cm.rotation_euler = cmCopyRoc

    bpy.ops.anim.ortog_loc_rot()

    SelecionaObjeto("cm_COPY")
    bpy.ops.object.delete(use_global=False)


class FinalizaMandibulaCm(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.finaliza_mandibula_cm"
    bl_label = "Finish Mandible cm"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        FinalizaMandibulaCmDef()
        return {'FINISHED'}

bpy.utils.register_class(FinalizaMandibulaCm)


================================================
FILE: AlinhaRedimensiona.py
================================================
import bpy
import math
import fnmatch

# MENSAGENS

class MessageSelecioneObj(bpy.types.Operator):
    bl_idname = "object.dialog_operator_selecione"
    bl_label = "Please, select an object before!"

    def execute(self, context):
        message = ("Please, select an object before!")
        self.report({'INFO'}, message)
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self)

bpy.utils.register_class(MessageSelecioneObj)

class MessageColoqueValor(bpy.types.Operator):
    bl_idname = "object.dialog_operator_coloque_valor"
    bl_label = "Please, inform a value on Real Size!"

    def execute(self, context):
        message = ("Please, inform a value on Real Size!")
        self.report({'INFO'}, message)
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self)

bpy.utils.register_class(MessageColoqueValor)

# COMANDOS

def CriaBaseOrigem():

    bpy.ops.object.empty_add(type='PLAIN_AXES', view_align=False, location=(-1, 0, 1))
    bpy.context.object.name = "EMP1a"

    bpy.ops.object.empty_add(type='PLAIN_AXES', view_align=False, location=(1, 0, 1))
    bpy.context.object.name = "EMP2a"

    bpy.ops.object.empty_add(type='PLAIN_AXES', view_align=False, location=(0, 0, -1))
    bpy.context.object.name = "EMP3a"

    bpy.ops.object.select_all(action='DESELECT')


def Redimensiona(self, context):

    global EMP1EMP2, medidareal2

    context = bpy.context
    FACE = context.active_object

    EMP1 = bpy.data.objects['EMP1b'] # Olho direito
    EMP2 = bpy.data.objects['EMP2b'] # Olho esquerdo
    EMP3 = bpy.data.objects['EMP3b'] # Ponto inferior
    bpy.ops.object.empty_add(type='SPHERE', location=((EMP1.location[0]+EMP2.location[0])/2, (EMP1.location[1]+EMP2.location[1])/2, (EMP1.location[2]+EMP2.location[2])/2))
    bpy.context.object.name = "PT_Origem"
    EMP4 = bpy.data.objects['PT_Origem']

    l = []
    EMP1EMP2 = [EMP1, EMP2]

    for item in EMP1EMP2:
       l.append(item.location)

    medidaAtual2 = math.sqrt( (l[0][0] - l[1][0])**2 + (l[0][1] - l[1][1])**2 + (l[0][2] - l[1][2])**2)
    print(medidaAtual2)

    medidaReal2 = float(bpy.context.scene.medida_real2)

# Redimensiona

    fatorEscala2 = medidaReal2 / medidaAtual2

    bpy.ops.object.select_all(action='DESELECT')
    EMP1.select_set(True)
    EMP2.select_set(True)
    EMP3.select_set(True)
    EMP4.select_set(True)
    FACE.select_set(True)
    bpy.context.view_layer.objects.active = EMP4
    bpy.ops.object.parent_set()

    EMP4.scale = ( fatorEscala2, fatorEscala2, fatorEscala2 )


#    bpy.ops.object.select_all(action='DESELECT')
#    FACE.select = True
#    bpy.context.scene.objects.active = FACE
#    FACE.scale = ( fatorEscala2, fatorEscala2, fatorEscala2 )

    print("Medida Atual:", medidaAtual2)
    print("Medida Real: ", medidaReal2)
    print("Fator de Escala: ", fatorEscala2)

    bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)

    bpy.ops.object.select_all(action='DESELECT')
#    EMP1.select_set(True)
#    EMP2.select_set(True)
#    EMP3.select_set(True)
    EMP4.select_set(True)
    bpy.context.view_layer.objects.active = EMP1
    bpy.ops.object.delete(use_global=False)


    FACE.select_set(True)
    bpy.context.view_layer.objects.active = FACE

    bpy.ops.object.transform_apply() # É necessário colocar os ()

    bpy.ops.view3d.view_axis(type='FRONT')
#    bpy.ops.view3d.viewnumpad(type='FRONT')
    bpy.ops.view3d.view_selected()

    #bpy.ops.view3d.view_all(center=True)

    # Centraliza zoom
    for area in bpy.context.screen.areas:
        if area.type == 'VIEW_3D':
            for region in area.regions:
                if region.type == 'WINDOW':
                    override = {'area': area, 'region': region, 'edit_object': bpy.context.edit_object}
                    bpy.ops.view3d.view_all(override)


class AlinhaForcaBtn(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.alinha_forca"
    bl_label = "Cálculo de Alinhamento da Mandíbula"

    def execute(self, context):

        context = bpy.context
        obj = context.active_object
        scn = context.scene

        if bpy.context.scene.medida_real2 == "None":
            bpy.ops.object.dialog_operator_coloque_valor('INVOKE_DEFAULT')
        else:

            CriaBaseOrigem()
            print("OBJETOS CRIADOS!!!")
            obj.select_set(True)
            bpy.context.view_layer.objects.active = obj
            Redimensiona(self, context)
            bpy.ops.object.alinha_tres_pontos()

            bpy.context.object.location[0] = 0
            bpy.context.object.location[1] = 0
            bpy.context.object.location[2] = 0

            bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)

            # Centraliza zoom
            for area in bpy.context.screen.areas:
                if area.type == 'VIEW_3D':
                    for region in area.regions:
                        if region.type == 'WINDOW':
                            override = {'area': area, 'region': region, 'edit_object': bpy.context.edit_object}
                            bpy.ops.view3d.view_all(override)


#            ApagaPontosAlinhaDef()
#            ApagaPontosOrigemDef()

#        bpy.ops.object.transform_apply

        return {'FINISHED'}

bpy.utils.register_class(AlinhaForcaBtn)

# Alinhamento por ICP
def ForceICPDef(self, context):

    # TESTA SE TEM MAIS DO QUE 200 K???
    context = bpy.context

    if len(context.selected_objects) == 2:

        ativo_antigo = context.view_layer.objects.active.name
#        print("Objeto ativo:", ativo_antigo)

        for i in bpy.context.selected_objects:

            if i.name != ativo_antigo:
                context.view_layer.objects.active = i
#                print("Deu certo?", i.name)

        bpy.ops.object.align_icp()
        bpy.ops.object.align_icp()
        bpy.ops.object.align_icp()
        bpy.ops.object.align_icp()
        bpy.ops.object.align_icp()
        bpy.ops.object.align_icp()
        bpy.ops.object.align_icp()
        bpy.ops.object.align_icp()

class ForceICP(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.force_icp"
    bl_label = "Force_ICP"


    @classmethod
    def poll(cls, context):
        condition_1 = len(context.selected_objects) == 2
        conidion_2 = context.object.type == 'MESH'
        return condition_1 and condition_1


    def execute(self, context):
        ForceICPDef(self, context)
        return {'FINISHED'}

bpy.utils.register_class(ForceICP)


================================================
FILE: AtualizaScript.py
================================================
import bpy
import subprocess
import platform
from os.path import expanduser

def AtualizaScriptDef(self, context):

	if platform.system() == "Windows":
#		subprocess.call('cd C:\OrtogOnBlender\Blender\2.78\scripts\addons\OrtogOnBlender-master && atualiza_ortog.bat', shell=True)

		arquivo = open('atualiza_ortog.bat', 'w+')
		arquivo.writelines("""cd C:/OrtogOnBlender/Blender280/2.80/scripts/addons && ^
rd /s /q OrtogOnBlender-master && ^
C:/OrtogOnBlender/Python27/python.exe -c "import urllib; urllib.urlretrieve ('http://www.ciceromoraes.com.br/downloads/OrtogOnBlender/addon/280/OrtogOnBlender-master.zip', 'OrtogOnBlender-master.zip')" && ^
C:/OrtogOnBlender/7-Zip/7z x  OrtogOnBlender-master.zip && ^
del OrtogOnBlender-master.zip""")

		arquivo.close()

		subprocess.call('atualiza_ortog.bat', shell=True)

	if platform.system() == "Linux":

		home = expanduser("~")
		arquivo = open(home+'/Programs/OrtogOnBlender/Blender280/atualiza_ortog.sh', 'w+')
		arquivo.writelines("""cd $HOME/Downloads && rm -Rfv OrtogOnBlender-master* && \
if [ -f "OrtogOnBlender-master.zip" ]; then echo "tem arquivo" && rm OrtogOnBlender-master.zi*; fi && \
wget http://www.ciceromoraes.com.br/downloads/OrtogOnBlender/addon/280/OrtogOnBlender-master.zip && \
rm -Rfv $HOME/.config/blender/2.80/scripts/addons/OrtogOnBlender-master && \
unzip OrtogOnBlender-master.zip && \
cp -Rv OrtogOnBlender-master $HOME/.config/blender/2.80/scripts/addons/""")

		arquivo.close()

		subprocess.call('chmod +x '+home+'/Programs/OrtogOnBlender/Blender280/atualiza_ortog.sh && '+home+'/Programs/OrtogOnBlender/Blender280/atualiza_ortog.sh', shell=True)
        

	if platform.system() == "Darwin":

		arquivo = open('atualiza_ortog.sh', 'w+')
		arquivo.writelines("""cd $HOME/Downloads && rm -Rfv OrtogOnBlender-master* && \
if [ -f "OrtogOnBlender-master.zip" ]; then echo "tem arquivo" && rm OrtogOnBlender-master.zi*; fi && \
wget http://www.ciceromoraes.com.br/downloads/OrtogOnBlender/addon/280/OrtogOnBlender-master.zip && \
rm -Rfv $HOME/Library/Application\ Support/Blender/2.80/scripts/addons/OrtogOnBlender-master && \
unzip OrtogOnBlender-master.zip && \
mv OrtogOnBlender-master $HOME/Library/Application\ Support/Blender/2.80/scripts/addons/""")

		arquivo.close()

		subprocess.call('chmod +x atualiza_ortog.sh && ./atualiza_ortog.sh', shell=True)

class AtualizaScript(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.atualiza_script"
    bl_label = "Atualiza Script"

    def execute(self, context):
        AtualizaScriptDef(self, context)
        bpy.ops.wm.quit_blender()
        return {'FINISHED'}


================================================
FILE: BooleanaOsteo.py
================================================
import bpy
import os
import tempfile
import subprocess
import platform
from os.path import expanduser

class MessageErroCollection(bpy.types.Operator):
    bl_idname = "object.dialog_operator_erro_collection"
    bl_label = "All objects have to be in Colletion, use M!"

    def execute(self, context):
        message = ("All objects have to be in Colletion, use M!")
        self.report({'INFO'}, message)
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self)

bpy.utils.register_class(MessageErroCollection)

def BooleanaMandDef(self, context):

    context = bpy.context
    scn = context.scene

    tmpdir = tempfile.mkdtemp()

    #objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select ]

    A = bpy.data.objects['Bones']
    B = context.active_object #objetos_selecionados[0]

# Infla o objeto
    bpy.ops.object.mode_set(mode = 'EDIT')
    bpy.ops.mesh.select_mode(type="VERT")
    bpy.ops.mesh.select_all(action = 'SELECT')

    bpy.ops.transform.shrink_fatten(value=-1.61748, use_even_offset=False, mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

    bpy.ops.object.mode_set(mode = 'OBJECT')

    bpy.ops.object.modifier_add(type='REMESH')
    bpy.context.object.modifiers["Remesh"].mode = 'SMOOTH'
    bpy.context.object.modifiers["Remesh"].octree_depth = 7

    # Seleciona objeto A
    A.hide_viewport=False
    bpy.ops.object.select_all(action='DESELECT')
    A.select_set(True)
    bpy.context.view_layer.objects.active = A

    bpy.ops.object.modifier_add(type='TRIANGULATE')
    bpy.ops.export_mesh.off(filepath=tmpdir+"/A.off")
    bpy.ops.object.modifier_remove(modifier="Triangulate")


    obj2 = bpy.context.view_layer.objects.active

# ENVIA COLLECTION

    ListaColl = []

    for i in bpy.data.collections:
        ListaColl.append(i.name)

    if "Copied_Objects" not in ListaColl:

        myCol = bpy.data.collections.new("Copied_Objects")
        bpy.context.scene.collection.children.link(myCol)
        bpy.ops.object.collection_link(collection='Copied_Objects')
#        mainCol = bpy.data.collections['Collection']
#        bpy.context.scene.collection.children.unlink(mainCol)
        bpy.data.collections['Collection'].objects.unlink(obj2)

    else:
        bpy.ops.object.collection_link(collection='Copied_Objects')
#        mainCol = bpy.data.collections['Collection']
#        bpy.context.scene.collection.children.unlink(mainCol)
        bpy.data.collections['Collection'].objects.unlink(obj2)

    bpy.data.collections['Copied_Objects'].hide_viewport=True

# ----------------------

    # Cria objeto B
    bpy.ops.object.select_all(action='DESELECT')
    B.select_set(True)
    bpy.context.view_layer.objects.active = B

    bpy.ops.object.modifier_add(type='TRIANGULATE')
    bpy.ops.export_mesh.off(filepath=tmpdir+"/B.off")
    bpy.ops.object.modifier_remove(modifier="Triangulate")


    obj2 = bpy.context.view_layer.objects.active

# ENVIA COLLETION

    ListaColl = []

    for i in bpy.data.collections:
        ListaColl.append(i.name)

    if "Copied_Objects" not in ListaColl:

        myCol = bpy.data.collections.new("Copied_Objects")
        bpy.context.scene.collection.children.link(myCol)
        bpy.ops.object.collection_link(collection='Copied_Objects')
#        mainCol = bpy.data.collections['Collection']
#        bpy.context.scene.collection.children.unlink(mainCol)
        bpy.data.collections['Collection'].objects.unlink(obj2)

    else:
        bpy.ops.object.collection_link(collection='Copied_Objects')
#        mainCol = bpy.data.collections['Collection']
#        bpy.context.scene.collection.children.unlink(mainCol)
        bpy.data.collections['Collection'].objects.unlink(obj2)

    bpy.data.collections['Copied_Objects'].hide_viewport=True


#    bpy.ops.object.move_to_layer(layers=(False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False))

# -------------------

    bpy.ops.object.select_all(action='DESELECT')

    # Booleana
    if platform.system() == "Linux":
        subprocess.call('~/Programs/OrtogOnBlender/Cork/./cork -diff '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Skull.off', shell=True)
        bpy.ops.import_mesh.off(filepath=tmpdir+"/Skull.off")
        bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        subprocess.call('~/Programs/OrtogOnBlender/Cork/./cork -isct '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Mandible.off', shell=True)
        bpy.ops.import_mesh.off(filepath=tmpdir+"/Mandible.off")
        bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

    if platform.system() == "Windows":
        subprocess.call('C:\OrtogOnBlender\Cork\wincork.exe -diff '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Skull.off', shell=True)
        bpy.ops.import_mesh.off(filepath=tmpdir+"/Skull.off")
        bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        subprocess.call('C:\OrtogOnBlender\Cork\wincork.exe -isct '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Mandible.off', shell=True)
        bpy.ops.import_mesh.off(filepath=tmpdir+"/Mandible.off")
        bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

    if platform.system() == "Darwin":
 
        homeall = expanduser("~")
 
        subprocess.call(homeall+'/Programs/OrtogOnBlender/Cork/./cork -diff '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Skull.off', shell=True)
        bpy.ops.import_mesh.off(filepath=tmpdir+"/Skull.off")
        bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        subprocess.call(homeall+'/Programs/OrtogOnBlender/Cork/./cork -isct '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Mandible.off', shell=True)
        bpy.ops.import_mesh.off(filepath=tmpdir+"/Mandible.off")
        bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')


    Mandible = bpy.data.objects['Mandible']
    bpy.ops.object.select_all(action='DESELECT')
    Mandible.select_set(True)
    bpy.context.view_layer.objects.active = Mandible
    bpy.ops.object.move_to_collection(collection_index=1)

class BooleanaMand(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.booleana_mandib"
    bl_label = "Booleanas da mandíbula"

    def execute(self, context):
       BooleanaMandDef(self, context)
       return {'FINISHED'}

def BooleanaOsteoDef(self, context):

    context = bpy.context
#    obj = context.active_object
    scn = context.scene

    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_get() == True ]

    lista_colecoes = []

    for i in objetos_selecionados:
        lista_colecoes.append(i.users_collection[0].name)


    lista_final = []

    for i in lista_colecoes:
        if i != 'Collection':
            lista_final.append("FORA")

    if "FORA" in lista_final:
        bpy.ops.object.dialog_operator_erro_collection('INVOKE_DEFAULT')

    else:
        tmpdir = tempfile.mkdtemp()

    #    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_set ]

    #    A = objetos_selecionados[1]
    #    B = objetos_selecionados[0]

        B = bpy.data.objects['Corte']
        A = context.active_object #objetos_selecionados[0]

        # Cria objeto A
        bpy.ops.object.select_all(action='DESELECT')
        A.select_set(True)
        bpy.context.view_layer.objects.active = A



        bpy.ops.object.modifier_add(type='TRIANGULATE')
        bpy.ops.export_mesh.off(filepath=tmpdir+"/A.off")
        bpy.ops.object.modifier_remove(modifier="Triangulate")


        obj2 = bpy.context.view_layer.objects.active



    # ENVIA COLLECTION

        ListaColl = []

        for i in bpy.data.collections:
            ListaColl.append(i.name)

        if "Copied_Objects" not in ListaColl:

            myCol = bpy.data.collections.new("Copied_Objects")
            bpy.context.scene.collection.children.link(myCol)
            bpy.ops.object.collection_link(collection='Copied_Objects')
    #        mainCol = bpy.data.collections['Collection']
    #        bpy.context.scene.collection.children.unlink(mainCol)
            bpy.data.collections['Collection'].objects.unlink(obj2)

        else:
            bpy.ops.object.collection_link(collection='Copied_Objects')
    #        mainCol = bpy.data.collections['Collection']
    #        bpy.context.scene.collection.children.unlink(mainCol)
            bpy.data.collections['Collection'].objects.unlink(obj2)

        bpy.data.collections['Copied_Objects'].hide_viewport=True

        # Cria objeto B
        bpy.ops.object.select_all(action='DESELECT')
        B.select_set(True)
        bpy.context.view_layer.objects.active = B

        bpy.ops.object.modifier_add(type='TRIANGULATE')
        bpy.ops.export_mesh.off(filepath=tmpdir+"/B.off")
        bpy.ops.object.modifier_remove(modifier="Triangulate")

        obj2 = bpy.context.view_layer.objects.active

    # ENVIA COLLECTION

        ListaColl = []

        for i in bpy.data.collections:
            ListaColl.append(i.name)

        if "Copied_Objects" not in ListaColl:

            myCol = bpy.data.collections.new("Copied_Objects")
            bpy.context.scene.collection.children.link(myCol)
            bpy.ops.object.collection_link(collection='Copied_Objects')
    #        mainCol = bpy.data.collections['Collection']
    #        bpy.context.scene.collection.children.unlink(mainCol)
            bpy.data.collections['Collection'].objects.unlink(obj2)

        else:
            bpy.ops.object.collection_link(collection='Copied_Objects')
    #        mainCol = bpy.data.collections['Collection']
    #        bpy.context.scene.collection.children.unlink(mainCol)
            bpy.data.collections['Collection'].objects.unlink(obj2)

        bpy.data.collections['Copied_Objects'].hide_viewport=True

        bpy.ops.object.select_all(action='DESELECT')


        # Booleana
        if platform.system() == "Linux":
            subprocess.call('~/Programs/OrtogOnBlender/Cork/./cork -diff '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')


        if platform.system() == "Windows":
            subprocess.call('C:\OrtogOnBlender\Cork\wincork.exe -diff '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        if platform.system() == "Darwin":

            homeall = expanduser("~")

            subprocess.call(homeall+'/Programs/OrtogOnBlender/Cork/./cork -diff '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')



    #    Result = context.active_object
    #    Result = bpy.context.view_layer.objects.active

        objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_set ]

        try:
            bpy.data.collections['Collection'].objects.link(objetos_selecionados[0])
        except:
            print("O objeto já está na Collecion!")

    #    obj = context.active_object


        bpy.ops.mesh.separate(type='LOOSE')

        objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_set ]

        for i in objetos_selecionados:
            bpy.ops.object.select_all(action='DESELECT')
            i.select_set(True)
            bpy.context.view_layer.objects.active = i
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
            bpy.ops.object.move_to_collection(collection_index=1)



class BooleanaOsteoClass(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.booleana_osteo"
    bl_label = "Importa fatias de tomografia DICOM"

    def execute(self, context):
        BooleanaOsteoDef(self, context)
#        bpy.ops.object.collection_link(collection='Collection')
        return {'FINISHED'}


def BooleanaOsteoGeralDef(self, context):

    context = bpy.context
#    obj = context.active_object
    scn = context.scene

    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_get() == True ]

    lista_colecoes = []

    for i in objetos_selecionados:
        lista_colecoes.append(i.users_collection[0].name)


    lista_final = []

    for i in lista_colecoes:
        if i != 'Collection':
            lista_final.append("FORA")

    if "FORA" in lista_final:
        bpy.ops.object.dialog_operator_erro_collection('INVOKE_DEFAULT')

    else:

        tmpdir = tempfile.mkdtemp()


        B = bpy.context.view_layer.objects.active
        print("Objeto B:", B)

        for i in bpy.context.selected_objects:
            if i.name != B.name:
                A = i
                print("Objeto A:", A.name)
    #    B = bpy.context.selected_objects[1]

    #    B = bpy.data.objects['Corte']
    #    A = context.active_object #objetos_selecionados[0]

        # Remover vértices duplos
        bpy.ops.object.select_all(action='DESELECT')
        A.select_set(True)
        bpy.context.view_layer.objects.active = A

        if A.type == 'MESH':
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.object.mode_set(mode='OBJECT')
        else:
            print("Não é malha!")
        bpy.ops.object.select_all(action='DESELECT')
        B.select_set(True)
        bpy.context.view_layer.objects.active = B
        if B.type == 'MESH':
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.object.mode_set(mode='OBJECT')
        else:
            print("Não é malha!")


        # Cria objeto A
        bpy.ops.object.select_all(action='DESELECT')
        A.select_set(True)
        bpy.context.view_layer.objects.active = A



        bpy.ops.object.modifier_add(type='TRIANGULATE')
        bpy.ops.export_mesh.off(filepath=tmpdir+"/A.off")
        bpy.ops.object.modifier_remove(modifier="Triangulate")


        obj2 = bpy.context.view_layer.objects.active



    # ENVIA COLLECTION

        ListaColl = []

        for i in bpy.data.collections:
            ListaColl.append(i.name)

        if "Copied_Objects" not in ListaColl:

            obj = context.active_object
            myCol = bpy.data.collections.new("Copied_Objects")
            bpy.context.scene.collection.children.link(myCol)
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj)


        else:
            obj = context.active_object
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj)

        bpy.data.collections['Copied_Objects'].hide_viewport=True

        # Cria objeto B
        bpy.ops.object.select_all(action='DESELECT')
        B.select_set(True)
        bpy.context.view_layer.objects.active = B

        bpy.ops.object.modifier_add(type='TRIANGULATE')
        bpy.ops.export_mesh.off(filepath=tmpdir+"/B.off")
        bpy.ops.object.modifier_remove(modifier="Triangulate")

        obj2 = bpy.context.view_layer.objects.active

    # ENVIA COLLECTION

        ListaColl = []

        for i in bpy.data.collections:
            ListaColl.append(i.name)

        if "Copied_Objects" not in ListaColl:

            obj = context.active_object
            myCol = bpy.data.collections.new("Copied_Objects")
            bpy.context.scene.collection.children.link(myCol)
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj2)


        else:
            obj = context.active_object
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj2)

        bpy.data.collections['Copied_Objects'].hide_viewport=True

        bpy.ops.object.select_all(action='DESELECT')

        # OCulta objetos originais
        A.hide_viewport=True
        B.hide_viewport=True

        # Booleana
        if platform.system() == "Linux":
            subprocess.call('~/Programs/OrtogOnBlender/Cork/./cork -diff '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        if platform.system() == "Windows":
            subprocess.call('C:\OrtogOnBlender\Cork\wincork.exe -diff '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        if platform.system() == "Darwin":

            homeall = expanduser("~")

            subprocess.call(homeall+'/Programs/OrtogOnBlender/Cork/./cork -diff '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

    #    Result = context.active_object
    #    Result = bpy.context.view_layer.objects.active

    #    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_set ]
    #    bpy.data.collections['Collection'].objects.link(objetos_selecionados[0])

    #    bpy.data.collections['Collection'].objects.link(bpy.context.selected_objects[0])

        bpy.ops.mesh.separate(type='LOOSE')

        objetos_selecionados = [ o for o in bpy.context.selected_objects ]

        for i in objetos_selecionados:
            bpy.ops.object.select_all(action='DESELECT')
            i.select_set(True)
            bpy.context.view_layer.objects.active = i
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
            bpy.ops.object.collection_link(collection='Collection')
            bpy.ops.object.move_to_collection(collection_index=1)



class BooleanaOsteoGeral(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.booleana_osteo_geral"
    bl_label = "Importa fatias de tomografia DICOM"

    def execute(self, context):
        BooleanaOsteoGeralDef(self, context)
#        bpy.ops.object.collection_link(collection='Collection')
        return {'FINISHED'}

# Booleana Union

def BooleanaOsteoUnionDef(self, context):

    context = bpy.context
#    obj = context.active_object
    scn = context.scene

    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_get() == True ]

    lista_colecoes = []

    for i in objetos_selecionados:
        lista_colecoes.append(i.users_collection[0].name)


    lista_final = []

    for i in lista_colecoes:
        if i != 'Collection':
            lista_final.append("FORA")

    if "FORA" in lista_final:
        bpy.ops.object.dialog_operator_erro_collection('INVOKE_DEFAULT')

    else:

        tmpdir = tempfile.mkdtemp()


        B = bpy.context.view_layer.objects.active
        print("Objeto B:", B)

        for i in bpy.context.selected_objects:
            if i.name != B.name:
                A = i
                print("Objeto A:", A.name)
    #    B = bpy.context.selected_objects[1]

    #    B = bpy.data.objects['Corte']
    #    A = context.active_object #objetos_selecionados[0]

        # Remover vértices duplos
        bpy.ops.object.select_all(action='DESELECT')
        A.select_set(True)
        bpy.context.view_layer.objects.active = A
        if A.type == 'MESH':
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.object.mode_set(mode='OBJECT')
        else:
            print("Não é malha!")
        bpy.ops.object.select_all(action='DESELECT')
        B.select_set(True)
        bpy.context.view_layer.objects.active = B
        if B.type == 'MESH':
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.object.mode_set(mode='OBJECT')
        else:
            print("Não é malha!")

        # Cria objeto A
        bpy.ops.object.select_all(action='DESELECT')
        A.select_set(True)
        bpy.context.view_layer.objects.active = A



        bpy.ops.object.modifier_add(type='TRIANGULATE')
        bpy.ops.export_mesh.off(filepath=tmpdir+"/A.off")
        bpy.ops.object.modifier_remove(modifier="Triangulate")


    #    obj2 = bpy.context.view_layer.objects.active



    # ENVIA COLLECTION

        ListaColl = []

        for i in bpy.data.collections:
            ListaColl.append(i.name)

        if "Copied_Objects" not in ListaColl:

            obj = context.active_object
            myCol = bpy.data.collections.new("Copied_Objects")
            bpy.context.scene.collection.children.link(myCol)
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj)


        else:
            obj = context.active_object
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj)

        bpy.data.collections['Copied_Objects'].hide_viewport=True


        # Cria objeto B
        bpy.ops.object.select_all(action='DESELECT')
        B.select_set(True)
        bpy.context.view_layer.objects.active = B

        bpy.ops.object.modifier_add(type='TRIANGULATE')
        bpy.ops.export_mesh.off(filepath=tmpdir+"/B.off")
        bpy.ops.object.modifier_remove(modifier="Triangulate")

        obj2 = bpy.context.view_layer.objects.active

    # ENVIA COLLECTION

        ListaColl = []

        for i in bpy.data.collections:
            ListaColl.append(i.name)

        if "Copied_Objects" not in ListaColl:

            myCol = bpy.data.collections.new("Copied_Objects")
            bpy.context.scene.collection.children.link(myCol)
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj2)


        else:
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj2)



        bpy.data.collections['Copied_Objects'].hide_viewport=True

        bpy.ops.object.select_all(action='DESELECT')


        # OCulta objetos originais
    #    A.hide_viewport=True
    #    B.hide_viewport=True

        # Booleana
        if platform.system() == "Linux":
            subprocess.call('~/Programs/OrtogOnBlender/Cork/./cork -union '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        if platform.system() == "Windows":
            subprocess.call('C:\OrtogOnBlender\Cork\wincork.exe -union '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        if platform.system() == "Darwin":

            homeall = expanduser("~")

            subprocess.call(homeall+'/Programs/OrtogOnBlender/Cork/./cork -union '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')



    #    Result = context.active_object
    #    Result = bpy.context.view_layer.objects.active

    #    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_set ]
    #    bpy.data.collections['Collection'].objects.link(objetos_selecionados[0])

    #    bpy.data.collections['Collection'].objects.link(bpy.context.selected_objects[0])

        bpy.ops.mesh.separate(type='LOOSE')


        objetos_selecionados = [ o for o in bpy.context.selected_objects ]

        for i in objetos_selecionados:
            if i.visible_get() == True:
                bpy.ops.object.select_all(action='DESELECT')
                i.select_set(True)
                bpy.context.view_layer.objects.active = i
                bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
                bpy.ops.object.collection_link(collection='Collection')
                bpy.ops.object.move_to_collection(collection_index=1)



class BooleanaOsteoUnion(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.booleana_osteo_union"
    bl_label = "Importa fatias de tomografia DICOM"

    def execute(self, context):
        BooleanaOsteoUnionDef(self, context)
#g        bpy.ops.object.collection_link(collection='Collection')
        return {'FINISHED'}

bpy.utils.register_class(BooleanaOsteoUnion)

# Booleana Intersect

def BooleanaOsteoInterDef(self, context):

    context = bpy.context
#    obj = context.active_object
    scn = context.scene

    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_get() == True ]

    lista_colecoes = []

    for i in objetos_selecionados:
        lista_colecoes.append(i.users_collection[0].name)


    lista_final = []

    for i in lista_colecoes:
        if i != 'Collection':
            lista_final.append("FORA")

    if "FORA" in lista_final:
        bpy.ops.object.dialog_operator_erro_collection('INVOKE_DEFAULT')

    else:

        tmpdir = tempfile.mkdtemp()


        B = bpy.context.view_layer.objects.active
        print("Objeto B:", B)

        for i in bpy.context.selected_objects:
            if i.name != B.name:
                A = i
                print("Objeto A:", A.name)
    #    B = bpy.context.selected_objects[1]

    #    B = bpy.data.objects['Corte']
    #    A = context.active_object #objetos_selecionados[0]

        # Remover vértices duplos
        bpy.ops.object.select_all(action='DESELECT')
        A.select_set(True)
        bpy.context.view_layer.objects.active = A
        if A.type == 'MESH':
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.object.mode_set(mode='OBJECT')
        else:
            print("Não é malha!")
        bpy.ops.object.select_all(action='DESELECT')
        B.select_set(True)
        bpy.context.view_layer.objects.active = B
        if B.type == 'MESH':
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.object.mode_set(mode='OBJECT')
        else:
            print("Não é malha!")

        # Cria objeto A
        bpy.ops.object.select_all(action='DESELECT')
        A.select_set(True)
        bpy.context.view_layer.objects.active = A



        bpy.ops.object.modifier_add(type='TRIANGULATE')
        bpy.ops.export_mesh.off(filepath=tmpdir+"/A.off")
        bpy.ops.object.modifier_remove(modifier="Triangulate")


        obj2 = bpy.context.view_layer.objects.active



    # ENVIA COLLECTION

        ListaColl = []

        for i in bpy.data.collections:
            ListaColl.append(i.name)

        if "Copied_Objects" not in ListaColl:

            obj = context.active_object
            myCol = bpy.data.collections.new("Copied_Objects")
            bpy.context.scene.collection.children.link(myCol)
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj)


        else:
            obj = context.active_object
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj)

        bpy.data.collections['Copied_Objects'].hide_viewport=True

        # Cria objeto B
        bpy.ops.object.select_all(action='DESELECT')
        B.select_set(True)
        bpy.context.view_layer.objects.active = B

        bpy.ops.object.modifier_add(type='TRIANGULATE')
        bpy.ops.export_mesh.off(filepath=tmpdir+"/B.off")
        bpy.ops.object.modifier_remove(modifier="Triangulate")

        obj2 = bpy.context.view_layer.objects.active

    # ENVIA COLLECTION

        ListaColl = []

        for i in bpy.data.collections:
            ListaColl.append(i.name)

        if "Copied_Objects" not in ListaColl:

            myCol = bpy.data.collections.new("Copied_Objects")
            bpy.context.scene.collection.children.link(myCol)
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj2)


        else:
            bpy.ops.object.collection_link(collection='Copied_Objects')
            try:
                bpy.data.collections['Collection'].objects.unlink(obj2)
            except:
                print("Não está no Collection!")

        bpy.data.collections['Copied_Objects'].hide_viewport=True

        bpy.ops.object.select_all(action='DESELECT')

        # OCulta objetos originais
        A.hide_viewport=True
        B.hide_viewport=True

        # Booleana
        if platform.system() == "Linux":
            subprocess.call('~/Programs/OrtogOnBlender/Cork/./cork -isct '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        if platform.system() == "Windows":
            subprocess.call('C:\OrtogOnBlender\Cork\wincork.exe -isct '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        if platform.system() == "Darwin":

            homeall = expanduser("~")

            subprocess.call(homeall+'/Programs//OrtogOnBlender/Cork/./cork -isct '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')



    #    Result = context.active_object
    #    Result = bpy.context.view_layer.objects.active

    #    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_set ]
    #    bpy.data.collections['Collection'].objects.link(objetos_selecionados[0])

    #    bpy.data.collections['Collection'].objects.link(bpy.context.selected_objects[0])

        bpy.ops.mesh.separate(type='LOOSE')

        objetos_selecionados = [ o for o in bpy.context.selected_objects ]

        '''
        for i in objetos_selecionados:
            bpy.ops.object.collection_link(collection='Collection')
            bpy.ops.object.select_all(action='DESELECT')
            i.select_set(True)
            bpy.context.view_layer.objects.active = i
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
        '''

        for i in objetos_selecionados:
            if i.visible_get() == True:
                bpy.ops.object.select_all(action='DESELECT')
                i.select_set(True)
                bpy.context.view_layer.objects.active = i
                bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
                bpy.ops.object.collection_link(collection='Collection')
                bpy.ops.object.move_to_collection(collection_index=1)



class BooleanaOsteoInter(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.booleana_osteo_inter"
    bl_label = "Importa fatias de tomografia DICOM"

    def execute(self, context):
        BooleanaOsteoInterDef(self, context)
#        bpy.ops.object.collection_link(collection='Collection')
        return {'FINISHED'}

bpy.utils.register_class(BooleanaOsteoInter)


def BooleanaUnionSimplesDef(self, context):

    context = bpy.context
#    obj = context.active_object
    scn = context.scene

    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_get() == True ]

    lista_colecoes = []

    for i in objetos_selecionados:
        lista_colecoes.append(i.users_collection[0].name)


    lista_final = []

    for i in lista_colecoes:
        if i != 'Collection':
            lista_final.append("FORA")

    if "FORA" in lista_final:
        bpy.ops.object.dialog_operator_erro_collection('INVOKE_DEFAULT')

    else:

        tmpdir = tempfile.mkdtemp()


        B = bpy.context.view_layer.objects.active
        print("Objeto B:", B)

        for i in bpy.context.selected_objects:
            if i.name != B.name:
                A = i
                print("Objeto A:", A.name)
    #    B = bpy.context.selected_objects[1]

    #    B = bpy.data.objects['Corte']
    #    A = context.active_object #objetos_selecionados[0]

        # Remover vértices duplos
        bpy.ops.object.select_all(action='DESELECT')
        A.select_set(True)
        bpy.context.view_layer.objects.active = A
        if A.type == 'MESH':
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.object.mode_set(mode='OBJECT')
        else:
            print("Não é malha!")
        bpy.ops.object.select_all(action='DESELECT')
        B.select_set(True)
        bpy.context.view_layer.objects.active = B
        if B.type == 'MESH':
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.object.mode_set(mode='OBJECT')
        else:
            print("Não é malha!")
        bpy.ops.object.mode_set(mode='OBJECT')


        # Cria objeto A
        bpy.ops.object.select_all(action='DESELECT')
        A.select_set(True)
        bpy.context.view_layer.objects.active = A



        bpy.ops.object.modifier_add(type='TRIANGULATE')
        bpy.ops.export_mesh.off(filepath=tmpdir+"/A.off")
        bpy.ops.object.modifier_remove(modifier="Triangulate")


        obj2 = bpy.context.view_layer.objects.active



    # ENVIA COLLECTION

        ListaColl = []

        for i in bpy.data.collections:
            ListaColl.append(i.name)

        if "Copied_Objects" not in ListaColl:

            obj = context.active_object
            myCol = bpy.data.collections.new("Copied_Objects")
            bpy.context.scene.collection.children.link(myCol)
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj)


        else:
            obj = context.active_object
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj)

        bpy.data.collections['Copied_Objects'].hide_viewport=True

        # Cria objeto B
        bpy.ops.object.select_all(action='DESELECT')
        B.select_set(True)
        bpy.context.view_layer.objects.active = B

        bpy.ops.object.modifier_add(type='TRIANGULATE')
        bpy.ops.export_mesh.off(filepath=tmpdir+"/B.off")
        bpy.ops.object.modifier_remove(modifier="Triangulate")

        obj2 = bpy.context.view_layer.objects.active

    # ENVIA COLLECTION

        ListaColl = []

        for i in bpy.data.collections:
            ListaColl.append(i.name)

        if "Copied_Objects" not in ListaColl:

            myCol = bpy.data.collections.new("Copied_Objects")
            bpy.context.scene.collection.children.link(myCol)
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj2)


        else:
            bpy.ops.object.collection_link(collection='Copied_Objects')
            bpy.data.collections['Collection'].objects.unlink(obj2)

        bpy.data.collections['Copied_Objects'].hide_viewport=True

        bpy.ops.object.select_all(action='DESELECT')

        # OCulta objetos originais
        A.hide_viewport=True
        B.hide_viewport=True

        # Booleana
        if platform.system() == "Linux":
            subprocess.call('~/Programs/OrtogOnBlender/Cork/./cork -union '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        if platform.system() == "Windows":
            subprocess.call('C:\OrtogOnBlender\Cork\wincork.exe -union '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

        if platform.system() == "Darwin":

            homeall = expanduser("~")

            subprocess.call(homeall+'/Programs/OrtogOnBlender/Cork/./cork -union '+tmpdir+'/A.off '+tmpdir+'/B.off '+tmpdir+'/Result.off', shell=True)
            bpy.ops.import_mesh.off(filepath=tmpdir+"/Result.off")
            bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')


    #    Result = context.active_object
    #    Result = bpy.context.view_layer.objects.active

    #    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_set ]
    #    bpy.data.collections['Collection'].objects.link(objetos_selecionados[0])

    #    bpy.data.collections['Collection'].objects.link(bpy.context.selected_objects[0])

    #    bpy.ops.mesh.separate(type='LOOSE')

        objetos_selecionados = [ o for o in bpy.context.selected_objects ]

        for i in objetos_selecionados:
            if i.visible_get() == True:
                bpy.ops.object.select_all(action='DESELECT')
                i.select_set(True)
                bpy.context.view_layer.objects.active = i
                bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
                bpy.ops.object.collection_link(collection='Collection')
                bpy.ops.object.move_to_collection(collection_index=1)

class BooleanaUnionSimples(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.booleana_union_simples"
    bl_label = "Importa fatias de tomografia DICOM"

    def execute(self, context):
        BooleanaUnionSimplesDef(self, context)
#        bpy.ops.object.collection_link(collection='Collection')
        return {'FINISHED'}


bpy.utils.register_class(BooleanaUnionSimples)
# -------------------

def UnionMultiplaDef(self, context):

    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_get() == True ]

    lista_colecoes = []

    for i in objetos_selecionados:
        lista_colecoes.append(i.users_collection[0].name)


    lista_final = []

    for i in lista_colecoes:
        if i != 'Collection':
            lista_final.append("FORA")

    if "FORA" in lista_final:
        bpy.ops.object.dialog_operator_erro_collection('INVOKE_DEFAULT')

    else:

        Objetos = [ o for o in bpy.context.selected_objects if o.select_get() == True ]
        #Results = []

        Contador = int(len(Objetos))

        while Contador > 1:
            bpy.ops.object.select_all(action='DESELECT')
            Objetos[0].select_set(True)
            Objetos[-1].select_set(True)
            bpy.context.view_layer.objects.active = Objetos[0]
            bpy.ops.object.booleana_union_simples()
            Objetos.remove(Objetos[0])
            Objetos.remove(Objetos[-1])
            Objetos.append(bpy.context.active_object)
            bpy.ops.object.collection_link(collection='Collection')
            Contador = int(len(Objetos))
            print("Contador", Contador)

class UnionMultipla(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.booleana_union_multipla"
    bl_label = "Ortog multiple union boolean"

    def execute(self, context):
        UnionMultiplaDef(self, context)
#        bpy.ops.object.collection_link(collection='Collection')
        return {'FINISHED'}


bpy.utils.register_class(UnionMultipla)


================================================
FILE: CalculaPontos.py
================================================
import bpy

def capturaINI(ObjSelecionado):
    bpy.ops.object.select_all(action='DESELECT')
    Objeto = bpy.data.objects[ObjSelecionado]
    Objeto.select_set(True)
    bpy.context.view_layer.objects.active = Objeto
    print("Está no frame: ",bpy.context.scene.frame_current)
    bpy.ops.object.duplicate()
    bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')
    bpy.context.object.name = ObjSelecionado+".INI"
    
def capturaFIN(ObjSelecionado):
    bpy.ops.object.select_all(action='DESELECT')
    Objeto = bpy.data.objects[ObjSelecionado]
    Objeto.select_set(True)
    bpy.context.view_layer.objects.active = Objeto
    print("Está no frame: ",bpy.context.scene.frame_current)
    bpy.ops.object.duplicate()
    bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')
    bpy.context.object.name = ObjSelecionado+".FIN" 
    
def apagaObjeto(ObjSelecionado):   
    bpy.ops.object.select_all(action='DESELECT')
    Objeto = bpy.data.objects[ObjSelecionado]
    Objeto.select_set(True)
    bpy.ops.object.delete(use_global=False)

  
    
def capturaINItodosDef():

    # ATUALIZADO?
    ListaPontos = ['Orbital right', 'Orbital left', 'N point', 'Po right', 'Po left', 'Pt right', 'Pt left', 'Ba point', 'S point', 'U1 Tip', 'U1 Labial Gengival Border', 'U1 Lingual Gengival Border', 'M U6', 'D U6', 'U6 Occlusal', 'PNS point', 'A point', 'ANS point', 'U1 Root', 'L1 Tip', 'L1 Root', 'L1 Labial Gengival Border', 'L1 Lingual Gengival Border', 'B point', 'M L6', 'L6 Occlusal', 'D L6', 'Mid Ramus right', 'Mid Ramus left', 'R right', 'R left', 'Go right', 'Go left', 'Ar right', 'Ar left', 'Sigmoid right', 'Sigmoid left', 'Co right', 'Co left', 'Pg point', 'Gn point', 'Me point', 'ST Glabella', 'ST Nasion', 'Bridge of Nose', 'Tip of Nose', 'Cheekbone right', 'Cheekbone left', 'Columella', 'Subnasale', 'Subpupil right', 'Subpupil left', 'ST A point', 'Upper Lip', 'Stomion Superius', 'Stomion Inferius', 'Lower Lip', 'ST B point', 'ST Pogonion', 'ST Gnathion', 'ST Menton', 'Throat point', 'CB right', 'CB left', 'OR right', 'OR left', 'SP right', 'SP left', 'AB right', 'AB left', 'Tooth 8', 'Tooth 9', 'Tooth 6', 'Tooth 11', 'Tooth 3', 'Tooth 14', 'Tooth 24', 'Tooth 25', 'Tooth 22', 'Tooth 27', 'Tooth 19', 'Tooth 30']

    ObjetosCena = bpy.data.objects

    for ob in ListaPontos:
        if ob in ObjetosCena:
            capturaINI(ob)

def capturaFINtodosDef():

    # ATUALIZADO?
    ListaPontos = ['Orbital right', 'Orbital left', 'N point', 'Po right', 'Po left', 'Pt right', 'Pt left', 'Ba point', 'S point', 'U1 Tip', 'U1 Labial Gengival Border', 'U1 Lingual Gengival Border', 'M U6', 'D U6', 'U6 Occlusal', 'PNS point', 'A point', 'ANS point', 'U1 Root', 'L1 Tip', 'L1 Root', 'L1 Labial Gengival Border', 'L1 Lingual Gengival Border', 'B point', 'M L6', 'L6 Occlusal', 'D L6', 'Mid Ramus right', 'Mid Ramus left', 'R right', 'R left', 'Go right', 'Go left', 'Ar right', 'Ar left', 'Sigmoid right', 'Sigmoid left', 'Co right', 'Co left', 'Pg point', 'Gn point', 'Me point', 'ST Glabella', 'ST Nasion', 'Bridge of Nose', 'Tip of Nose', 'Cheekbone right', 'Cheekbone left', 'Columella', 'Subnasale', 'Subpupil right', 'Subpupil left', 'ST A point', 'Upper Lip', 'Stomion Superius', 'Stomion Inferius', 'Lower Lip', 'ST B point', 'ST Pogonion', 'ST Gnathion', 'ST Menton', 'Throat point', 'CB right', 'CB left', 'OR right', 'OR left', 'SP right', 'SP left', 'AB right', 'AB left', 'Tooth 8', 'Tooth 9', 'Tooth 6', 'Tooth 11', 'Tooth 3', 'Tooth 14', 'Tooth 24', 'Tooth 25', 'Tooth 22', 'Tooth 27', 'Tooth 19', 'Tooth 30']

    ObjetosCena = bpy.data.objects

    for ob in ListaPontos:
        if ob in ObjetosCena:
            capturaFIN(ob)



def calculaDeslocamento(obj, obj1, obj2):
    objini = bpy.data.objects[obj1]
    objfin = bpy.data.objects[obj2]
    
    SRED = '\033[91m'
    SGREEN = '\033[92m'
    SBLUE = '\033[94m'

    BHEAD = '\033[95m'

    BEND = '\033[0m'


#    if bpy.data.objects.get(obj) is not None:
    Xdes = SRED + "X: " + str(round(objfin.location[0] - objini.location[0], 2)) + BEND
    Ydes = SGREEN + "Y: " + str(round(objfin.location[1] - objini.location[1], 2)) + BEND
    Zdes = SBLUE + "Z: " + str(round(objfin.location[2] - objini.location[2], 2)) + BEND

    a = '{} {} {} {} '.format(obj, Xdes, Ydes, Zdes)
    print(a)
    

def obj_pre(frame):
    bpy.context.scene.frame_set(frame)
    print("frame:", frame)
    capturaINItodosDef()
        
def obj_pos(frame):
    bpy.context.scene.frame_set(frame)
    print("frame:", frame)
    capturaFINtodosDef()

def geraDeslocamentoTODOSDef(self, context):
    
    context = bpy.context
    obj = context.active_object
    scn = context.scene

# Mostra resultados

    frame1 = bpy.data.scenes["Scene"].frame_start

    obj_pre(frame1)


    frame2 = bpy.data.scenes["Scene"].frame_end

    obj_pos(frame2)

    SYEL = '\33[45m'
    BOLD = '\033[1m'
    BEND = '\033[0m'

    print(" ")
    print(" ")
    print(BOLD + SYEL + "MAXILLA" + BEND)

    # ATUALIZADO?
    ListaPontos = ['Orbital right', 'Orbital left', 'N point', 'Po right', 'Po left', 'Pt right', 'Pt left', 'Ba point', 'S point', 'U1 Tip', 'U1 Labial Gengival Border', 'U1 Lingual Gengival Border', 'M U6', 'D U6', 'U6 Occlusal', 'PNS point', 'A point', 'ANS point', 'U1 Root', 'L1 Tip', 'L1 Root', 'L1 Labial Gengival Border', 'L1 Lingual Gengival Border', 'B point', 'M L6', 'L6 Occlusal', 'D L6', 'Mid Ramus right', 'Mid Ramus left', 'R right', 'R left', 'Go right', 'Go left', 'Ar right', 'Ar left', 'Sigmoid right', 'Sigmoid left', 'Co right', 'Co left', 'Pg point', 'Gn point', 'Me point', 'ST Glabella', 'ST Nasion', 'Bridge of Nose', 'Tip of Nose', 'Cheekbone right', 'Cheekbone left', 'Columella', 'Subnasale', 'Subpupil right', 'Subpupil left', 'ST A point', 'Upper Lip', 'Stomion Superius', 'Stomion Inferius', 'Lower Lip', 'ST B point', 'ST Pogonion', 'ST Gnathion', 'ST Menton', 'Throat point', 'CB right', 'CB left', 'OR right', 'OR left', 'SP right', 'SP left', 'AB right', 'AB left', 'Tooth 8', 'Tooth 9', 'Tooth 6', 'Tooth 11', 'Tooth 3', 'Tooth 14', 'Tooth 24', 'Tooth 25', 'Tooth 22', 'Tooth 27', 'Tooth 19', 'Tooth 30']

    ObjetosCena = bpy.data.objects

    try:
        Collection_Head = bpy.data.collections['Anatomical Points - Head'].all_objects

        print(BOLD + SYEL + "HEAD" + BEND)

        for ob in ListaPontos:
            if ob in Collection_Head:
                calculaDeslocamento( ob+' : ', ob+'.INI', ob+'.FIN')
    except:
        print("Sem pontos da Cabeça.")


    try:
        Collection_Maxilla = bpy.data.collections['Anatomical Points - Maxilla'].all_objects

        print(" ")
        print(BOLD + SYEL + "MAXILLA" + BEND)

        for ob in ListaPontos:
            if ob in Collection_Maxilla:
                calculaDeslocamento( ob+' : ', ob+'.INI', ob+'.FIN')
    except:
        print("Sem pontos da Maxila.")


    try:
        Collection_Teeth = bpy.data.collections['Anatomical Points - Teeth'].all_objects

        print(" ")
        print(BOLD + SYEL + "TEETH" + BEND)

        for ob in ListaPontos:
            if ob in Collection_Teeth:
                calculaDeslocamento( ob+' : ', ob+'.INI', ob+'.FIN')
    except:
        print("Sem pontos dos Dentes.")


    try:
        Collection_Mandible = bpy.data.collections['Anatomical Points - Mandible'].all_objects

        print(" ")
        print(BOLD + SYEL + "MANDIBLE" + BEND)

        for ob in ListaPontos:
            if ob in Collection_Mandible:
                calculaDeslocamento( ob+' : ', ob+'.INI', ob+'.FIN')
    except:
        print("Sem pontos da Mandíbula.")

    try:
        Collection_SoftTissue = bpy.data.collections['Anatomical Points - Soft Tissue'].all_objects

        print(" ")
        print(BOLD + SYEL + "SOFT TISSUE" + BEND)

        for ob in ListaPontos:
            if ob in Collection_SoftTissue:
                calculaDeslocamento( ob+' : ', ob+'.INI', ob+'.FIN')
    except:
        print("Sem pontos do Tecido Mole.")

    '''
    for ob in ListaPontos:
        if ob in ObjetosCena:
            calculaDeslocamento( ob+' : ', ob+'.INI', ob+'.FIN')
    '''

    # Apaga
    try:
        for ob in ListaPontos:
            if ob in ObjetosCena:
                apagaObjeto(ob+'.INI')
                apagaObjeto(ob+'.FIN')
    except:
        print("Sem objetos INI e FIN na cena.")
    

# Calcula Pontos
'''
class capturaINItodos(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.captura_ini_todos"
    bl_label = "Captura todos objetos inicio"

    def execute(self, context):
        capturaINItodosDef(self, context)
        return {'FINISHED'}


class capturaFINtodos(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.captura_fin_todos"
    bl_label = "Captura todos objetos final"

    def execute(self, context):
        capturaFINtodosDef(self, context)
        return {'FINISHED'}
'''
class geraDeslocamentoTODOS(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.gera_deslocamento_todos"
    bl_label = "Gera deslocamento de todos"

    def execute(self, context):
        geraDeslocamentoTODOSDef(self, context)
        return {'FINISHED'}

bpy.utils.register_class(geraDeslocamentoTODOS)


================================================
FILE: Cefalometria.py
================================================
import bpy
import math
from .FerrMedidas import *

def CursorToSelectedObj(objeto):

    context = bpy.context
    scn = context.scene

    bpy.ops.object.select_all(action='DESELECT')

    bpy.data.objects[objeto].select_set(True)
    context.view_layer.objects.active = bpy.data.objects[objeto]

    for area in bpy.context.screen.areas:
        if area.type == 'VIEW_3D':
            ctx = bpy.context.copy()
            ctx['area'] = area
            ctx['region'] = area.regions[-1]
    #        bpy.ops.view3d.view_selected(ctx)
            bpy.ops.view3d.snap_cursor_to_selected(ctx)
            break

def CursorToSelectedObjs(objeto1, objeto2):

    context = bpy.context
    scn = context.scene

    bpy.ops.object.select_all(action='DESELECT')

    bpy.data.objects[objeto1].select_set(True)
    bpy.data.objects[objeto2].select_set(True)
    context.view_layer.objects.active = bpy.data.objects[objeto1]

    for area in bpy.context.screen.areas:
        if area.type == 'VIEW_3D':
            ctx = bpy.context.copy()
            ctx['area'] = area
            ctx['region'] = area.regions[-1]
    #        bpy.ops.view3d.view_selected(ctx)
            bpy.ops.view3d.snap_cursor_to_selected(ctx)
            break

def ApagarObjeto(objeto):
    context = bpy.context
    scn = context.scene

    bpy.ops.object.select_all(action='DESELECT')
    bpy.data.objects[objeto].select_set(True)
    context.view_layer.objects.active = bpy.data.objects[objeto]
    bpy.ops.object.delete(use_global=False)



class CalculaTudoUSP(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.calcula_tudo_usp"
    bl_label = "USP Calc All"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        bpy.ops.object.calcula_plano_oclusal_classico()
        CalculaSNADef()
        CalculaSNBDef()
        CalculaANBDef()
        CalculaPlanoMandibularDef()
        CalculaSNGoGnDef()
        CalculaSNGnDef()
        return {'FINISHED'}

bpy.utils.register_class(CalculaTudoUSP)

def CalculaSNGnDef():

    FoundA = 'S point' in bpy.data.objects
    FoundN = 'N point' in bpy.data.objects
    FoundB = 'Gn point' in bpy.data.objects

    context = bpy.context
    objInicial = context.object

    CursorInicial = []

    for i in bpy.context.scene.cursor.location:
        CursorInicial.append(i)

    if FoundA == True and FoundN == True and FoundB == True:
        print("SNGn - Todos os pontos anatômicos presentes!")

        CursorToSelectedObj("S point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoS"
        bpy.context.object.location[0] = 0


        CursorToSelectedObj("N point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoN"
        bpy.context.object.location[0] = 0


        CursorToSelectedObj("Gn point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoGn"
        bpy.context.object.location[0] = 0

        bpy.data.objects["PontoS"].location[0] = 0
        bpy.data.objects["PontoN"].location[0] = 0
        bpy.data.objects["PontoGn"].location[0] = 0

        AnguloSNGn = CalculaAngulo("PontoN", "PontoS", "PontoGn")
        print("Ângulo SNGn:", AnguloSNGn)

        bpy.types.Scene.angulo_sngn = bpy.props.StringProperty \
            (
                name = "SNGn Angle",
                description = "SNGn Angle",
                default = str(AnguloSNGn)
            )

        ApagarObjeto("PontoS")
        ApagarObjeto("PontoN")
        ApagarObjeto("PontoGn")

        context.scene.cursor.location = CursorInicial

        if objInicial != None:
            bpy.ops.object.select_all(action='DESELECT')
            objInicial.select_set(True)
            context.view_layer.objects.active = objInicial

        return str(AnguloSNGn)

    else:
        bpy.types.Scene.angulo_sngn = bpy.props.StringProperty \
            (
                name = "SNGn Angle",
                description = "SNGn Angle",
                default = "NONE"
            )
        print("Falta algum ponto anatômico (SNGn)!")

def CalculaSNGoGnDef():

    FoundS = 'S point' in bpy.data.objects
    FoundN = 'N point' in bpy.data.objects
    FoundGoright = 'Go right' in bpy.data.objects
    FoundGoleft = 'Go left' in bpy.data.objects
    FoundGnpoint = 'Gn point' in bpy.data.objects

    context = bpy.context
    objInicial = context.object

    CursorInicial = []

    for i in bpy.context.scene.cursor.location:
        CursorInicial.append(i)


    if FoundS == True and FoundN == True and FoundGoright == True and FoundGoleft == True and FoundGnpoint == True:
        print("Todos os pontos anatômicos presentes!")

        CursorToSelectedObj("S point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoS"
        bpy.context.object.location[0] = 0

        CursorToSelectedObj("N point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoN"
        bpy.context.object.location[0] = 0

        CursorToSelectedObjs("Go left", "Go left")
        Cursor_Gonios = bpy.context.scene.cursor.location
        print(Cursor_Gonios)

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "Gonios"
        bpy.context.object.location[0] = 0

        CursorToSelectedObj("Gn point")
        Cursor_Gn = bpy.context.scene.cursor.location


        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoGn"
        bpy.context.object.location[0] = 0


        def line_intersection(line1, line2):
            xdiff = (line1[0][0] - line1[1][0], line2[0][0] - line2[1][0])
            ydiff = (line1[0][1] - line1[1][1], line2[0][1] - line2[1][1])

            def det(a, b):
                return a[0] * b[1] - a[1] * b[0]

            div = det(xdiff, ydiff)
            if div == 0:
               raise Exception('As linhas tê intersecção!')

            d = (det(*line1), det(*line2))
            x = det(d, xdiff) / div
            y = det(d, ydiff) / div
            return x, y

        PontoS = bpy.data.objects['PontoS']
        PontoN = bpy.data.objects['PontoN']
        Gonios = bpy.data.objects['Gonios']
        PontoGn = bpy.data.objects['PontoGn']

        Linha1 = [(PontoS.location[1], PontoS.location[2]), (PontoN.location[1], PontoN.location[2])]
        Linha2 = [(Gonios.location[1], Gonios.location[2]), (PontoGn.location[1],PontoGn.location[2])]

        EncontroYZ = line_intersection(Linha1, Linha2)

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "ProjSNGoGn"
        bpy.context.object.location[0] = 0
        bpy.context.object.location[1] = EncontroYZ[0]
        bpy.context.object.location[2] = EncontroYZ[1]


        AnguloSNGoGn = CalculaAngulo("PontoN", "ProjSNGoGn", "PontoGn")

        bpy.types.Scene.angulo_sngogn = bpy.props.StringProperty \
            (
                name = "SNGoGn Angle",
                description = "SNGoGn Angle",
                default = str(AnguloSNGoGn)
            )

        ApagarObjeto("PontoS")
        ApagarObjeto("PontoN")
        ApagarObjeto("Gonios")
        ApagarObjeto("PontoGn")
        ApagarObjeto("ProjSNGoGn")

        context.scene.cursor.location = CursorInicial

        if objInicial != None:
            bpy.ops.object.select_all(action='DESELECT')
            objInicial.select_set(True)
            context.view_layer.objects.active = objInicial

        return str(AnguloSNGoGn)

    else:
        bpy.types.Scene.angulo_sngogn = bpy.props.StringProperty \
            (
                name = "SNGoGn Angle",
                description = "SNGoGn Angle",
                default = "NONE"
            )
        print("Falta algum ponto anatômico (SNGoGn)!")

def CalculaPlanoMaxilaClassicoDef():

    FoundT3 = 'Tooth 3' in bpy.data.objects
    FoundT14 = 'Tooth 14' in bpy.data.objects
    FoundT8 = 'Tooth 8' in bpy.data.objects
    FoundT9 = 'Tooth 9' in bpy.data.objects

    context = bpy.context
    objInicial = context.object

    CursorInicial = []

    for i in bpy.context.scene.cursor.location:
        CursorInicial.append(i)


    if FoundT3 == True and FoundT14 == True and FoundT8 == True and FoundT9 == True:
        print("Todos os pontos anatômicos presentes!")

        CursorToSelectedObjs("Tooth 14", "Tooth 3")
        Cursor_1626 = bpy.context.scene.cursor.location
        print(Cursor_1626)

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "1626"

        CursorToSelectedObjs("Tooth 9", "Tooth 8")
        Cursor_1121 = bpy.context.scene.cursor.location
        print(Cursor_1121)

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "1121"

        #PosicaoX = bpy.data.objects["1121"].location[0]
        #PosicaoY = bpy.data.objects["1626"].location[1]
        #PosicaoZ = bpy.data.objects["1121"].location[2]

        PosicaoX = bpy.data.objects["1121"].location[0]
        PosicaoY = bpy.data.objects["1121"].location[1]
        PosicaoZ = bpy.data.objects["1626"].location[2]

        print(PosicaoX)
        print(PosicaoY)
        print(PosicaoZ)

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1, location=(PosicaoX, PosicaoY, PosicaoZ))
        bpy.context.object.name = "Inter_1626_1121"

        bpy.data.objects["1121"].location[0] = 0
        bpy.data.objects["1626"].location[0] = 0
        bpy.data.objects["Inter_1626_1121"].location[0] = 0

        AnguloOcluMaxClass = CalculaAngulo("1121", "1626", "Inter_1626_1121")

        bpy.types.Scene.plano_oclusal_maxila_classico = bpy.props.StringProperty \
            (
                name = "Maxillary Occlusal Angle",
                description = "Classic Max. Occl. Plane",
                default = str(AnguloOcluMaxClass)
            )

        ApagarObjeto("1121")
        ApagarObjeto("1626")
        ApagarObjeto("Inter_1626_1121")

        context.scene.cursor.location = CursorInicial

        if objInicial != None:
            bpy.ops.object.select_all(action='DESELECT')
            objInicial.select_set(True)
            context.view_layer.objects.active = objInicial

        return str(AnguloOcluMaxClass)

    else:
        print("Falta algum ponto anatômico dos dentes!")


def CalculaPlanoMandibularDef():

    FoundGoleft = 'Go left' in bpy.data.objects
    FoundGoright = 'Go right' in bpy.data.objects
    FoundMepoint = 'Me point' in bpy.data.objects

    context = bpy.context
    objInicial = context.object

    CursorInicial = []

    for i in bpy.context.scene.cursor.location:
        CursorInicial.append(i)


    if FoundGoleft == True and FoundGoright == True and FoundMepoint == True:
        print("Todos os pontos anatômicos presentes!")

        CursorToSelectedObjs("Go left", "Go left")
        Cursor_Gonios = bpy.context.scene.cursor.location
        print(Cursor_Gonios)

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "Gonios"

        CursorToSelectedObj("Me point")
        Cursor_Mepoint = bpy.context.scene.cursor.location
        print(Cursor_Mepoint)

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "Mepoint"


        PosicaoX = bpy.data.objects["Gonios"].location[0]
        PosicaoY = bpy.data.objects["Mepoint"].location[1]
        PosicaoZ = bpy.data.objects["Gonios"].location[2]

        print(PosicaoX)
        print(PosicaoY)
        print(PosicaoZ)

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1, location=(PosicaoX, PosicaoY, PosicaoZ))
        bpy.context.object.name = "Inter_Gonios_Me"

        bpy.data.objects["Gonios"].location[0] = 0
        bpy.data.objects["Mepoint"].location[0] = 0
        bpy.data.objects["Inter_Gonios_Me"].location[0] = 0

        AnguloOcluMandUsp = CalculaAngulo("Inter_Gonios_Me", "Gonios", "Mepoint")

        bpy.types.Scene.plano_mandibula_usp = bpy.props.StringProperty \
            (
                name = "Mandibular Plane",
                description = "Mandibular Plane",
                default = str(AnguloOcluMandUsp)
            )

        ApagarObjeto("Gonios")
        ApagarObjeto("Mepoint")
        ApagarObjeto("Inter_Gonios_Me")

        context.scene.cursor.location = CursorInicial

        if objInicial != None:
            bpy.ops.object.select_all(action='DESELECT')
            objInicial.select_set(True)
            context.view_layer.objects.active = objInicial

        return str(AnguloOcluMandUsp)

    else:
        print("Falta algum ponto anatômico na mandíbula!")

def CalculaANBDef():

    FoundA = 'A point' in bpy.data.objects
    FoundN = 'N point' in bpy.data.objects
    FoundB = 'B point' in bpy.data.objects

    context = bpy.context
    objInicial = context.object

    CursorInicial = []

    for i in bpy.context.scene.cursor.location:
        CursorInicial.append(i)

    if FoundA == True and FoundN == True and FoundB == True:
        print("SNA - Todos os pontos anatômicos presentes!")

        CursorToSelectedObj("A point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoA"
        bpy.context.object.location[0] = 0


        CursorToSelectedObj("N point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoN"
        bpy.context.object.location[0] = 0


        CursorToSelectedObj("B point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoB"
        bpy.context.object.location[0] = 0

        bpy.data.objects["PontoA"].location[0] = 0
        bpy.data.objects["PontoN"].location[0] = 0
        bpy.data.objects["PontoB"].location[0] = 0

        AnguloANB = CalculaAngulo("PontoA", "PontoN", "PontoB")
        print("Ângulo ANB:", AnguloANB)

        bpy.types.Scene.angulo_anb = bpy.props.StringProperty \
            (
                name = "ANB Angle",
                description = "ANB Angle",
                default = str(AnguloANB)
            )

        ApagarObjeto("PontoA")
        ApagarObjeto("PontoN")
        ApagarObjeto("PontoB")

        context.scene.cursor.location = CursorInicial

        if objInicial != None:
            bpy.ops.object.select_all(action='DESELECT')
            objInicial.select_set(True)
            context.view_layer.objects.active = objInicial

        return str(AnguloANB)

    else:
        bpy.types.Scene.angulo_anb = bpy.props.StringProperty \
            (
                name = "ANB Angle",
                description = "ANB Angle",
                default = "NONE"
            )
        print("Falta algum ponto anatômico (ANB)!")

def CalculaSNADef():

    FoundS = 'S point' in bpy.data.objects
    FoundN = 'N point' in bpy.data.objects
    FoundA = 'A point' in bpy.data.objects

    context = bpy.context
    objInicial = context.object

    CursorInicial = []

    for i in bpy.context.scene.cursor.location:
        CursorInicial.append(i)


    if FoundS == True and FoundN == True and FoundA == True:
        print("SNA - Todos os pontos anatômicos presentes!")

        CursorToSelectedObj("S point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoS"
        bpy.context.object.location[0] = 0


        CursorToSelectedObj("N point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoN"
        bpy.context.object.location[0] = 0


        CursorToSelectedObj("A point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoA"
        bpy.context.object.location[0] = 0

        bpy.data.objects["PontoS"].location[0] = 0
        bpy.data.objects["PontoN"].location[0] = 0
        bpy.data.objects["PontoA"].location[0] = 0

        AnguloSNA = CalculaAngulo("PontoS", "PontoN", "PontoA")
        print("Ângulo SNA:", AnguloSNA)

        bpy.types.Scene.angulo_sna = bpy.props.StringProperty \
            (
                name = "SNA Angle",
                description = "SNA Angle",
                default = str(AnguloSNA)
            )

        ApagarObjeto("PontoS")
        ApagarObjeto("PontoN")
        ApagarObjeto("PontoA")

        context.scene.cursor.location = CursorInicial

        if objInicial != None:
            bpy.ops.object.select_all(action='DESELECT')
            objInicial.select_set(True)
            context.view_layer.objects.active = objInicial


        return str(AnguloSNA)

    else:
        bpy.types.Scene.angulo_sna = bpy.props.StringProperty \
            (
                name = "SNA Angle",
                description = "SNA Angle",
                default = "NONE"
            )
        print("Falta algum ponto anatômico (SNA)!")


def CalculaSNBDef():

    FoundS = 'S point' in bpy.data.objects
    FoundN = 'N point' in bpy.data.objects
    FoundB = 'B point' in bpy.data.objects

    context = bpy.context
    objInicial = context.object

    CursorInicial = []

    for i in bpy.context.scene.cursor.location:
        CursorInicial.append(i)


    if FoundS == True and FoundN == True and FoundB == True:
        print("SNB - Todos os pontos anatômicos presentes!")

        CursorToSelectedObj("S point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoS"
        bpy.context.object.location[0] = 0


        CursorToSelectedObj("N point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoN"
        bpy.context.object.location[0] = 0


        CursorToSelectedObj("B point")
        Cursor_S = bpy.context.scene.cursor.location

        bpy.ops.mesh.primitive_uv_sphere_add(radius=1)
        bpy.context.object.name = "PontoB"
        bpy.context.object.location[0] = 0

        bpy.data.objects["PontoS"].location[0] = 0
        bpy.data.objects["PontoN"].location[0] = 0
        bpy.data.objects["PontoB"].location[0] = 0

        AnguloSNB = CalculaAngulo("PontoS", "PontoN", "PontoB")
        print("Ângulo SNB:", AnguloSNB)

        bpy.types.Scene.angulo_snb = bpy.props.StringProperty \
            (
                name = "SNB Angle",
                description = "SNB Angle",
                default = str(AnguloSNB)
            )

        ApagarObjeto("PontoS")
        ApagarObjeto("PontoN")
        ApagarObjeto("PontoB")

        context.scene.cursor.location = CursorInicial

        if objInicial != None:
            bpy.ops.object.select_all(action='DESELECT')
            objInicial.select_set(True)
            context.view_layer.objects.active = objInicial

        return str(AnguloSNB)

    else:
        bpy.types.Scene.angulo_snb = bpy.props.StringProperty \
            (
                name = "SNB Angle",
                description = "SNB Angle",
                default = "NONE"
            )
        print("Falta algum ponto anatômico (SNB)!")


class CalculaPlanoMaxilaClassico(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.calcula_plano_oclusal_classico"
    bl_label = "Calc. Max. Occl. Plane Classic"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        CalculaPlanoMaxilaClassicoDef()
        return {'FINISHED'}

bpy.utils.register_class(CalculaPlanoMaxilaClassico)


def CalculaAnguloOclusao():
    found_U6_Oc = 'U6 Occlusal' in bpy.data.objects
    found_U1_Tp = 'U1 Tip' in bpy.data.objects

    context = bpy.context
    objInicial = context.object

    CursorInicial = []

    for i in bpy.context.scene.cursor.location:
        CursorInicial.append(i)


    if found_U6_Oc == True and found_U1_Tp == True:
        print("U6 Occlusal e U1 Tip presentes!")

        PT_U6_Oc = bpy.data.objects['U6 Occlusal']

        PT_U1_Tp = bpy.data.objects['U1 Tip']

        Distancia1 = math.sqrt( (PT_U6_Oc.location[1] - PT_U1_Tp.location[1])**2 + (PT_U6_Oc.location[2] - PT_U1_Tp.location[2])**2 )

        print("Distancia1:", Distancia1)

        Distancia2= ( math.sqrt( (PT_U1_Tp.location[1] - PT_U6_Oc.location[1])**2 + ((PT_U1_Tp.location[2]-Distancia1) - PT_U6_Oc.location[2])**2 ) )/2

        print("Distancia2:", Distancia2)

        CosLinOc = (Distancia2 / Distancia1)

        Grau1 = float(round(math.degrees(math.acos(CosLinOc)),2))

        GrauOclusao = 180 - (Grau1*2)

        print(GrauOclusao)

        bpy.types.Scene.plano_oclusal_maxila = bpy.props.StringProperty \
        (
            name = "Maxillary Occlusal Plane",
            description = "Maxillary Occlusal Plane",
            default = str(GrauOclusao)+"º"
        )

        context.scene.cursor.location = CursorInicial

        if objInicial != None:
            bpy.ops.object.select_all(action='DESELECT')
            objInicial.select_set(True)
            context.view_layer.objects.active = objInicial

        return str(GrauOclusao)+"º"

    else:
        print("Veja se os pontos U6 Occlusal e U1 Tip foram adicionados corretamente.")




def CalculaAnguloNasolabial():
    found_Columella = 'Columella' in bpy.data.objects
    found_Subnasale = 'Subnasale' in bpy.data.objects
    found_UpperLip = 'Upper Lip' in bpy.data.objects


    if found_Columella == True and found_Subnasale == True and found_UpperLip == True:
        print("Columella, Subnasale e Upper Lip presentes!")

        # Copia os 3

        Objetos = [bpy.data.objects['Columella'], bpy.data.objects['Subnasale'], bpy.data.objects['Upper Lip']]

        for item in Objetos:

            bpy.ops.object.select_all(action='DESELECT')
            item.select_set(True)
            bpy.context.view_layer.objects.active = item
            bpy.ops.object.duplicate_move()
            bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')




        # Calcula

        Columella = bpy.data.objects['Columella.001']
        Subnasale = bpy.data.objects['Subnasale.001']
        UpperLip = bpy.data.objects['Upper Lip.001']

        SC = math.sqrt( (Columella.location[1] - Subnasale.location[1])**2 + (Columella.location[2] - Subnasale.location[2])**2 )
        print("SC", SC)

        SU = math.sqrt( (UpperLip.location[1] - Subnasale.location[1])**2 + (UpperLip.location[2] - Subnasale.location[2])**2 )
        print("SU", SU)

        UC = math.sqrt( (UpperLip.location[1] - Columella.location[1])**2 + (UpperLip.location[2] - Columella.location[2])**2 )
        print("UC", UC)

        GrauNasolabial = (SC**2 + SU**2 - UC**2) / (2 * SC * SU)

        AnguloNasolabial = float(round(math.degrees(math.acos(GrauNasolabial)),2))

        print("Ângulo Nasolabial:", AnguloNasolabial)

        bpy.types.Scene.angulo_nasolabial = bpy.props.StringProperty \
        (
            name = "Nasolabial Angle",
            description = "Nasolabial Angle",
            default = str(AnguloNasolabial)+"º"
        )

        # Apaga objetos

        bpy.ops.object.select_all(action='DESELECT')

        ObjetosCopias = [bpy.data.objects['Columella.001'], bpy.data.objects['Subnasale.001'], bpy.data.objects['Upper Lip.001']]

        for item in ObjetosCopias:

            bpy.ops.object.select_all(action='DESELECT')
            item.select_set(True)
            bpy.ops.object.delete(use_global=False)


        return str(AnguloNasolabial)+"º"

def CalculaAnguloGbSnPog():
    found_ST_Glabella = 'ST Glabella' in bpy.data.objects
    found_Subnasale = 'Subnasale' in bpy.data.objects
    found_ST_Pogonion = 'ST Pogonion' in bpy.data.objects


    if found_ST_Glabella == True and found_Subnasale == True and found_ST_Pogonion == True:
        print("ST Glabella, Subnasale e ST Pogonion presentes!")

        AnguloBase = GeraAnguloViewX('Subnasale', 'ST Glabella', 'ST Pogonion')

        Gn = bpy.data.objects['ST Glabella']
        Pog = bpy.data.objects['ST Pogonion']
        Sn = bpy.data.objects['Subnasale']

        # Acha posição do Y no meio entre Gn e Pog'
        PosicaoMeioY = (Gn.location[1] + Pog.location[1])/2
        print("PosicaoMeioY", PosicaoMeioY)

        if PosicaoMeioY > Sn.location[1]:
            print("Maior! Valor:", AnguloBase)

            bpy.types.Scene.angulo_GbSnPog = bpy.props.StringProperty \
            (
                name = "Gb', Sn, Pog' Angle",
                description = "Gb', Sn, Pog' Angle",
                default = str(AnguloBase)+"º"
            )

        if PosicaoMeioY < Sn.location[1]:
            print("Menor", 360 - AnguloBase)

            bpy.types.Scene.angulo_GbSnPog = bpy.props.StringProperty \
            (
                name = "Gb', Sn, Pog' Angle",
                description = "Gb', Sn, Pog' Angle",
                default = str(360 - AnguloBase)+"º"
            )

        if PosicaoMeioY == Sn.location[1]:
            print("Igual", 180)

            bpy.types.Scene.angulo_GbSnPog = bpy.props.StringProperty \
            (
                name = "Gb', Sn, Pog' Angle",
                description = "Gb', Sn, Pog' Angle",
                default = '180º'
            )

def GeraAnguloViewX(Obj1, Obj2, Obj3):

    A = bpy.data.objects[Obj1]
    B = bpy.data.objects[Obj2]
    C = bpy.data.objects[Obj3]

    AB = math.sqrt( (B.location[1] - A.location[1])**2 + (B.location[2] - A.location[2])**2 )
    print("AB", AB)

    AC = math.sqrt( (C.location[1] - A.location[1])**2 + (C.location[2] - A.location[2])**2 )
    print("AC", AC)

    BC = math.sqrt( (C.location[1] - B.location[1])**2 + (C.location[2] - B.location[2])**2 )
    print("BC", BC)

    AnguloCos = (AB**2 + AC**2 - BC**2) / (2 * AB * AC)

    AnguloGraus = float(round(math.degrees(math.acos(AnguloCos)),2))
    print("Ângulo em graus:", AnguloGraus)

    return AnguloGraus

#GeraAnguloViewX("U1 Tip", "U1 Root", "U6 Occlusal")

#GeraAnguloViewX("L1 Tip", "L1 Root", "L6 Occlusal")

#GeraAnguloViewX("Subnasale", "ST Glabella", "ST Pogonion")

# G' SN POG'

def DistanciaDupla(ObjDir, ObjEsq, ObjBase, Eixo):

    found_ObjDir = str(ObjDir) in bpy.data.objects
    found_ObjEsq = str(ObjEsq) in bpy.data.objects
    found_ObjBase = str(ObjBase) in bpy.data.objects

    if found_ObjDir == True and found_ObjEsq == True and found_ObjBase == True:



        def ApagaTudo():

            bpy.ops.object.select_all(action='DESELECT')
            ObjetosCopias = [Direita , Esquerda, Base]

            for item in ObjetosCopias:
                bpy.ops.object.select_all(action='DESELECT')
                item.select_set(True)
                bpy.context.view_layer.objects.active = item
                bpy.ops.object.delete(use_global=False)


        # Copia os 3

        Objetos = [bpy.data.objects[ObjDir], bpy.data.objects[ObjEsq], bpy.data.objects[ObjBase]]


        for item in Objetos:

            bpy.ops.object.select_all(action='DESELECT')
            item.select_set(True)
            bpy.ops.object.duplicate_move()
            bpy.context.view_layer.objects.active = item # Se não tiver dá erro!
            bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')


        Direita = bpy.data.objects[ObjDir+'.001']
        Esquerda = bpy.data.objects[ObjEsq+'.001']
        Base = bpy.data.objects[ObjBase+'.001']



        PontoCentral = ( Direita.location[Eixo] + Esquerda.location[Eixo] ) / 2

        Distancia = abs( PontoCentral - Base.location[Eixo] )


        # Calcula Posicao
        if PontoCentral > Base.location[Eixo]:
            DistanciaFinal = Distancia * -1
            print("DistanciaFinal", DistanciaFinal)
            print("")
            ApagaTudo()

            return DistanciaFinal

        if PontoCentral < Base.location[Eixo]:
            DistanciaFinal = Distancia
            print("DistanciaFinal", DistanciaFinal)
            print("")
            ApagaTudo()

            return DistanciaFinal

        if PontoCentral == Base.location[Eixo]:
            DistanciaFinal = Distancia
            print("DistanciaFinal", DistanciaFinal)
            print("")
            ApagaTudo()

            return DistanciaFinal


    else:
        print( "Não calculou. Algum objeto faltante:", ObjDir,",", ObjEsq, ",", ObjBase)


def DistanciaUnica(ObjDist, ObjBase, Eixo):

    found_ObjDist = str(ObjDist) in bpy.data.objects
    found_ObjBase = str(ObjBase) in bpy.data.objects

    if found_ObjDist == True and found_ObjBase == True:


        def ApagaTudo():

            bpy.ops.object.select_all(action='DESELECT')

            for item in ObjetosCopias:
                bpy.ops.object.select_all(action='DESELECT')
                item.select_set(True)
                bpy.context.view_layer.objects.active = item
                bpy.ops.object.delete(use_global=False)


        # Copia os 2

        Objetos = [bpy.data.objects[ObjDist], bpy.data.objects[ObjBase]]

        MedidasEixo = []
        ObjetosCopias = []

        for item in Objetos:
            print("OBJETO", item)
            bpy.ops.object.select_all(action='DESELECT')
            item.select_set(True)
            bpy.context.view_layer.objects.active = item
            bpy.ops.object.duplicate_move()

            print("CAMADONA")
            bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')

            ObjetoAtual = bpy.context.selected_objects[0]
            MedidaAtual = ObjetoAtual.location[Eixo]

            MedidasEixo.append(MedidaAtual)
            ObjetosCopias.append(ObjetoAtual)

        Distancia = abs( MedidasEixo[0] - MedidasEixo[1] )


        # Calcula Posicao
        if MedidasEixo[1] < MedidasEixo[0]:
            DistanciaFinal = Distancia * -1
            print("DistanciaFinal", DistanciaFinal)
            print("")
            ApagaTudo()

            return DistanciaFinal

        if MedidasEixo[1] > MedidasEixo[0]:
            DistanciaFinal = Distancia
            print("DistanciaFinal", DistanciaFinal)
            print("")
            ApagaTudo()

            return DistanciaFinal

        if MedidasEixo[1] == MedidasEixo[0]:
            DistanciaFinal = Distancia
            print("DistanciaFinal", DistanciaFinal)
            print("")
            ApagaTudo()

            return DistanciaFinal


    else:
        print( "Não calculou. Algum objeto faltante:", ObjDist,",", ObjBase)



def CalculaTudoCefalometriaDef(self, context):

    CalculaAnguloOclusao()
    CalculaAnguloNasolabial()
    CalculaAnguloGbSnPog()


    try:
        glabella_tvl = str(float(round(DistanciaUnica("ST Glabella", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_glabella_tvl = bpy.props.StringProperty \
            (
                name = "Glabella - TVL",
                description = "Glabella - TVL",
                default = glabella_tvl
            )
    except:
        print("Algum ponto faltante!")



    try:
        rima_or_tvl = str(float(round(DistanciaDupla("OR right", "OR left", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_rima_or_tvl = bpy.props.StringProperty \
            (
                name = "OR' - TVL",
                description = "OR' - TVL",
                default = rima_or_tvl
            )
    except:
        print("Algum ponto faltante!")


    try:
        rima_or_tvl = str(float(round(DistanciaDupla("Cheekbone right", "Cheekbone left", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_cheekbone_tvl = bpy.props.StringProperty \
            (
                name = "Cheekbone - TVL",
                description = "Cheekbone - TVL",
                default = rima_or_tvl
            )
    except:
        print("Algum ponto faltante!")


    try:
        subpupilar_tvl = str(float(round(DistanciaDupla("Subpupil right", "Subpupil left", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_subpupil_tvl = bpy.props.StringProperty \
            (
                name = "Subpupil - TVL",
                description = "Subpupil - TVL",
                default = subpupilar_tvl
            )
    except:
        print("Algum ponto faltante!")

    '''
    try:
        proj_nasal_tvl = str(float(round(DistanciaDupla("Tip of Nose", "Tip of Nose", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_proj_nasal_tvl = bpy.props.StringProperty \
            (
                name = "Tip of Nose - TVL",
                description = "Tip of Nose - TVL",
                default = proj_nasal_tvl
            )
    except:
        print("Algum ponto faltante!")


    '''
    try:
        base_nasal_tvl = str(float(round(DistanciaDupla("AB right", "AB left", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_base_nasal_tvl = bpy.props.StringProperty \
            (
                name = "AB - TVL",
                description = "AB - TVL",
                default = base_nasal_tvl
            )
    except:
        print("Algum ponto faltante!")

    '''
    try:
        a_mole_tvl = str(float(round(DistanciaDupla("ST A point", "ST A point", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_a_mole_tvl = bpy.props.StringProperty \
            (
                name = "A' - TVL",
                description = "A' - TVL",
                default = a_mole_tvl
            )
    except:
        print("Algum ponto faltante!")


    try:
        labio_superior_tvl = str(float(round(DistanciaDupla("Upper Lip", "Upper Lip", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_labio_superior_tvl = bpy.props.StringProperty \
            (
                name = "Upper Lip - TVL",
                description = "Upper Lip - TVL",
                default = labio_superior_tvl
            )
    except:
        print("Algum ponto faltante!")


    try:
        l1_tvl = str(float(round(DistanciaDupla("L1 Tip", "L1 Tip", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_l1_tvl = bpy.props.StringProperty \
            (
                name = "L1 Tip - TVL",
                description = "L1 Tip - TVL",
                default = l1_tvl
            )
    except:
        print("Algum ponto faltante!")


    try:
        u1_tvl = str(float(round(DistanciaDupla("U1 Tip", "U1 Tip", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_u1_tvl = bpy.props.StringProperty \
            (
                name = "U1 Tip - TVL",
                description = "U1 Tip - TVL",
                default = u1_tvl
            )
    except:
        print("Algum ponto faltante!")


    try:
        labio_inferior_tvl = str(float(round(DistanciaDupla("Lower Lip", "Lower Lip", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_labio_inferior_tvl = bpy.props.StringProperty \
            (
                name = "Lower Lip - TVL",
                description = "Lower Lip - TVL",
                default = labio_inferior_tvl
            )
    except:
        print("Algum ponto faltante!")

    try:
        b_mole_tvl = str(float(round(DistanciaDupla("ST B point", "ST B point", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_b_mole_tvl = bpy.props.StringProperty \
            (
                name = "ST B point - TVL",
                description = "ST B point - TVL",
                default = b_mole_tvl
            )
    except:
        print("Algum ponto faltante!")


    try:
        pog_mole_tvl = str(float(round(DistanciaDupla("ST Pogonion", "ST Pogonion", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_pog_mole_tvl = bpy.props.StringProperty \
            (
                name = "ST Pogonion - TVL",
                description = "ST Pogonion - TVL",
                default = pog_mole_tvl
            )
    except:
        print("Algum ponto faltante!")


    try:
        pescoco_garganta_tvl = str(float(round(DistanciaDupla("Throat point", "Throat point", "Subnasale", 1),2)))+" mm"

        bpy.types.Scene.dist_pescoco_garganta_tvl = bpy.props.StringProperty \
            (
                name = "Throat point - TVL",
                description = "Throat point - TVL",
                default = pescoco_garganta_tvl
            )
    except:
        print("Algum ponto faltante!")

    '''

class CalculaTudoCefalometria(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.calcula_tudo_cefalo"
    bl_label = "Cephalometry cal all"

    def execute(self, context):
        CalculaTudoCefalometriaDef(self, context)
        return {'FINISHED'}

bpy.utils.register_class(CalculaTudoCefalometria)


def CalculaDistanciaObjetos(ObjA, ObjB):

    A = bpy.data.objects[ObjA]
    B = bpy.data.objects[ObjB]

    Distancia = math.sqrt(( (B.location[0] - A.location[0])**2 ) + ( (B.location[1] - A.location[1])**2 ) + ( (B.location[2] - A.location[2])**2 ))

    print("A distância entre '"+ObjA+"' e '"+ObjB+"' é de", round(Distancia, 2))

    return round(Distancia, 2)


================================================
FILE: CompareOnBlender.py
================================================
import bpy
#import platform

from .CompareTools import *

class FORENSIC_PT_PontosFace17(bpy.types.Panel):
    bl_label = "Compare 17 Points"
    bl_region_type = 'UI'
    bl_space_type = 'VIEW_3D'
    bl_options = {'DEFAULT_CLOSED'}
    bl_category = "Compare"

    def draw(self, context):
        layout = self.layout

        context = bpy.context
        obj = context.object
        scn = context.scene

        row = layout.row()
        row.label(text="Digital Points:")

        row = layout.row()
        linha=row.operator("object.pronasale_digi_pt", text="1 - Pronasale")

        row = layout.row()
        linha=row.operator("object.exocanthus_alar_base_right_digi_pt", text="2 - Exocanthus-Alar Base right")

        row = layout.row()
        linha=row.operator("object.cheek_right_digi_pt", text="3 - Cheek right")

        row = layout.row()
        linha=row.operator("object.alar_base_right_digi_pt", text="4 - Alar Base right")

        row = layout.row()
        linha=row.operator("object.subnasale_digi_pt", text="5 - Subnasale")

        row = layout.row()
        linha=row.operator("object.alar_base_left_digi_pt", text="6 - Alar Base left")

        row = layout.row()
        linha=row.operator("object.cheek_left_digi_pt", text="7 - Cheek left")

        row = layout.row()
        linha=row.operator("object.exocanthus_alar_base_left_digi_pt", text="8 - Exocanthus-Alar Base left")

        row = layout.row()
        linha=row.operator("object.cheilion_alar_base_right_digi_pt", text="9 - Cheilion-Alar Base right")

        row = layout.row()
        linha=row.operator("object.cupids_bow_right_digi_pt", text="10 - Cupid's Bow right")

        row = layout.row()
        linha=row.operator("object.cupids_bow_left_digi_pt", text="11 - Cupid's Bow left")

        row = layout.row()
        linha=row.operator("object.cheilion_alar_base_left_digi_pt", text="12 - Cheilion-Alar Base left")


        row = layout.row()
        linha=row.operator("object.cheilion_right_digi_pt", text="13 - Cheilion right")

        row = layout.row()
        linha=row.operator("object.cheilion_left_digi_pt", text="14 - Cheilion left")

        row = layout.row()
        linha=row.operator("object.lower_lip_digi_pt", text="15 - Lower Lip")

        row = layout.row()
        linha=row.operator("object.b_point_soft_digi_pt", text="16 - B point soft")

        row = layout.row()
        linha=row.operator("object.pogonion_soft_digi_pt", text="17 - Pogonion soft")


        row = layout.row()
        row = layout.row()
        row.label(text="Real Points:")

        row = layout.row()
        linha=row.operator("object.pronasale_real_pt", text="1 - Pronasale")

        row = layout.row()
        linha=row.operator("object.exocanthus_alar_base_right_real_pt", text="2 - Exocanthus-Alar Base right")

        row = layout.row()
        linha=row.operator("object.cheek_right_real_pt", text="3 - Cheek right")

        row = layout.row()
        linha=row.operator("object.alar_base_right_real_pt", text="4 - Alar Base right")

        row = layout.row()
        linha=row.operator("object.subnasale_real_pt", text="5 - Subnasale")

        row = layout.row()
        linha=row.operator("object.alar_base_left_real_pt", text="6 - Alar Base left")

        row = layout.row()
        linha=row.operator("object.cheek_left_real_pt", text="7 - Cheek left")

        row = layout.row()
        linha=row.operator("object.exocanthus_alar_base_left_real_pt", text="8 - Exocanthus-Alar Base left")

        row = layout.row()
        linha=row.operator("object.cheilion_alar_base_right_real_pt", text="9 - Cheilion-Alar Base right")

        row = layout.row()
        linha=row.operator("object.cupids_bow_right_real_pt", text="10 - Cupid's Bow right")

        row = layout.row()
        linha=row.operator("object.cupids_bow_left_real_pt", text="11 - Cupid's Bow left")

        row = layout.row()
        linha=row.operator("object.cheilion_alar_base_left_real_pt", text="12 - Cheilion-Alar Base left")

        row = layout.row()
        linha=row.operator("object.cheilion_right_real_pt", text="13 - Cheilion right")

        row = layout.row()
        linha=row.operator("object.cheilion_left_real_pt", text="14 - Cheilion left")

        row = layout.row()
        linha=row.operator("object.lower_lip_real_pt", text="15 - Lower Lip")

        row = layout.row()
        linha=row.operator("object.b_point_soft_real_pt", text="16 - B point soft")

        row = layout.row()
        linha=row.operator("object.pogonion_soft_real_pt", text="17 - Pogonion soft")

        row = layout.row()
        row = layout.row()
        row.label(text="Distances Report:")

        row = layout.row()
        linha=row.operator("object.calcula_distancias_compare", text="Calc All Distances!", icon="PREFERENCES")

bpy.utils.register_class(FORENSIC_PT_PontosFace17)


================================================
FILE: CompareTools.py
================================================
import bpy
from .Cefalometria import *
from .GeraRelatorio import *
from .PontosAnatomicos import *
from .FerrMedidas import *
from .FerrImgTomo import * # Importa tratamento de materiais
from math import sqrt
import csv
import bmesh
from mathutils import Matrix, Vector
from time import gmtime, strftime

# PONTOS ANATOMICOS

class  Pronasale_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.pronasale_digi_pt"
    bl_label = " Pronasale digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Pronasale digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Pronasale digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Pronasale_digi_pt)

class  Exocanthus_Alar_Base_right_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.exocanthus_alar_base_right_digi_pt"
    bl_label = "Exocanthus-Alar Base right digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Exocanthus-Alar Base right digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Exocanthus-Alar Base right digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Exocanthus_Alar_Base_right_digi_pt)

class  Exocanthus_Alar_Base_left_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.exocanthus_alar_base_left_digi_pt"
    bl_label = "Exocanthus-Alar Base left digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Exocanthus-Alar Base left digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Exocanthus-Alar Base left digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Exocanthus_Alar_Base_left_digi_pt)

class  Cheek_right_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.cheek_right_digi_pt"
    bl_label = "Cheek right digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Cheek right digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Cheek right digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Cheek_right_digi_pt)

class  Cheek_left_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.cheek_left_digi_pt"
    bl_label = "Cheek left digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Cheek left digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Cheek left digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Cheek_left_digi_pt)

class  Alar_Base_right_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.alar_base_right_digi_pt"
    bl_label = "Alar Base right digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Alar Base right digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Alar Base right digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Alar_Base_right_digi_pt)

class  Alar_Base_left_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.alar_base_left_digi_pt"
    bl_label = "Alar Base left digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Alar Base left digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Alar Base left digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Alar_Base_left_digi_pt)

class  Subnasale_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.subnasale_digi_pt"
    bl_label = "Subnasale digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Subnasale digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Subnasale digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class( Subnasale_digi_pt)

class  Cheilion_Alar_Base_right_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.cheilion_alar_base_right_digi_pt"
    bl_label = "Cheilion-Alar Base right digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Cheilion-Alar Base right digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Cheilion-Alar Base right digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Cheilion_Alar_Base_right_digi_pt)

class  Cheilion_Alar_Base_left_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.cheilion_alar_base_left_digi_pt"
    bl_label = "Cheilion-Alar Base left digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Cheilion-Alar Base left digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Cheilion-Alar Base left digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Cheilion_Alar_Base_left_digi_pt)

class  Cupids_Bow_right_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.cupids_bow_right_digi_pt"
    bl_label = "Cupid's Bow right digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Cupid\'s Bow right digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Cupid\'s Bow right digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Cupids_Bow_right_digi_pt)

class  Cupids_Bow_left_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.cupids_bow_left_digi_pt"
    bl_label = "Cupid's Bow left digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Cupid\'s Bow left digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Cupid\'s Bow left digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Cupids_Bow_left_digi_pt)

class  Cheilion_right_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.cheilion_right_digi_pt"
    bl_label = "Cheilion right digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Cheilion right digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Cheilion right digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Cheilion_right_digi_pt)

class  Cheilion_left_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.cheilion_left_digi_pt"
    bl_label = "Cheilion left digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Cheilion left digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Cheilion left digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Cheilion_left_digi_pt)

class Lower_Lip_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.lower_lip_digi_pt"
    bl_label = "Lower Lip digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Lower Lip digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Lower Lip digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Lower_Lip_digi_pt)

class B_point_soft_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.b_point_soft_digi_pt"
    bl_label = "B point soft digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'B point soft digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('B point soft digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(B_point_soft_digi_pt)

class Pogonion_soft_digi_pt(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.pogonion_soft_digi_pt"
    bl_label = "Pogonion soft digi"
    bl_options = {'REGISTER', 'UNDO'}

    @classmethod
    def poll(cls, context):

        found = 'Pogonion soft digi' in bpy.data.objects

        if found == False:
            return True
        else:
            if found == True:
                return False

    def execute(self, context):
        CriaPontoDef('Pogonion soft digi', 'Anatomical Points - Digital')
        TestaPontoCollDef()
        return {'FINISHED'}

bpy.utils.register_class(Pogonion_soft_digi_pt)

# Real

class  Pronasale_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.pronasale_real_pt"
   bl_label = " Pronasale real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Pronasale real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Pronasale real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Pronasale_real_pt)

class  Exocanthus_Alar_Base_right_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.exocanthus_alar_base_right_real_pt"
   bl_label = "Exocanthus-Alar Base right real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Exocanthus-Alar Base right real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Exocanthus-Alar Base right real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Exocanthus_Alar_Base_right_real_pt)

class  Exocanthus_Alar_Base_left_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.exocanthus_alar_base_left_real_pt"
   bl_label = "Exocanthus-Alar Base left real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Exocanthus-Alar Base left real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Exocanthus-Alar Base left real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Exocanthus_Alar_Base_left_real_pt)

class  Cheek_right_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.cheek_right_real_pt"
   bl_label = "Cheek right real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Cheek right real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Cheek right real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Cheek_right_real_pt)

class  Cheek_left_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.cheek_left_real_pt"
   bl_label = "Cheek left real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Cheek left real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Cheek left real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Cheek_left_real_pt)

class  Alar_Base_right_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.alar_base_right_real_pt"
   bl_label = "Alar Base right real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Alar Base right real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Alar Base right real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Alar_Base_right_real_pt)

class  Alar_Base_left_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.alar_base_left_real_pt"
   bl_label = "Alar Base left real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Alar Base left real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Alar Base left real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Alar_Base_left_real_pt)

class  Subnasale_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.subnasale_real_pt"
   bl_label = "Subnasale real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Subnasale real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Subnasale real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class( Subnasale_real_pt)

class  Cheilion_Alar_Base_right_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.cheilion_alar_base_right_real_pt"
   bl_label = "Cheilion-Alar Base right real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Cheilion-Alar Base right real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Cheilion-Alar Base right real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Cheilion_Alar_Base_right_real_pt)

class  Cheilion_Alar_Base_left_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.cheilion_alar_base_left_real_pt"
   bl_label = "Cheilion-Alar Base left real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Cheilion-Alar Base left real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Cheilion-Alar Base left real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Cheilion_Alar_Base_left_real_pt)

class  Cupids_Bow_right_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.cupids_bow_right_real_pt"
   bl_label = "Cupid's Bow right real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Cupid\'s Bow right real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Cupid\'s Bow right real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Cupids_Bow_right_real_pt)

class  Cupids_Bow_left_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.cupids_bow_left_real_pt"
   bl_label = "Cupid's Bow left real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Cupid\'s Bow left real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Cupid\'s Bow left real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Cupids_Bow_left_real_pt)

class  Cheilion_right_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.cheilion_right_real_pt"
   bl_label = "Cheilion right real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Cheilion right real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Cheilion right real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Cheilion_right_real_pt)

class  Cheilion_left_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.cheilion_left_real_pt"
   bl_label = "Cheilion left real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Cheilion left real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Cheilion left real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Cheilion_left_real_pt)

class Lower_Lip_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.lower_lip_real_pt"
   bl_label = "Lower Lip real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Lower Lip real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Lower Lip real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Lower_Lip_real_pt)

class B_point_soft_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.b_point_soft_real_pt"
   bl_label = "B point soft real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'B point soft real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('B point soft real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(B_point_soft_real_pt)

class Pogonion_soft_real_pt(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.pogonion_soft_real_pt"
   bl_label = "Pogonion soft real"
   bl_options = {'REGISTER', 'UNDO'}

   @classmethod
   def poll(cls, context):

       found = 'Pogonion soft real' in bpy.data.objects

       if found == False:
           return True
       else:
           if found == True:
               return False

   def execute(self, context):
       CriaPontoDef('Pogonion soft real', 'Anatomical Points - Real')
       TestaPontoCollDef()
       return {'FINISHED'}

bpy.utils.register_class(Pogonion_soft_real_pt)

def GeraPlanilha():

    tmpdir = tempfile.mkdtemp()

    ListaApagar = []

    with open(tmpdir+'/Report_CompareOnBlender.csv', mode='w') as centroid_file:
        report_writer = csv.writer(centroid_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)

        report_writer.writerow(['CompareOnBlender'])
        report_writer.writerow([''])
        report_writer.writerow(['Point Number', 'Point Name', 'Distance'])
        report_writer.writerow([''])
        report_writer.writerow(['1', 'Pronasale (Pn)', CalculaDistanciaObjetos("Pronasale digi", "Pronasale real")])
        report_writer.writerow(['2', 'Rigth Exocanthus-Alar Base (Rt.Exo-Al)', CalculaDistanciaObjetos("Exocanthus-Alar Base right digi", "Exocanthus-Alar Base right real")])
        report_writer.writerow(['3', 'Rigth Cheek (Rt.Ck)', CalculaDistanciaObjetos("Cheek right digi", "Cheek right real")])
        report_writer.writerow(['4', 'Rigth Alar Base (Rt.Al)', CalculaDistanciaObjetos("Alar Base right digi", "Alar Base right real")])
        report_writer.writerow(['5', 'Subnasale (Sn)', CalculaDistanciaObjetos("Subnasale digi", "Subnasale real")])
        report_writer.writerow(['6', 'Left Alar Base (Lt.Al)', CalculaDistanciaObjetos("Alar Base left digi", "Alar Base left real")])
        report_writer.writerow(['7', 'Left Cheek (Ir.Ck)', CalculaDistanciaObjetos("Cheek left digi", "Cheek left real")])
        report_writer.writerow(['8', 'Left Exocanthus-Alar Base (Lt.Exo-Al)', CalculaDistanciaObjetos("Exocanthus-Alar Base left digi", "Exocanthus-Alar Base left real")])
        report_writer.writerow(['9', 'Rigth Cheilion-Alar Base (Rt.Ch-Al)', CalculaDistanciaObjetos("Cheilion-Alar Base right digi", "Cheilion-Alar Base right real")])
        report_writer.writerow(['10', 'Rigth Cupid\'s Bow (Rt.Cu)', CalculaDistanciaObjetos("Cupid's Bow right digi", "Cupid's Bow right real")])
        report_writer.writerow(['11', 'Left Cupid\'s Bow (Lt.Cu)', CalculaDistanciaObjetos("Cupid's Bow left digi", "Cupid's Bow left real")])
        report_writer.writerow(['12', 'Left Cheilion-Alar Base (Lt.Ch-Al)', CalculaDistanciaObjetos("Cheilion-Alar Base left digi", "Cheilion-Alar Base left real")])
        report_writer.writerow(['13', 'Rigth Cheilion (Rt.Ch)', CalculaDistanciaObjetos("Cheilion right digi", "Cheilion right real")])
        report_writer.writerow(['14', 'Left Cheilion (Lt.Ch)', CalculaDistanciaObjetos("Cheilion left digi", "Cheilion left real")])
        report_writer.writerow(['15', 'Lower Lip (LL)', CalculaDistanciaObjetos("Lower Lip digi", "Lower Lip real")])
        report_writer.writerow(['16', 'Soft  Tissue B Point (B\')', CalculaDistanciaObjetos("B point soft digi", "B point soft real")])
        report_writer.writerow(['17', 'Soft Tissue Pogonion (Pog\')', CalculaDistanciaObjetos("Pogonion soft digi", "Pogonion soft real")])

        Media = (CalculaDistanciaObjetos("Pronasale digi", "Pronasale real") + CalculaDistanciaObjetos("Exocanthus-Alar Base right digi", "Exocanthus-Alar Base right real") + CalculaDistanciaObjetos("Cheek right digi", "Cheek right real") + CalculaDistanciaObjetos("Alar Base right digi", "Alar Base right real") + CalculaDistanciaObjetos("Subnasale digi", "Subnasale real") + CalculaDistanciaObjetos("Alar Base left digi", "Alar Base left real") + CalculaDistanciaObjetos("Cheek left digi", "Cheek left real") + CalculaDistanciaObjetos("Exocanthus-Alar Base left digi", "Exocanthus-Alar Base left real") + CalculaDistanciaObjetos("Cheilion-Alar Base right digi", "Cheilion-Alar Base right real") + CalculaDistanciaObjetos("Cupid's Bow right digi", "Cupid's Bow right real") + CalculaDistanciaObjetos("Cupid's Bow left digi", "Cupid's Bow left real") + CalculaDistanciaObjetos("Cheilion-Alar Base left digi", "Cheilion-Alar Base left real") + CalculaDistanciaObjetos("Cheilion right digi", "Cheilion right real") + CalculaDistanciaObjetos("Cheilion left digi", "Cheilion left real") + CalculaDistanciaObjetos("Lower Lip digi", "Lower Lip real") + CalculaDistanciaObjetos("B point soft digi", "B point soft real") + CalculaDistanciaObjetos("Pogonion soft digi", "Pogonion soft real"))/17

        report_writer.writerow([''])

        report_writer.writerow(['', 'AVERAGE', round(Media, 2)])

        if platform.system() == "Linux":
            abrir_diretorio(tmpdir)
            subprocess.Popen("libreoffice "+tmpdir+"/Report_CompareOnBlender.csv", shell=True)

        if platform.system() == "Windows":
            abrir_diretorio(tmpdir)
            subprocess.Popen('cd "C:/Program Files/LibreOffice/program/" & dir & soffice.bin '+tmpdir+"/Report_CompareOnBlender.csv", shell=True)

        if platform.system() == "Darwin":
            abrir_diretorio(tmpdir)
            subprocess.Popen('/Applications/LibreOffice.app/Contents/MacOS/soffice '+tmpdir+"/Report_CompareOnBlender.csv", shell=True)

class CalculaDistanciasCompare(bpy.types.Operator):
   """Tooltip"""
   bl_idname = "object.calcula_distancias_compare"
   bl_label = "Calc Distances on Compare"
   bl_options = {'REGISTER', 'UNDO'}

   def execute(self, context):
       GeraPlanilha()
       #CalculaDistanciaObjetos("Cheek left real","Cheek left digi")
       return {'FINISHED'}

bpy.utils.register_class(CalculaDistanciasCompare)


================================================
FILE: ConfOsteotomiaAuto.py
================================================
import bpy
import platform
import bmesh
from random import randint

from .FerrImgTomo import *

# MENSAGENS

def CriaMaterialOsteotomia(NomeMaterial, R, G, B):

    activeObject = bpy.context.active_object
    m = Material()
    m.make_material(NomeMaterial)

    diffuseBSDF = m.nodes['Principled BSDF']
    diffuseBSDF.inputs["Base Color"].default_value = [R, G, B, 1]
    materialOutput = m.nodes['Material Output']

    mixShader = m.makeNode('ShaderNodeMixShader', 'Mix Shader')
    m.dump_node(mixShader)
    mixShader.inputs['Fac'].default_value = 0.3

    mixShader2 = m.makeNode('ShaderNodeMixShader', 'Mix Shader 2')
    mixShader2.inputs['Fac'].default_value = 0.05

    sssShader = m.makeNode('ShaderNodeSubsurfaceScattering', 'Subsurface Scattering')
    sssShader.inputs[1].default_value = 60
    sssShader.inputs["Color"].default_value = [R, G, B, 1]

    glossyShader = m.makeNode('ShaderNodeBsdfGlossy', 'Glossy BSDF')
    glossyShader.inputs[1].default_value = .30

    m.link(diffuseBSDF, 'BSDF', mixShader, 2)
    m.link(sssShader, 'BSSRDF', mixShader, 1)
    m.link(glossyShader, 'BSDF', mixShader2, 2)
    m.link(mixShader, 'Shader', mixShader2, 1)
    m.link(mixShader2, 'Shader', materialOutput, 'Surface')

    bpy.ops.object.material_slot_remove()
    bpy.ops.object.material_slot_add()

    activeObject.active_material = bpy.data.materials[NomeMaterial]
    bpy.context.object.active_material.diffuse_color = (R, G, B, 1)


class MessageObjSelecionados(bpy.types.Operator):
    bl_idname = "object.dialog_operator_obj_selecionados"
    bl_label = "You have to select 6 objects!"

    def execute(self, context):
        message = ("You have to select 6 objects!")
        self.report({'INFO'}, message)
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self)

bpy.utils.register_class(MessageObjSelecionados)


# IMPORTA ARMATURE

def ImportaArmatureDef(self, context):

    context = bpy.context
    obj = context.active_object
    scn = context.scene

    if platform.system() == "Linux" or platform.system() == "Darwin":
        dirScript = bpy.utils.user_resource('SCRIPTS')

        blendfile = dirScript+"addons/OrtogOnBlender-master/objetos.blend"
        section   = "\\Object\\"
        object    = "Armature_Head"

    if platform.system() == "Windows":
        dirScript = 'C:/OrtogOnBlender/Blender280/2.80/scripts/'

        blendfile = dirScript+"addons/OrtogOnBlender-master/objetos.blend"
        section   = "\\Object\\"
        object    = "Armature_Head"

    filepath  = blendfile + section + object
    directory = blendfile + section
    filename  = object

    bpy.ops.wm.append(
        filepath=filepath,
        filename=filename,
        directory=directory)

 #   bpy.ops.wm.append(filename=filename, directory=directory)

    # APAGA OBJETOS EXCEDENTES

    bpy.ops.object.select_all(action='DESELECT')
    a = bpy.data.objects['Mandibula']
    b = bpy.data.objects['SETA_Corpo_M']
    c = bpy.data.objects['SETA_Maxila']
    d = bpy.data.objects['SETA_Mento']


    a.select_set(True)
    b.select_set(True)
    c.select_set(True)
    d.select_set(True)


    bpy.ops.object.delete(use_global=False)

class ImportaArmature(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.importa_armature"
    bl_label = "Importa estrutura de bones"

    def execute(self, context):
        ImportaArmatureDef(self, context)
        return {'FINISHED'}

# CONFIGURA CABEÇA

def ConfiguraCabecaDef(self, context):

    context = bpy.context
    obj = context.active_object
 #   scn = context.scene



    ob=bpy.data.objects["Armature_Head"]

    bpy.ops.object.mode_set(mode='EDIT')
    mesh=bmesh.from_edit_mesh(bpy.context.object.data)
    for v in mesh.verts:
        v.select_set(True)

    vg = obj.vertex_groups.new(name="ca")
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.object.vertex_group_assign()
    bpy.ops.object.mode_set(mode='OBJECT')

    # Material
    CriaMaterialOsteotomia("MaterialCabeca", 0.8, 0.75, 0.2)

    bpy.context.object.name = "ca"

    armatureHead = bpy.data.objects['Armature_Head']
    bpy.ops.object.select_all(action='DESELECT')
    armatureHead.hide_viewport=False
    armatureHead.select_set(True)
    bpy.context.view_layer.objects.active = armatureHead
    bpy.ops.object.posemode_toggle()
#    bpy.data.objects['ca'].select = True
#    bpy.data.objects['Armature_Head'].select = True
#    bpy.ops.object.parent_set(type='ARMATURE_NAME')

    bpy.ops.pose.select_all(action='DESELECT')
    o=bpy.context.object
    b=o.data.bones['ca']
    b.select=True
    o.data.bones.active=b

    bpy.ops.pose.constraint_add(type='CHILD_OF')
    bpy.context.object.pose.bones["ca"].constraints["Child Of"].target = bpy.data.objects["ca"]

    pbone = bpy.context.active_object.pose.bones["ca"] # Bone
    context_copy = bpy.context.copy()
    context_copy["constraint"] = pbone.constraints["Child Of"]
    bpy.ops.constraint.childof_set_inverse(context_copy, constraint="Child Of", owner='BONE')

    bpy.ops.object.posemode_toggle()
    armatureHead.hide_viewport=True


class ConfiguraCabeca(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.configura_cabeca"
    bl_label = "Configura Cabeça"

    def execute(self, context):
        ConfiguraCabecaDef(self, context)
        return {'FINISHED'}

# CONFIGURA MAXILA
def ConfiguraMaxilaDef(self, context):

    context = bpy.context
    obj = context.active_object
 #   scn = context.scene


    ob=bpy.data.objects["Armature_Head"]

    bpy.ops.object.mode_set(mode='EDIT')
    mesh=bmesh.from_edit_mesh(bpy.context.object.data)
    for v in mesh.verts:
        v.select = True

    vg = obj.vertex_groups.new(name="Maxila.GUIA")
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.object.vertex_group_assign()
    bpy.ops.object.mode_set(mode='OBJECT')

    CriaMaterialOsteotomia("MaterialMaxila", 0.8, 0.3, 0.2)

    bpy.context.object.name = "ma"

    armatureHead = bpy.data.objects['Armature_Head']
    bpy.ops.object.select_all(action='DESELECT')
    armatureHead.hide_viewport=False
    armatureHead.select_set(True)
    bpy.context.view_layer.objects.active = armatureHead
    bpy.ops.object.posemode_toggle()
#    bpy.data.objects['ma'].select = True
#    bpy.data.objects['Armature_Head'].select = True
#    bpy.ops.object.parent_set(type='ARMATURE_NAME')

    bpy.ops.pose.select_all(action='DESELECT')
    o=bpy.context.object
    b=o.data.bones['Maxila.GUIA']
    b.select=True
    o.data.bones.active=b

    bpy.ops.pose.constraint_add(type='CHILD_OF')
    bpy.context.object.pose.bones["Maxila.GUIA"].constraints["Child Of"].target = bpy.data.objects["ma"]

    pbone = bpy.context.active_object.pose.bones["Maxila.GUIA"] # Bone
    context_copy = bpy.context.copy()
    context_copy["constraint"] = pbone.constraints["Child Of"]
    bpy.ops.constraint.childof_set_inverse(context_copy, constraint="Child Of", owner='BONE')

    bpy.ops.object.posemode_toggle()
    armatureHead.hide_viewport=True

class ConfiguraMaxila(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.configura_maxila"
    bl_label = "Configura Maxila"

    def execute(self, context):
        ConfiguraMaxilaDef(self, context)
        return {'FINISHED'}

# CONFIGURA RAMO DIREITO
def ConfiguraRamoDirDef(self, context):

    context = bpy.context
    obj = context.active_object
 #   scn = context.scene


    ob=bpy.data.objects["Armature_Head"]

    bpy.ops.object.mode_set(mode='EDIT')
    mesh=bmesh.from_edit_mesh(bpy.context.object.data)
    for v in mesh.verts:
        v.select = True

    vg = obj.vertex_groups.new(name="rd")
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.object.vertex_group_assign()
    bpy.ops.object.mode_set(mode='OBJECT')

    CriaMaterialOsteotomia("MaterialRamoDir", 0.4, 0.3, 0.8)

    bpy.context.object.name = "rd"

    armatureHead = bpy.data.objects['Armature_Head']
    bpy.ops.object.select_all(action='DESELECT')
    armatureHead.hide_viewport=False
    armatureHead.select_set(True)
    bpy.context.view_layer.objects.active = armatureHead
    bpy.ops.object.posemode_toggle()
#    bpy.data.objects['rd'].select = True
#    bpy.data.objects['Armature_Head'].select = True
#    bpy.ops.object.parent_set(type='ARMATURE_NAME')

    bpy.ops.pose.select_all(action='DESELECT')
    o=bpy.context.object
    b=o.data.bones['rd']
    b.select=True
    o.data.bones.active=b

    bpy.ops.pose.constraint_add(type='CHILD_OF')
    bpy.context.object.pose.bones["rd"].constraints["Child Of"].target = bpy.data.objects["rd"]

    pbone = bpy.context.active_object.pose.bones["rd"] # Bone
    context_copy = bpy.context.copy()
    context_copy["constraint"] = pbone.constraints["Child Of"]
    bpy.ops.constraint.childof_set_inverse(context_copy, constraint="Child Of", owner='BONE')

    bpy.ops.object.posemode_toggle()
    armatureHead.hide_viewport=True

class ConfiguraRamoDir(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.configura_ramo_dir"
    bl_label = "Configura Ramo Direito"

    def execute(self, context):
        ConfiguraRamoDirDef(self, context)
        return {'FINISHED'}

# CONFIGURA RAMO ESQUERDO
def ConfiguraRamoEsqDef(self, context):

    context = bpy.context
    obj = context.active_object
 #   scn = context.scene


    ob=bpy.data.objects["Armature_Head"]

    bpy.ops.object.mode_set(mode='EDIT')
    mesh=bmesh.from_edit_mesh(bpy.context.object.data)
    for v in mesh.verts:
        v.select = True

    vg = obj.vertex_groups.new(name="re")
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.object.vertex_group_assign()
    bpy.ops.object.mode_set(mode='OBJECT')

    CriaMaterialOsteotomia("MaterialRamoEsq", 0.4, 0.3, 0.8)

    bpy.context.object.name = "re"

    armatureHead = bpy.data.objects['Armature_Head']
    bpy.ops.object.select_all(action='DESELECT')
    armatureHead.hide_viewport=False
    armatureHead.select_set(True)
    bpy.context.view_layer.objects.active = armatureHead
    bpy.ops.object.posemode_toggle()
#    bpy.data.objects['re'].select = True
#    bpy.data.objects['Armature_Head'].select = True
#    bpy.ops.object.parent_set(type='ARMATURE_NAME')

    bpy.ops.pose.select_all(action='DESELECT')
    o=bpy.context.object
    b=o.data.bones['re']
    b.select=True
    o.data.bones.active=b

    bpy.ops.pose.constraint_add(type='CHILD_OF')
    bpy.context.object.pose.bones["re"].constraints["Child Of"].target = bpy.data.objects["re"]

    pbone = bpy.context.active_object.pose.bones["re"] # Bone
    context_copy = bpy.context.copy()
    context_copy["constraint"] = pbone.constraints["Child Of"]
    bpy.ops.constraint.childof_set_inverse(context_copy, constraint="Child Of", owner='BONE')

    bpy.ops.object.posemode_toggle()
    armatureHead.hide_viewport=True

class ConfiguraRamoEsq(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.configura_ramo_esq"
    bl_label = "Configura Ramo Esquerdo"

    def execute(self, context):
        ConfiguraRamoEsqDef(self, context)
        return {'FINISHED'}

# CONFIGURA RAMO DA MANDÍBULA
def ConfiguraCorpoMandDef(self, context):

    context = bpy.context
    obj = context.active_object
 #   scn = context.scene


    ob=bpy.data.objects["Armature_Head"]

    bpy.ops.object.mode_set(mode='EDIT')
    mesh=bmesh.from_edit_mesh(bpy.context.object.data)
    for v in mesh.verts:
        v.select = True

    vg = obj.vertex_groups.new(name="Corpo_Mandibular.GUIA")
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.object.vertex_group_assign()
    bpy.ops.object.mode_set(mode='OBJECT')

    CriaMaterialOsteotomia("MaterialCorpoMand", 0.35, 0.8, 0.4)

    bpy.context.object.name = "cm"

    armatureHead = bpy.data.objects['Armature_Head']
    bpy.ops.object.select_all(action='DESELECT')
    armatureHead.hide_viewport=False
    armatureHead.select_set(True)
    bpy.context.view_layer.objects.active = armatureHead
    bpy.ops.object.posemode_toggle()

#    bpy.data.objects['cm'].select = True
#    bpy.data.objects['Armature_Head'].select = True
#    bpy.ops.object.parent_set(type='ARMATURE_NAME')

    bpy.ops.pose.select_all(action='DESELECT')
    o=bpy.context.object
    b=o.data.bones['Corpo_Mandibular.GUIA']
    b.select=True
    o.data.bones.active=b

    bpy.ops.pose.constraint_add(type='CHILD_OF')
    bpy.context.object.pose.bones["Corpo_Mandibular.GUIA"].constraints["Child Of"].target = bpy.data.objects["cm"]

    pbone = bpy.context.active_object.pose.bones["Corpo_Mandibular.GUIA"] # Bone
    context_copy = bpy.context.copy()
    context_copy["constraint"] = pbone.constraints["Child Of"]
    bpy.ops.constraint.childof_set_inverse(context_copy, constraint="Child Of", owner='BONE')


    bpy.ops.object.posemode_toggle()
    armatureHead.hide_viewport=True

class ConfiguraCorpoMand(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.configura_corpo_mand"
    bl_label = "Configura Mento"

    def execute(self, context):
        ConfiguraCorpoMandDef(self, context)
        return {'FINISHED'}

# CONFIGURA MENTO
def ConfiguraMentoDef(self, context):

    context = bpy.context
    obj = context.active_object
 #   scn = context.scene

    ob=bpy.data.objects["Armature_Head"]


    ob=bpy.data.objects["cm"]

    bpy.ops.object.mode_set(mode='EDIT')
    mesh=bmesh.from_edit_mesh(bpy.context.object.data)


    for v in mesh.verts:
        v.select = True

    vg = obj.vertex_groups.new(name="me")
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.object.vertex_group_assign()
    bpy.ops.object.mode_set(mode='OBJECT')

    CriaMaterialOsteotomia("MaterialMento", 0.4, 0.3, 0.8)

    bpy.context.object.name = "me"

    armatureHead = bpy.data.objects['Armature_Head']
    bpy.ops.object.select_all(action='DESELECT')
    armatureHead.hide_viewport=False
    armatureHead.select_set(True)
    bpy.context.view_layer.objects.active = armatureHead
    bpy.ops.object.posemode_toggle()

 #   bpy.data.objects['me'].select = True
 #   bpy.data.objects['Armature_Head'].select = True
 #   bpy.ops.object.parent_set(type='ARMATURE_NAME')

    bpy.ops.pose.select_all(action='DESELECT')
    o=bpy.context.object
    b=o.data.bones['me']
    b.select=True
    o.data.bones.active=b

    bpy.ops.pose.constraint_add(type='CHILD_OF')
    bpy.context.object.pose.bones["me"].constraints["Child Of"].target = bpy.data.objects["me"]

    pbone = bpy.context.active_object.pose.bones["me"] # Bone
    context_copy = bpy.context.copy()
    context_copy["constraint"] = pbone.constraints["Child Of"]
    bpy.ops.constraint.childof_set_inverse(context_copy, constraint="Child Of", owner='BONE')

    bpy.ops.object.posemode_toggle()
    armatureHead.hide_viewport=True

    a = bpy.data.objects['cm']
    b = bpy.data.objects['me']

    bpy.ops.object.select_all(action='DESELECT')
    a.select_set(True)
    b.select_set(True)
    bpy.context.view_layer.objects.active = a
    bpy.ops.object.parent_set()

class ConfiguraMento(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.configura_mento"
    bl_label = "Configura Mento"

    def execute(self, context):
        ConfiguraMentoDef(self, context)
        return {'FINISHED'}

# CONFIGURA OSTEO

def ConfOsteotomiaAutoDef(self, context):
    objetos_selecionados = [ o for o in bpy.context.selected_objects ]
#    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select ]

    objetos_visiveis = []

    for i in objetos_selecionados:
        if i.visible_get() == True:
            objetos_visiveis.append(i.name)

    if len(objetos_visiveis) == 6:

        Obj_Hor = []
        for i in objetos_selecionados:
            Obj_Hor.append(i.location[0])

        # Ramos da mandíbula
        MaxHor = max(Obj_Hor)
        IndexMax = [i for i, j in enumerate(Obj_Hor) if j == MaxHor]
        re = objetos_selecionados[int(IndexMax[0])]
        print(re)

        MinHor = min(Obj_Hor)
        IndexMin = [i for i, j in enumerate(Obj_Hor) if j == MinHor]
        rd = objetos_selecionados[int(IndexMin[0])]
        print(rd)

        print("Len antes: ",len(objetos_selecionados))
        objetos_selecionados.remove(re)
        objetos_selecionados.remove(rd)
        print("Len depois: ",len(objetos_selecionados))

        # Cabeça e mento
        Obj_Ver = []
        for i in objetos_selecionados:
            Obj_Ver.append(i.location[2])

        MaxVer = max(Obj_Ver)
        IndexMax = [i for i, j in enumerate(Obj_Ver) if j == MaxVer]
        ca = objetos_selecionados[int(IndexMax[0])]
        print(ca)

        MinVer = min(Obj_Ver)
        IndexMin = [i for i, j in enumerate(Obj_Ver) if j == MinVer]
        me = objetos_selecionados[int(IndexMin[0])]
        print(me)

        print("Len antes: ",len(objetos_selecionados))
        objetos_selecionados.remove(ca)
        objetos_selecionados.remove(me)
        print("Len depois: ",len(objetos_selecionados))


        # Maxila e corpo da mandíbula
        Obj_Ver = []
        for i in objetos_selecionados:
            Obj_Ver.append(i.location[2])

        MaxVer = max(Obj_Ver)
        IndexMax = [i for i, j in enumerate(Obj_Ver) if j == MaxVer]
        ma = objetos_selecionados[int(IndexMax[0])]
        print(ma)

        MinVer = min(Obj_Ver)
        IndexMin = [i for i, j in enumerate(Obj_Ver) if j == MinVer]
        cm = objetos_selecionados[int(IndexMin[0])]
        print(cm)

        # Configura osteotomias
        bpy.ops.object.importa_armature()

        ca.select_set(True)
        bpy.context.view_layer.objects.active = ca
        bpy.ops.object.configura_cabeca()
        bpy.ops.object.select_all(action='DESELECT')

        ma.select_set(True)
        bpy.context.view_layer.objects.active = ma
        bpy.ops.object.configura_maxila()
        bpy.ops.object.select_all(action='DESELECT')

        rd.select_set(True)
        bpy.context.view_layer.objects.active = rd
        bpy.ops.object.configura_ramo_dir()
        bpy.ops.object.select_all(action='DESELECT')

        re.select_set(True)
        bpy.context.view_layer.objects.active = re
        bpy.ops.object.configura_ramo_esq()
        bpy.ops.object.select_all(action='DESELECT')

        cm.select_set(True)
        bpy.context.view_layer.objects.active = cm
        bpy.ops.object.configura_corpo_mand()
        bpy.ops.object.select_all(action='DESELECT')

        me.select_set(True)
        bpy.context.view_layer.objects.active = me
        bpy.ops.object.configura_mento()
        bpy.ops.object.select_all(action='DESELECT')

        # Zera Deltas

        lista_osteo = ['ca','ma', 'cm', 'rd', 're', 'me']

        for i in lista_osteo:
            bpy.ops.object.select_all(action='DESELECT')
            bpy.data.objects[i].select_set(True)
            bpy.context.view_layer.objects.active = bpy.data.objects[i]
            # bpy.ops.object.transforms_to_deltas(mode='ALL') # Se zerar dá problema no collision futuro.
            bpy.ops.anim.ortog_loc_rot()
            bpy.ops.object.select_all(action='DESELECT')

        bpy.context.scene.frame_end = 100
        bpy.context.scene.frame_current = 100


    if len(objetos_visiveis) != 6:
        print("Selecione os 6 objetos!")
        bpy.ops.object.dialog_operator_obj_selecionados('INVOKE_DEFAULT')

class ConfOsteotomiaAuto(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.conf_osteo_auto"
    bl_label = "Configura osteotomias automaticamente"

    def execute(self, context):
       ConfOsteotomiaAutoDef(self, context)
       return {'FINISHED'}

# OSTEOTOMIA GERALAUTOMÁTICA

def OsteoMoleAutomaticaDef():

    context = bpy.context
    obj = context.active_object
    scn = context.scene

    #CRIA OS OSSOS
    # Lista tdos os objetos em um
    objetos_selecionados = [ o for o in bpy.context.scene.objects if o.select_set ]

    # Coloca o cursor na pocição do primeiro objeto

    #Adiciona e apaga em modo de edição
    bpy.ops.object.armature_add(radius=1, view_align=False, enter_editmode=False)
    bpy.ops.object.editmode_toggle()
    bpy.ops.armature.select_all(action='TOGGLE')
    bpy.ops.armature.select_all(action='TOGGLE')
    bpy.ops.armature.delete()

    for i in objetos_selecionados:
        if i.visible_get() == True:
            bpy.context.scene.cursor.location = (i.location)
            bpy.ops.armature.bone_primitive_add(name=i.name)

    bpy.ops.object.editmode_toggle()
    bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

    # Lista Objetos

    ob = bpy.context.object

    LisObjetos = []

    if ob.type == 'ARMATURE':
        armature = ob.data

        for bone in armature.bones:
	        print(bone.name)
	        LisObjetos.append(bone.name)

    print("FIM")
    print(LisObjetos)

    # Cria Material

    bpy.ops.object.select_all(action='DESELECT')

    for i in LisObjetos:
        activeObject = bpy.data.objects[i] #Set active object to variable
        mat = bpy.data.materials.new(name=i) #set new material to variable
        activeObject.data.materials.append(mat) #add the material to the object
    #    bpy.context.object.active_material.diffuse_color = (0.8, 0.35, 0.2) #change color
        activeObject.active_material.diffuse_color = (randint(20, 100)*.01, randint(20, 100)*.01, randint(20, 100)*.01, 1)

    #    bpy.context.object.name = "me"

    # Cria áreas de interesse

    Face = bpy.data.objects['FaceMesh']

    Face.hide_set(False)

    bpy.ops.object.select_all(action='DESELECT')

    Face.select_set(True)
    context.view_layer.objects.active = Face

    bpy.ops.object.mode_set(mode='EDIT')

    # Vertex Groups
    mesh=bmesh.from_edit_mesh(bpy.context.object.data)
    for v in mesh.verts:
        v.select = True

    for i in LisObjetos:
        Face.vertex_groups.new(name=i)
        scn.tool_settings.vertex_group_weight=0
        #bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.object.vertex_group_assign()

    # Vertex Proximtiy
    for i in LisObjetos:
        bpy.ops.object.modifier_add(type='VERTEX_WEIGHT_PROXIMITY')
        bpy.context.object.modifiers["VertexWeightProximity"].vertex_group = i
        bpy.context.object.modifiers["VertexWeightProximity"].target = bpy.data.objects[i]
        bpy.context.object.modifiers["VertexWeightProximity"].proximity_mode = 'GEOMETRY'
        bpy.context.object.modifiers["VertexWeightProximity"].min_dist = 60 #25
        bpy.context.object.modifiers["VertexWeightProximity"].max_dist = 12 #8
        bpy.context.object.modifiers["VertexWeightProximity"].falloff_type = 'SHARP'
        bpy.context.object.modifiers["VertexWeightProximity"].name = i
        bpy.context.object.modifiers[i].show_expanded = False

    # Converte em objeto
    bpy.ops.object.mode_set(mode='OBJECT')
    bpy.ops.object.convert(target='MESH')

    # Parenteia Armature

    ArmatureOssos = bpy.data.objects['Armature']

    ArmatureOssos.hide_set(False)

    bpy.ops.object.select_all(action='DESELECT')
    bpy.context.view_layer.objects.active = ArmatureOssos
    bpy.data.objects['FaceMesh'].select_set(True)
    ArmatureOssos.select_set(True)
    bpy.ops.object.parent_set(type='ARMATU
Download .txt
gitextract_2f2snxll/

├── AjustaTomo.py
├── AlinhaObjetos.py
├── AlinhaRedimensiona.py
├── AtualizaScript.py
├── BooleanaOsteo.py
├── CalculaPontos.py
├── Cefalometria.py
├── CompareOnBlender.py
├── CompareTools.py
├── ConfOsteotomiaAuto.py
├── CortaOssoFibula.py
├── CriaSplint.py
├── DesenhaGuia.py
├── DesenhaObjetos.py
├── DinamicaMole.py
├── FerrFisica.py
├── FerrImgTomo.py
├── FerrMalhas.py
├── FerrMedidas.py
├── FerrSegmentacao.py
├── ForensicObj.blend
├── ForensicOnBlender.py
├── ForensicTools.py
├── FotogrametriaMeshroom.py
├── FotogrametriaOpenMVG.py
├── FotogrametriaOpenMVGWinWSL.py
├── FotogrametriaSMVS.py
├── GeraModelosTomo.py
├── GeraRelatorio.py
├── ImportaObjMat.py
├── ListaArquivos.txt
├── MicrosGenerate3D.mlx
├── NomePaciente.py
├── OrtogMeshes.py
├── OtherOnBlender.py
├── Poisson.py
├── PontosAnatomicos.py
├── README.md
├── RelatorioAnimacao.py
├── RhinOnBlender.py
├── RhinOpenGL.py
├── RhinTools.py
├── SegmentaImagens.py
├── TomoReconsRapida.py
├── Version.py
├── __init__.py
└── objetos.blend
Download .txt
SYMBOL INDEX (1369 symbols across 41 files)

FILE: AjustaTomo.py
  function AjustaTomoDef (line 22) | def AjustaTomoDef(self, context):
  class AjustaTomo (line 414) | class AjustaTomo(bpy.types.Operator):
    method execute (line 420) | def execute(self, context):
  function abrir_diretorio (line 426) | def abrir_diretorio(path):
  function AbreTMPDef (line 434) | def AbreTMPDef(self, context):
  function CorrigeDicomDef (line 441) | def CorrigeDicomDef(self, context):
  class CorrigeDicom (line 521) | class CorrigeDicom(bpy.types.Operator):
    method execute (line 526) | def execute(self, context):

FILE: AlinhaObjetos.py
  class MessageSelecioneObjAlinhar (line 8) | class MessageSelecioneObjAlinhar(bpy.types.Operator):
    method execute (line 12) | def execute(self, context):
    method invoke (line 17) | def invoke(self, context, event):
  class MessageFaltaPontoObj (line 24) | class MessageFaltaPontoObj(bpy.types.Operator):
    method execute (line 28) | def execute(self, context):
    method invoke (line 33) | def invoke(self, context, event):
  class MessageFaltaPonto (line 40) | class MessageFaltaPonto(bpy.types.Operator):
    method execute (line 44) | def execute(self, context):
    method invoke (line 49) | def invoke(self, context, event):
  function EMP1aDef (line 57) | def EMP1aDef(self, context):
  class EMP1a (line 69) | class EMP1a(bpy.types.Operator):
    method poll (line 76) | def poll(cls, context):
    method execute (line 87) | def execute(self, context):
  function EMP2aDef (line 101) | def EMP2aDef(self, context):
  class EMP2a (line 113) | class EMP2a(bpy.types.Operator):
    method poll (line 120) | def poll(cls, context):
    method execute (line 131) | def execute(self, context):
  function EMP3aDef (line 145) | def EMP3aDef(self, context):
  class EMP3a (line 157) | class EMP3a(bpy.types.Operator):
    method poll (line 164) | def poll(cls, context):
    method execute (line 175) | def execute(self, context):
  function EMP1bDef (line 191) | def EMP1bDef(self, context):
  class EMP1b (line 203) | class EMP1b(bpy.types.Operator):
    method poll (line 210) | def poll(cls, context):
    method execute (line 221) | def execute(self, context):
  function EMP2bDef (line 235) | def EMP2bDef(self, context):
  class EMP2b (line 247) | class EMP2b(bpy.types.Operator):
    method poll (line 254) | def poll(cls, context):
    method execute (line 265) | def execute(self, context):
  function EMP3bDef (line 280) | def EMP3bDef(self, context):
  class EMP3b (line 292) | class EMP3b(bpy.types.Operator):
    method poll (line 299) | def poll(cls, context):
    method execute (line 310) | def execute(self, context):
  function AlinhaTresPontosDef (line 324) | def AlinhaTresPontosDef(self, context):
  class AlinhaTresPontos (line 604) | class AlinhaTresPontos(bpy.types.Operator):
    method poll (line 610) | def poll(cls, context):
    method execute (line 618) | def execute(self, context):
  function AlinhaCranioFrankfurtDef (line 623) | def AlinhaCranioFrankfurtDef():
  class AlinhaCranioFrankfurt (line 782) | class AlinhaCranioFrankfurt(bpy.types.Operator):
    method execute (line 787) | def execute(self, context):
  class OcultaMole (line 794) | class OcultaMole(bpy.types.Operator):
    method execute (line 800) | def execute(self, context):
  function PreparaMandibulaCmDef (line 806) | def PreparaMandibulaCmDef():
  class PreparaMandibulaCm (line 839) | class PreparaMandibulaCm(bpy.types.Operator):
    method poll (line 846) | def poll(cls, context):
    method execute (line 856) | def execute(self, context):
  function FinalizaMandibulaCmDef (line 863) | def FinalizaMandibulaCmDef():
  class FinalizaMandibulaCm (line 884) | class FinalizaMandibulaCm(bpy.types.Operator):
    method execute (line 890) | def execute(self, context):

FILE: AlinhaRedimensiona.py
  class MessageSelecioneObj (line 7) | class MessageSelecioneObj(bpy.types.Operator):
    method execute (line 11) | def execute(self, context):
    method invoke (line 16) | def invoke(self, context, event):
  class MessageColoqueValor (line 22) | class MessageColoqueValor(bpy.types.Operator):
    method execute (line 26) | def execute(self, context):
    method invoke (line 31) | def invoke(self, context, event):
  function CriaBaseOrigem (line 39) | def CriaBaseOrigem():
  function Redimensiona (line 53) | def Redimensiona(self, context):
  class AlinhaForcaBtn (line 134) | class AlinhaForcaBtn(bpy.types.Operator):
    method execute (line 139) | def execute(self, context):
  function ForceICPDef (line 181) | def ForceICPDef(self, context):
  class ForceICP (line 206) | class ForceICP(bpy.types.Operator):
    method poll (line 213) | def poll(cls, context):
    method execute (line 219) | def execute(self, context):

FILE: AtualizaScript.py
  function AtualizaScriptDef (line 6) | def AtualizaScriptDef(self, context):
  class AtualizaScript (line 52) | class AtualizaScript(bpy.types.Operator):
    method execute (line 57) | def execute(self, context):

FILE: BooleanaOsteo.py
  class MessageErroCollection (line 8) | class MessageErroCollection(bpy.types.Operator):
    method execute (line 12) | def execute(self, context):
    method invoke (line 17) | def invoke(self, context, event):
  function BooleanaMandDef (line 23) | def BooleanaMandDef(self, context):
  class BooleanaMand (line 168) | class BooleanaMand(bpy.types.Operator):
    method execute (line 173) | def execute(self, context):
  function BooleanaOsteoDef (line 177) | def BooleanaOsteoDef(self, context):
  class BooleanaOsteoClass (line 337) | class BooleanaOsteoClass(bpy.types.Operator):
    method execute (line 342) | def execute(self, context):
  function BooleanaOsteoGeralDef (line 348) | def BooleanaOsteoGeralDef(self, context):
  class BooleanaOsteoGeral (line 532) | class BooleanaOsteoGeral(bpy.types.Operator):
    method execute (line 537) | def execute(self, context):
  function BooleanaOsteoUnionDef (line 544) | def BooleanaOsteoUnionDef(self, context):
  class BooleanaOsteoUnion (line 732) | class BooleanaOsteoUnion(bpy.types.Operator):
    method execute (line 737) | def execute(self, context):
  function BooleanaOsteoInterDef (line 746) | def BooleanaOsteoInterDef(self, context):
  class BooleanaOsteoInter (line 941) | class BooleanaOsteoInter(bpy.types.Operator):
    method execute (line 946) | def execute(self, context):
  function BooleanaUnionSimplesDef (line 954) | def BooleanaUnionSimplesDef(self, context):
  class BooleanaUnionSimples (line 1136) | class BooleanaUnionSimples(bpy.types.Operator):
    method execute (line 1141) | def execute(self, context):
  function UnionMultiplaDef (line 1150) | def UnionMultiplaDef(self, context):
  class UnionMultipla (line 1189) | class UnionMultipla(bpy.types.Operator):
    method execute (line 1194) | def execute(self, context):

FILE: CalculaPontos.py
  function capturaINI (line 3) | def capturaINI(ObjSelecionado):
  function capturaFIN (line 13) | def capturaFIN(ObjSelecionado):
  function apagaObjeto (line 23) | def apagaObjeto(ObjSelecionado):
  function capturaINItodosDef (line 31) | def capturaINItodosDef():
  function capturaFINtodosDef (line 42) | def capturaFINtodosDef():
  function calculaDeslocamento (line 55) | def calculaDeslocamento(obj, obj1, obj2):
  function obj_pre (line 77) | def obj_pre(frame):
  function obj_pos (line 82) | def obj_pos(frame):
  function geraDeslocamentoTODOSDef (line 87) | def geraDeslocamentoTODOSDef(self, context):
  class geraDeslocamentoTODOS (line 216) | class geraDeslocamentoTODOS(bpy.types.Operator):
    method execute (line 221) | def execute(self, context):

FILE: Cefalometria.py
  function CursorToSelectedObj (line 5) | def CursorToSelectedObj(objeto):
  function CursorToSelectedObjs (line 24) | def CursorToSelectedObjs(objeto1, objeto2):
  function ApagarObjeto (line 44) | def ApagarObjeto(objeto):
  class CalculaTudoUSP (line 55) | class CalculaTudoUSP(bpy.types.Operator):
    method execute (line 61) | def execute(self, context):
  function CalculaSNGnDef (line 73) | def CalculaSNGnDef():
  function CalculaSNGoGnDef (line 149) | def CalculaSNGoGnDef():
  function CalculaPlanoMaxilaClassicoDef (line 266) | def CalculaPlanoMaxilaClassicoDef():
  function CalculaPlanoMandibularDef (line 344) | def CalculaPlanoMandibularDef():
  function CalculaANBDef (line 417) | def CalculaANBDef():
  function CalculaSNADef (line 493) | def CalculaSNADef():
  function CalculaSNBDef (line 572) | def CalculaSNBDef():
  class CalculaPlanoMaxilaClassico (line 650) | class CalculaPlanoMaxilaClassico(bpy.types.Operator):
    method execute (line 656) | def execute(self, context):
  function CalculaAnguloOclusao (line 663) | def CalculaAnguloOclusao():
  function CalculaAnguloNasolabial (line 721) | def CalculaAnguloNasolabial():
  function CalculaAnguloGbSnPog (line 788) | def CalculaAnguloGbSnPog():
  function GeraAnguloViewX (line 837) | def GeraAnguloViewX(Obj1, Obj2, Obj3):
  function DistanciaDupla (line 867) | def DistanciaDupla(ObjDir, ObjEsq, ObjBase, Eixo):
  function DistanciaUnica (line 944) | def DistanciaUnica(ObjDist, ObjBase, Eixo):
  function CalculaTudoCefalometriaDef (line 1020) | def CalculaTudoCefalometriaDef(self, context):
  class CalculaTudoCefalometria (line 1211) | class CalculaTudoCefalometria(bpy.types.Operator):
    method execute (line 1216) | def execute(self, context):
  function CalculaDistanciaObjetos (line 1223) | def CalculaDistanciaObjetos(ObjA, ObjB):

FILE: CompareOnBlender.py
  class FORENSIC_PT_PontosFace17 (line 6) | class FORENSIC_PT_PontosFace17(bpy.types.Panel):
    method draw (line 13) | def draw(self, context):

FILE: CompareTools.py
  class Pronasale_digi_pt (line 15) | class  Pronasale_digi_pt(bpy.types.Operator):
    method poll (line 22) | def poll(cls, context):
    method execute (line 32) | def execute(self, context):
  class Exocanthus_Alar_Base_right_digi_pt (line 39) | class  Exocanthus_Alar_Base_right_digi_pt(bpy.types.Operator):
    method poll (line 46) | def poll(cls, context):
    method execute (line 56) | def execute(self, context):
  class Exocanthus_Alar_Base_left_digi_pt (line 63) | class  Exocanthus_Alar_Base_left_digi_pt(bpy.types.Operator):
    method poll (line 70) | def poll(cls, context):
    method execute (line 80) | def execute(self, context):
  class Cheek_right_digi_pt (line 87) | class  Cheek_right_digi_pt(bpy.types.Operator):
    method poll (line 94) | def poll(cls, context):
    method execute (line 104) | def execute(self, context):
  class Cheek_left_digi_pt (line 111) | class  Cheek_left_digi_pt(bpy.types.Operator):
    method poll (line 118) | def poll(cls, context):
    method execute (line 128) | def execute(self, context):
  class Alar_Base_right_digi_pt (line 135) | class  Alar_Base_right_digi_pt(bpy.types.Operator):
    method poll (line 142) | def poll(cls, context):
    method execute (line 152) | def execute(self, context):
  class Alar_Base_left_digi_pt (line 159) | class  Alar_Base_left_digi_pt(bpy.types.Operator):
    method poll (line 166) | def poll(cls, context):
    method execute (line 176) | def execute(self, context):
  class Subnasale_digi_pt (line 183) | class  Subnasale_digi_pt(bpy.types.Operator):
    method poll (line 190) | def poll(cls, context):
    method execute (line 200) | def execute(self, context):
  class Cheilion_Alar_Base_right_digi_pt (line 207) | class  Cheilion_Alar_Base_right_digi_pt(bpy.types.Operator):
    method poll (line 214) | def poll(cls, context):
    method execute (line 224) | def execute(self, context):
  class Cheilion_Alar_Base_left_digi_pt (line 231) | class  Cheilion_Alar_Base_left_digi_pt(bpy.types.Operator):
    method poll (line 238) | def poll(cls, context):
    method execute (line 248) | def execute(self, context):
  class Cupids_Bow_right_digi_pt (line 255) | class  Cupids_Bow_right_digi_pt(bpy.types.Operator):
    method poll (line 262) | def poll(cls, context):
    method execute (line 272) | def execute(self, context):
  class Cupids_Bow_left_digi_pt (line 279) | class  Cupids_Bow_left_digi_pt(bpy.types.Operator):
    method poll (line 286) | def poll(cls, context):
    method execute (line 296) | def execute(self, context):
  class Cheilion_right_digi_pt (line 303) | class  Cheilion_right_digi_pt(bpy.types.Operator):
    method poll (line 310) | def poll(cls, context):
    method execute (line 320) | def execute(self, context):
  class Cheilion_left_digi_pt (line 327) | class  Cheilion_left_digi_pt(bpy.types.Operator):
    method poll (line 334) | def poll(cls, context):
    method execute (line 344) | def execute(self, context):
  class Lower_Lip_digi_pt (line 351) | class Lower_Lip_digi_pt(bpy.types.Operator):
    method poll (line 358) | def poll(cls, context):
    method execute (line 368) | def execute(self, context):
  class B_point_soft_digi_pt (line 375) | class B_point_soft_digi_pt(bpy.types.Operator):
    method poll (line 382) | def poll(cls, context):
    method execute (line 392) | def execute(self, context):
  class Pogonion_soft_digi_pt (line 399) | class Pogonion_soft_digi_pt(bpy.types.Operator):
    method poll (line 406) | def poll(cls, context):
    method execute (line 416) | def execute(self, context):
  class Pronasale_real_pt (line 425) | class  Pronasale_real_pt(bpy.types.Operator):
    method poll (line 432) | def poll(cls, context):
    method execute (line 442) | def execute(self, context):
  class Exocanthus_Alar_Base_right_real_pt (line 449) | class  Exocanthus_Alar_Base_right_real_pt(bpy.types.Operator):
    method poll (line 456) | def poll(cls, context):
    method execute (line 466) | def execute(self, context):
  class Exocanthus_Alar_Base_left_real_pt (line 473) | class  Exocanthus_Alar_Base_left_real_pt(bpy.types.Operator):
    method poll (line 480) | def poll(cls, context):
    method execute (line 490) | def execute(self, context):
  class Cheek_right_real_pt (line 497) | class  Cheek_right_real_pt(bpy.types.Operator):
    method poll (line 504) | def poll(cls, context):
    method execute (line 514) | def execute(self, context):
  class Cheek_left_real_pt (line 521) | class  Cheek_left_real_pt(bpy.types.Operator):
    method poll (line 528) | def poll(cls, context):
    method execute (line 538) | def execute(self, context):
  class Alar_Base_right_real_pt (line 545) | class  Alar_Base_right_real_pt(bpy.types.Operator):
    method poll (line 552) | def poll(cls, context):
    method execute (line 562) | def execute(self, context):
  class Alar_Base_left_real_pt (line 569) | class  Alar_Base_left_real_pt(bpy.types.Operator):
    method poll (line 576) | def poll(cls, context):
    method execute (line 586) | def execute(self, context):
  class Subnasale_real_pt (line 593) | class  Subnasale_real_pt(bpy.types.Operator):
    method poll (line 600) | def poll(cls, context):
    method execute (line 610) | def execute(self, context):
  class Cheilion_Alar_Base_right_real_pt (line 617) | class  Cheilion_Alar_Base_right_real_pt(bpy.types.Operator):
    method poll (line 624) | def poll(cls, context):
    method execute (line 634) | def execute(self, context):
  class Cheilion_Alar_Base_left_real_pt (line 641) | class  Cheilion_Alar_Base_left_real_pt(bpy.types.Operator):
    method poll (line 648) | def poll(cls, context):
    method execute (line 658) | def execute(self, context):
  class Cupids_Bow_right_real_pt (line 665) | class  Cupids_Bow_right_real_pt(bpy.types.Operator):
    method poll (line 672) | def poll(cls, context):
    method execute (line 682) | def execute(self, context):
  class Cupids_Bow_left_real_pt (line 689) | class  Cupids_Bow_left_real_pt(bpy.types.Operator):
    method poll (line 696) | def poll(cls, context):
    method execute (line 706) | def execute(self, context):
  class Cheilion_right_real_pt (line 713) | class  Cheilion_right_real_pt(bpy.types.Operator):
    method poll (line 720) | def poll(cls, context):
    method execute (line 730) | def execute(self, context):
  class Cheilion_left_real_pt (line 737) | class  Cheilion_left_real_pt(bpy.types.Operator):
    method poll (line 744) | def poll(cls, context):
    method execute (line 754) | def execute(self, context):
  class Lower_Lip_real_pt (line 761) | class Lower_Lip_real_pt(bpy.types.Operator):
    method poll (line 768) | def poll(cls, context):
    method execute (line 778) | def execute(self, context):
  class B_point_soft_real_pt (line 785) | class B_point_soft_real_pt(bpy.types.Operator):
    method poll (line 792) | def poll(cls, context):
    method execute (line 802) | def execute(self, context):
  class Pogonion_soft_real_pt (line 809) | class Pogonion_soft_real_pt(bpy.types.Operator):
    method poll (line 816) | def poll(cls, context):
    method execute (line 826) | def execute(self, context):
  function GeraPlanilha (line 833) | def GeraPlanilha():
  class CalculaDistanciasCompare (line 882) | class CalculaDistanciasCompare(bpy.types.Operator):
    method execute (line 888) | def execute(self, context):

FILE: ConfOsteotomiaAuto.py
  function CriaMaterialOsteotomia (line 10) | def CriaMaterialOsteotomia(NomeMaterial, R, G, B):
  class MessageObjSelecionados (line 47) | class MessageObjSelecionados(bpy.types.Operator):
    method execute (line 51) | def execute(self, context):
    method invoke (line 56) | def invoke(self, context, event):
  function ImportaArmatureDef (line 65) | def ImportaArmatureDef(self, context):
  class ImportaArmature (line 113) | class ImportaArmature(bpy.types.Operator):
    method execute (line 118) | def execute(self, context):
  function ConfiguraCabecaDef (line 124) | def ConfiguraCabecaDef(self, context):
  class ConfiguraCabeca (line 177) | class ConfiguraCabeca(bpy.types.Operator):
    method execute (line 182) | def execute(self, context):
  function ConfiguraMaxilaDef (line 187) | def ConfiguraMaxilaDef(self, context):
  class ConfiguraMaxila (line 237) | class ConfiguraMaxila(bpy.types.Operator):
    method execute (line 242) | def execute(self, context):
  function ConfiguraRamoDirDef (line 247) | def ConfiguraRamoDirDef(self, context):
  class ConfiguraRamoDir (line 297) | class ConfiguraRamoDir(bpy.types.Operator):
    method execute (line 302) | def execute(self, context):
  function ConfiguraRamoEsqDef (line 307) | def ConfiguraRamoEsqDef(self, context):
  class ConfiguraRamoEsq (line 357) | class ConfiguraRamoEsq(bpy.types.Operator):
    method execute (line 362) | def execute(self, context):
  function ConfiguraCorpoMandDef (line 367) | def ConfiguraCorpoMandDef(self, context):
  class ConfiguraCorpoMand (line 419) | class ConfiguraCorpoMand(bpy.types.Operator):
    method execute (line 424) | def execute(self, context):
  function ConfiguraMentoDef (line 429) | def ConfiguraMentoDef(self, context):
  class ConfiguraMento (line 493) | class ConfiguraMento(bpy.types.Operator):
    method execute (line 498) | def execute(self, context):
  function ConfOsteotomiaAutoDef (line 504) | def ConfOsteotomiaAutoDef(self, context):
  class ConfOsteotomiaAuto (line 625) | class ConfOsteotomiaAuto(bpy.types.Operator):
    method execute (line 630) | def execute(self, context):
  function OsteoMoleAutomaticaDef (line 636) | def OsteoMoleAutomaticaDef():
  class OsteoMoleAutomatica (line 778) | class OsteoMoleAutomatica(bpy.types.Operator):
    method execute (line 783) | def execute(self, context):
  function RenomearObjeto (line 789) | def RenomearObjeto(nome):
  class NomeFace (line 797) | class NomeFace(bpy.types.Operator):
    method poll (line 803) | def poll(cls, context):
    method execute (line 816) | def execute(self, context):

FILE: CortaOssoFibula.py
  class Cut_Point_pt (line 7) | class Cut_Point_pt(bpy.types.Operator):
    method execute (line 26) | def execute(self, context):
  function CriaCotaCut (line 35) | def CriaCotaCut(Objeto1, Objeto2):
  function AtribuiCotasCut (line 48) | def AtribuiCotasCut():
  class CriaCotasBotao (line 78) | class CriaCotasBotao(bpy.types.Operator):
    method execute (line 85) | def execute(self, context):
  function CriaBonesDef (line 93) | def CriaBonesDef():
  class CriaBones (line 135) | class CriaBones(bpy.types.Operator):
    method execute (line 142) | def execute(self, context):

FILE: CriaSplint.py
  function ImportaSplintDef (line 8) | def ImportaSplintDef(self, context):
  class ImportaSplint (line 60) | class ImportaSplint(bpy.types.Operator):
    method execute (line 66) | def execute(self, context):
  function CriaSplintDef (line 74) | def CriaSplintDef(self, context):
  class CriaSplint (line 298) | class CriaSplint(bpy.types.Operator):
    method poll (line 305) | def poll(cls, context):
    method execute (line 315) | def execute(self, context):
  function DuplicaMaxMandDef (line 346) | def DuplicaMaxMandDef():
  class DuplicaMaxMand (line 378) | class DuplicaMaxMand(bpy.types.Operator):
    method poll (line 385) | def poll(cls, context):
    method execute (line 395) | def execute(self, context):
  function VisualizaMaxMandDef (line 402) | def VisualizaMaxMandDef():
  class VisualizaMaxMand (line 417) | class VisualizaMaxMand(bpy.types.Operator):
    method execute (line 423) | def execute(self, context):
  class MessageNaoConstaSplintPronto (line 429) | class MessageNaoConstaSplintPronto(bpy.types.Operator):
    method execute (line 433) | def execute(self, context):
    method invoke (line 438) | def invoke(self, context, event):
  function BooleanSplintDef (line 444) | def BooleanSplintDef():
  class BooleanSplint (line 462) | class BooleanSplint(bpy.types.Operator):
    method poll (line 469) | def poll(cls, context):
    method execute (line 479) | def execute(self, context):
  function SplintMantemKeyStart (line 494) | def SplintMantemKeyStart(objeto, quadro):
  function SplintMantemKeyEnd (line 509) | def SplintMantemKeyEnd(objeto, quadro):
  function SplintMaxilaOrigiMandFinalDef (line 524) | def SplintMaxilaOrigiMandFinalDef():
  class SplintMaxilaOrigiMandFinal (line 558) | class SplintMaxilaOrigiMandFinal(bpy.types.Operator):
    method poll (line 565) | def poll(cls, context):
    method execute (line 575) | def execute(self, context):
  function SplintMandOrigiMaxilaFinalDef (line 582) | def SplintMandOrigiMaxilaFinalDef():
  class SplintMandOrigiMaxilaFinal (line 616) | class SplintMandOrigiMaxilaFinal(bpy.types.Operator):
    method poll (line 623) | def poll(cls, context):
    method execute (line 633) | def execute(self, context):

FILE: DesenhaGuia.py
  function DesenhaGuiaDef (line 6) | def DesenhaGuiaDef(self, context):
  class DesenhaGuia (line 105) | class DesenhaGuia(bpy.types.Operator):
    method execute (line 110) | def execute(self, context):

FILE: DesenhaObjetos.py
  function DesenhaGuiaDef (line 18) | def DesenhaGuiaDef(self, context):
  function AcabamentoDef (line 84) | def AcabamentoDef(self, context):
  function FechaBuracoDef (line 129) | def FechaBuracoDef(self, context):
  function DesenhaLinhaCorteDef (line 137) | def DesenhaLinhaCorteDef(self, context):
  class DesenhaLinhaCorte (line 241) | class DesenhaLinhaCorte(bpy.types.Operator):
    method poll (line 250) | def poll(cls, context):
    method execute (line 263) | def execute(self, context):
  function DesenhaLinhaVertexDef (line 267) | def DesenhaLinhaVertexDef(self, context):
  class DesenhaLinhaVertex (line 331) | class DesenhaLinhaVertex(bpy.types.Operator):
    method poll (line 340) | def poll(cls, context):
    method execute (line 353) | def execute(self, context):
  function DesenhaLinhaVertexFinDef (line 357) | def DesenhaLinhaVertexFinDef(self, context):
  class DesenhaLinhaVertexFin (line 422) | class DesenhaLinhaVertexFin(bpy.types.Operator):
    method execute (line 427) | def execute(self, context):
  function LinhaCorteDef (line 431) | def LinhaCorteDef(self, context):
  class LinhaCorte (line 445) | class LinhaCorte(bpy.types.Operator):
    method poll (line 454) | def poll(cls, context):
    method execute (line 467) | def execute(self, context):
  function LinhaCorteForaaForaDef (line 471) | def LinhaCorteForaaForaDef(self, context):
  class LinhaCorteForaaFora (line 485) | class LinhaCorteForaaFora(bpy.types.Operator):
    method poll (line 494) | def poll(cls, context):
    method execute (line 507) | def execute(self, context):
  class ModalTimerOperator (line 515) | class ModalTimerOperator(bpy.types.Operator):
    method modal (line 522) | def modal(self, context, event):
    method execute (line 578) | def execute(self, context):
    method cancel (line 600) | def cancel(self, context):
    method end_ui (line 603) | def end_ui(self, context):
    method cleanup (line 607) | def cleanup(self, context, cleantype=''):
  function CriaLinhaPontosDef (line 619) | def CriaLinhaPontosDef(self, context):
  class CriaLinhaPontos (line 660) | class CriaLinhaPontos(Operator, AddObjectHelper):
    method execute (line 666) | def execute(self, context):
  function CriaPontoVeiaDef (line 678) | def CriaPontoVeiaDef():
  class CriaPontoVeia (line 715) | class CriaPontoVeia(Operator, AddObjectHelper):
    method execute (line 721) | def execute(self, context):
  function CriaBezierVeiaDef (line 732) | def CriaBezierVeiaDef(self, context):
  class CriaBezierVeia (line 812) | class CriaBezierVeia(Operator, AddObjectHelper):
    method execute (line 818) | def execute(self, context):
  function CriaBezierDef (line 829) | def CriaBezierDef(self, context):
  class CriaBezier (line 911) | class CriaBezier(Operator, AddObjectHelper):
    method execute (line 917) | def execute(self, context):
  function CriaBezierUnidoDef (line 925) | def CriaBezierUnidoDef(self, context):
  class CriaBezierUnido (line 1012) | class CriaBezierUnido(Operator, AddObjectHelper):
    method execute (line 1018) | def execute(self, context):
  function BezierCortaDef (line 1026) | def BezierCortaDef(self, context):
  class BezierCorta (line 1153) | class BezierCorta(Operator, AddObjectHelper):
    method execute (line 1159) | def execute(self, context):
  function BezierCortaDuplaDef (line 1167) | def BezierCortaDuplaDef(self, context):
  class BezierCortaDupla (line 1250) | class BezierCortaDupla(Operator, AddObjectHelper):
    method execute (line 1256) | def execute(self, context):
  class ModalTimerOperatorTeeth (line 1267) | class ModalTimerOperatorTeeth(bpy.types.Operator):
    method modal (line 1274) | def modal(self, context, event):
    method execute (line 1327) | def execute(self, context):
    method cancel (line 1336) | def cancel(self, context):
    method end_ui (line 1339) | def end_ui(self, context):
    method cleanup (line 1343) | def cleanup(self, context, cleantype=''):
  function CriaBezierUnidoTeethDef (line 1356) | def CriaBezierUnidoTeethDef(self, context):
  class CriaBezierUnidoTeeth (line 1463) | class CriaBezierUnidoTeeth(Operator, AddObjectHelper):
    method execute (line 1469) | def execute(self, context):
  function BezierCortaDuplaTeethDef (line 1477) | def BezierCortaDuplaTeethDef(self, context):
  class BezierCortaDuplaTeeth (line 1565) | class BezierCortaDuplaTeeth(Operator, AddObjectHelper):
    method execute (line 1571) | def execute(self, context):
  function PreparaMalhaCorteDef (line 1579) | def PreparaMalhaCorteDef(self, context):
  class PreparaMalhaCorte (line 1590) | class PreparaMalhaCorte(Operator, AddObjectHelper):
    method execute (line 1596) | def execute(self, context):
  function SeparaEdgeSplitDef (line 1629) | def SeparaEdgeSplitDef(self, context):
  class SeparaEdgeSplit (line 1652) | class SeparaEdgeSplit(Operator, AddObjectHelper):
    method execute (line 1658) | def execute(self, context):
  class ModalTimerOperatorMicros (line 1668) | class ModalTimerOperatorMicros(bpy.types.Operator):
    method modal (line 1675) | def modal(self, context, event):
    method execute (line 1731) | def execute(self, context):
    method cancel (line 1753) | def cancel(self, context):
    method end_ui (line 1756) | def end_ui(self, context):
    method cleanup (line 1760) | def cleanup(self, context, cleantype=''):

FILE: DinamicaMole.py
  function AreasInfluenciaDef (line 5) | def AreasInfluenciaDef(self, context):
  class AreasInfluencia (line 90) | class AreasInfluencia(bpy.types.Operator):
    method execute (line 95) | def execute(self, context):
  function CriaAreasDeformacaoDef (line 102) | def CriaAreasDeformacaoDef(self, context):
  class CriaAreasDeformacao (line 180) | class CriaAreasDeformacao(bpy.types.Operator):
    method execute (line 185) | def execute(self, context):
  function ConfiguraDinamicaMoleDef (line 191) | def ConfiguraDinamicaMoleDef(self, context):
  function CursorParaSelecao (line 227) | def CursorParaSelecao():
  function SelecaoParaCursor (line 239) | def SelecaoParaCursor():
  function SelectionaObjeto (line 251) | def SelectionaObjeto(Obj):
  function SelecionaOssos (line 259) | def SelecionaOssos(Armature, Bone):
  function CorrigeOssosArmature (line 275) | def CorrigeOssosArmature(Objeto, Armature, Osso):
  function GeraNarizDinamicaMole (line 283) | def GeraNarizDinamicaMole():
  function CorrigeDeformacaoOperacoesDef (line 558) | def CorrigeDeformacaoOperacoesDef(self, context):
  class ConfiguraDinamicaMole (line 597) | class ConfiguraDinamicaMole(bpy.types.Operator):
    method execute (line 602) | def execute(self, context):

FILE: FerrFisica.py
  function ColisaoArcosDef (line 4) | def ColisaoArcosDef():
  class ColisaoArcos (line 128) | class ColisaoArcos(bpy.types.Operator):
    method poll (line 135) | def poll(cls, context):
    method execute (line 143) | def execute(self, context):
  function ColisaoArcosInversoDef (line 151) | def ColisaoArcosInversoDef():
  class ColisaoArcosInverso (line 271) | class ColisaoArcosInverso(bpy.types.Operator):
    method poll (line 278) | def poll(cls, context):
    method execute (line 286) | def execute(self, context):
  function AplicaAnimCorDef (line 292) | def AplicaAnimCorDef():
  class AplicaAnimCor (line 313) | class AplicaAnimCor(bpy.types.Operator):
    method poll (line 320) | def poll(cls, context):
    method execute (line 328) | def execute(self, context):
  function TravaArcoDef (line 334) | def TravaArcoDef():
  class TravaArco (line 356) | class TravaArco(bpy.types.Operator):
    method poll (line 366) | def poll(cls, context):
    method execute (line 377) | def execute(self, context):
  function PreparaMaxilaMandibulaDef (line 385) | def PreparaMaxilaMandibulaDef():
  class PreparaMaxilaMandibula (line 423) | class PreparaMaxilaMandibula(bpy.types.Operator):
    method poll (line 430) | def poll(cls, context):
    method execute (line 437) | def execute(self, context):
  function FinalizaColisaoMaxMandDef (line 444) | def FinalizaColisaoMaxMandDef():
  class FinalizaColisaoMaxMand (line 485) | class FinalizaColisaoMaxMand(bpy.types.Operator):
    method execute (line 491) | def execute(self, context):

FILE: FerrImgTomo.py
  function ExtraiDadosTomo (line 14) | def ExtraiDadosTomo():
  function ConverteDCMparaPNG (line 156) | def ConverteDCMparaPNG():
  class Material (line 198) | class Material:
    method set_cycles (line 200) | def set_cycles(self):
    method make_material (line 205) | def make_material(self, name):
    method link (line 210) | def link(self, from_node, from_slot_name, to_node, to_slot_name):
    method makeNode (line 215) | def makeNode(self, type, name):
    method dump_node (line 222) | def dump_node(self, node):
    method new_row (line 229) | def new_row():
    method __init__ (line 233) | def __init__(self):
  function ImportaFatiasDef (line 239) | def ImportaFatiasDef():
  class ImportaFatias (line 565) | class ImportaFatias(bpy.types.Operator):
    method execute (line 571) | def execute(self, context):
  function ImportaFatiasSimplesDef (line 578) | def ImportaFatiasSimplesDef():
  class ImportaFatiasSimples (line 802) | class ImportaFatiasSimples(bpy.types.Operator):
    method execute (line 808) | def execute(self, context):
  function FatiasAxialSagitalCoronalDef (line 816) | def FatiasAxialSagitalCoronalDef():
  class FatiasAxialSagitalCoronal (line 967) | class FatiasAxialSagitalCoronal(bpy.types.Operator):
    method execute (line 973) | def execute(self, context):
  function ImportaSeqTomoDef (line 982) | def ImportaSeqTomoDef(self, context):
  class ImportaSeqTomo (line 1008) | class ImportaSeqTomo(bpy.types.Operator):
    method execute (line 1013) | def execute(self, context):
  function ExportaSeqTomoDef (line 1019) | def ExportaSeqTomoDef(self, context):
  class ExportaSeqTomo (line 1238) | class ExportaSeqTomo(bpy.types.Operator):
    method execute (line 1243) | def execute(self, context):
  function AbreSlicerDef (line 1252) | def AbreSlicerDef(self, context):
  class AbreSlicer (line 1283) | class AbreSlicer(bpy.types.Operator):
    method execute (line 1288) | def execute(self, context):
  function AbreSlicerMHADef (line 1295) | def AbreSlicerMHADef(self, context):
  class AbreSlicerMHA (line 1311) | class AbreSlicerMHA(bpy.types.Operator):
    method execute (line 1317) | def execute(self, context):
  function VoxelShaderDefaultDef (line 1324) | def VoxelShaderDefaultDef():
  class VoxelShaderDefault (line 1350) | class VoxelShaderDefault(bpy.types.Operator):
    method execute (line 1356) | def execute(self, context):
  function VoxelShaderOssoDef (line 1364) | def VoxelShaderOssoDef():
  class VoxelShaderOsso (line 1391) | class VoxelShaderOsso(bpy.types.Operator):
    method execute (line 1397) | def execute(self, context):
  function VoxelShaderPeleDef (line 1404) | def VoxelShaderPeleDef():
  class VoxelShaderPele (line 1428) | class VoxelShaderPele(bpy.types.Operator):
    method execute (line 1434) | def execute(self, context):
  function VoxelShaderMusculoDef (line 1441) | def VoxelShaderMusculoDef():
  class VoxelShaderMusculo (line 1465) | class VoxelShaderMusculo(bpy.types.Operator):
    method execute (line 1471) | def execute(self, context):

FILE: FerrMalhas.py
  function FechaMoldeSimplesDef (line 4) | def FechaMoldeSimplesDef(self, context):
  class FechaMoldeSimples (line 19) | class FechaMoldeSimples(bpy.types.Operator):
    method execute (line 24) | def execute(self, context):
  function ParenteiaObjetosDef (line 31) | def ParenteiaObjetosDef():
  class ParenteiaObjetos (line 43) | class ParenteiaObjetos(bpy.types.Operator):
    method execute (line 48) | def execute(self, context):
  function DesparenteiaObjetosDef (line 56) | def DesparenteiaObjetosDef():
  class DesparenteiaObjetos (line 62) | class DesparenteiaObjetos(bpy.types.Operator):
    method execute (line 67) | def execute(self, context):
  function CriaShapeKeysDef (line 74) | def CriaShapeKeysDef():
  class CriaShapeKeys (line 81) | class CriaShapeKeys(bpy.types.Operator):
    method execute (line 87) | def execute(self, context):
  class EntraEditModeLimpo (line 94) | class EntraEditModeLimpo(bpy.types.Operator):
    method execute (line 100) | def execute(self, context):
  function SelecionaObjeto (line 108) | def SelecionaObjeto(NomeObjeto):

FILE: FerrMedidas.py
  function CriaPontoMedidasDef (line 5) | def CriaPontoMedidasDef():
  class CriaPontoMedida (line 243) | class CriaPontoMedida(bpy.types.Operator):
    method poll (line 250) | def poll(cls, context):
    method execute (line 261) | def execute(self, context):
  function CalculaAngulo (line 268) | def CalculaAngulo(Obj1, Obj2, Obj3):
  function DistanciaObjetos (line 288) | def DistanciaObjetos(obj1, obj2):
  function MedidasVerDentesDef (line 301) | def MedidasVerDentesDef(self, context):
  function CriaMedidaHor (line 471) | def CriaMedidaHor(Obj1, Obj2):
  function MedidasHorDentesDef (line 501) | def MedidasHorDentesDef(self, context):
  class MedidasVerHorDentes (line 535) | class MedidasVerHorDentes(bpy.types.Operator):
    method execute (line 540) | def execute(self, context):
  function ApagaPontosCopiadosDef (line 549) | def ApagaPontosCopiadosDef():
  class ApagaPontosCopiados (line 558) | class ApagaPontosCopiados(bpy.types.Operator):
    method execute (line 563) | def execute(self, context):

FILE: FerrSegmentacao.py
  function CriaVoxelCubePlanosDef (line 15) | def CriaVoxelCubePlanosDef():
  class CriaVoxelCubePlanos (line 43) | class CriaVoxelCubePlanos(bpy.types.Operator):
    method execute (line 49) | def execute(self, context):
  function ImportaObjBlendDef (line 56) | def ImportaObjBlendDef(nome): #, colecao):
  class ImportaVoxelCube (line 136) | class ImportaVoxelCube(bpy.types.Operator):
    method poll (line 143) | def poll(cls, context):
    method execute (line 153) | def execute(self, context):
  function Converte3DparaVoxelDef (line 160) | def Converte3DparaVoxelDef():
  class Converte3DparaVoxel (line 241) | class Converte3DparaVoxel(bpy.types.Operator):
    method poll (line 248) | def poll(cls, context):
    method execute (line 258) | def execute(self, context):
  function ConverteImagensTomoDef (line 266) | def ConverteImagensTomoDef():
  class ConverteImagensTomo (line 344) | class ConverteImagensTomo(bpy.types.Operator):
    method execute (line 350) | def execute(self, context):
  function CalculaDimensaoDCMDef (line 358) | def CalculaDimensaoDCMDef():
  class CalculaDimensaoDCM (line 377) | class CalculaDimensaoDCM(bpy.types.Operator):
    method execute (line 383) | def execute(self, context):
  function ConverteVideoImagemDef (line 390) | def ConverteVideoImagemDef():
  class ConverteVideoImagem (line 414) | class ConverteVideoImagem(bpy.types.Operator):
    method execute (line 420) | def execute(self, context):
  function ConverteVideoImagemWINDef (line 427) | def ConverteVideoImagemWINDef():
  class ConverteVideoImagemWIN (line 448) | class ConverteVideoImagemWIN(bpy.types.Operator):
    method execute (line 454) | def execute(self, context):
  function SegmentaLinkedDef (line 462) | def SegmentaLinkedDef(self, context):
  class SegmentaLinked (line 573) | class SegmentaLinked(bpy.types.Operator):
    method execute (line 578) | def execute(self, context):
  function Weight1Def (line 584) | def Weight1Def(self, context):
  class Weight1 (line 590) | class Weight1(bpy.types.Operator):
    method execute (line 595) | def execute(self, context):
  function Weight0Def (line 599) | def Weight0Def(self, context):
  class Weight0 (line 605) | class Weight0(bpy.types.Operator):
    method execute (line 610) | def execute(self, context):
  function MantemPintadoDef (line 616) | def MantemPintadoDef(self, context):
  class MantemPintado (line 648) | class MantemPintado(bpy.types.Operator):
    method execute (line 653) | def execute(self, context):
  function ApagaPintadoDef (line 659) | def ApagaPintadoDef(self, context):
  class ApagaPintado (line 691) | class ApagaPintado(bpy.types.Operator):
    method execute (line 696) | def execute(self, context):
  function SegmentaDesenhoDef (line 702) | def SegmentaDesenhoDef(self, context):
  class SegmentaDesenho (line 779) | class SegmentaDesenho(bpy.types.Operator):
    method execute (line 784) | def execute(self, context):
  function DesenhaBooleanaDentroDef (line 788) | def DesenhaBooleanaDentroDef(self, context):
  class DesenhaBooleanaDentro (line 902) | class DesenhaBooleanaDentro(bpy.types.Operator):
    method execute (line 907) | def execute(self, context):
  function DesenhaBooleanaForaDef (line 914) | def DesenhaBooleanaForaDef(self, context):
  class DesenhaBooleanaFora (line 1028) | class DesenhaBooleanaFora(bpy.types.Operator):
    method execute (line 1033) | def execute(self, context):
  function ImportaSeparaMandibulaDef (line 1044) | def ImportaSeparaMandibulaDef(self, context):
  class ImportaSeparaMandibula (line 1096) | class ImportaSeparaMandibula(bpy.types.Operator):
    method execute (line 1101) | def execute(self, context):
  function MovePara (line 1107) | def MovePara(objOrigem, objMove):
  function AjustaMandibula (line 1119) | def AjustaMandibula():
  function BooleanSeparaMandibula (line 1139) | def BooleanSeparaMandibula():
  class SeparacaoMandibula (line 1218) | class SeparacaoMandibula(bpy.types.Operator):
    method execute (line 1223) | def execute(self, context):
  function SeparaMandibulaCranioDef (line 1234) | def SeparaMandibulaCranioDef():
  class SeparaMandibulaCranio (line 1262) | class SeparaMandibulaCranio(bpy.types.Operator):
    method execute (line 1267) | def execute(self, context):
  class PreparaImpressao3D (line 1274) | class PreparaImpressao3D(bpy.types.Operator):
    method execute (line 1279) | def execute(self, context):
  function FecharBuracosTodosDef (line 1288) | def FecharBuracosTodosDef():
  class FecharBuracosTodos (line 1296) | class FecharBuracosTodos(bpy.types.Operator):
    method execute (line 1301) | def execute(self, context):
  function SeparaObjetoDef (line 1307) | def SeparaObjetoDef():
  class SeparaObjeto (line 1319) | class SeparaObjeto(bpy.types.Operator):
    method poll (line 1325) | def poll(cls, context):
    method execute (line 1335) | def execute(self, context):
  function SegmentaDesenhoMicrosDef (line 1344) | def SegmentaDesenhoMicrosDef(self, context):
  class SegmentaDesenhoMicros (line 1408) | class SegmentaDesenhoMicros(bpy.types.Operator):
    method execute (line 1413) | def execute(self, context):

FILE: ForensicOnBlender.py
  class FORENSIC_PT_AtualizaAddonSec (line 7) | class FORENSIC_PT_AtualizaAddonSec(bpy.types.Panel):
    method draw (line 14) | def draw(self, context):
  class FORENSIC_PT_NomeReconstrucao (line 30) | class FORENSIC_PT_NomeReconstrucao(bpy.types.Panel):
    method draw (line 37) | def draw(self, context):
  class FORENSIC_PT_Fotogrametria (line 73) | class FORENSIC_PT_Fotogrametria(bpy.types.Panel):
    method draw (line 80) | def draw(self, context):
  class FORENSIC_PT_AlinhaFace (line 129) | class FORENSIC_PT_AlinhaFace(bpy.types.Panel):
    method draw (line 136) | def draw(self, context):
  class FORENSIC_PT_ColocaMarcadores (line 240) | class FORENSIC_PT_ColocaMarcadores(bpy.types.Panel):
    method draw (line 247) | def draw(self, context):
  class FORENSIC_PT_Musculos (line 333) | class FORENSIC_PT_Musculos(bpy.types.Panel):
    method draw (line 340) | def draw(self, context):
  class FORENSIC_PT_FaceBasica (line 407) | class FORENSIC_PT_FaceBasica(bpy.types.Panel):
    method draw (line 414) | def draw(self, context):
  class FORENSIC_PT_Importa (line 461) | class FORENSIC_PT_Importa(bpy.types.Panel):
    method draw (line 468) | def draw(self, context):

FILE: ForensicTools.py
  function AdicionaMarcadorDef (line 12) | def AdicionaMarcadorDef(nome, distancia):
  class AdicionaMarcador (line 42) | class AdicionaMarcador(bpy.types.Operator):
    method execute (line 48) | def execute(self, context):
  function CriaBotoesDef (line 71) | def CriaBotoesDef():
  class CriaBotoes (line 167) | class CriaBotoes(bpy.types.Operator):
    method execute (line 173) | def execute(self, context):
  function OcultaNomesDef (line 179) | def OcultaNomesDef():
  class OcultaNomes (line 187) | class OcultaNomes(bpy.types.Operator):
    method execute (line 193) | def execute(self, context):
  function EngrossaLinhaDef (line 199) | def EngrossaLinhaDef():
  class EngrossaLinha (line 208) | class EngrossaLinha(bpy.types.Operator):
    method execute (line 214) | def execute(self, context):
  function ForensicImportaMuscleDef (line 221) | def ForensicImportaMuscleDef(nome, colecao):
  class ForensicImportaTemporalis (line 299) | class ForensicImportaTemporalis(bpy.types.Operator):
    method poll (line 306) | def poll(cls, context):
    method execute (line 316) | def execute(self, context):
  class ForensicImportaMasseter (line 323) | class ForensicImportaMasseter(bpy.types.Operator):
    method poll (line 330) | def poll(cls, context):
    method execute (line 340) | def execute(self, context):
  class ForensicImportaOrbicularisOculi (line 347) | class ForensicImportaOrbicularisOculi(bpy.types.Operator):
    method poll (line 354) | def poll(cls, context):
    method execute (line 364) | def execute(self, context):
  class ForensicImportaElevatorLabiiSuperioris (line 371) | class ForensicImportaElevatorLabiiSuperioris(bpy.types.Operator):
    method poll (line 378) | def poll(cls, context):
    method execute (line 388) | def execute(self, context):
  class ForensicImportaNasalis (line 395) | class ForensicImportaNasalis(bpy.types.Operator):
    method poll (line 402) | def poll(cls, context):
    method execute (line 412) | def execute(self, context):
  class ForensicImportaZygomaticus (line 418) | class ForensicImportaZygomaticus(bpy.types.Operator):
    method poll (line 425) | def poll(cls, context):
    method execute (line 435) | def execute(self, context):
  class ForensicImportaOrbicularisOris (line 442) | class ForensicImportaOrbicularisOris(bpy.types.Operator):
    method poll (line 449) | def poll(cls, context):
    method execute (line 459) | def execute(self, context):
  class ForensicImportaBuccinator (line 466) | class ForensicImportaBuccinator(bpy.types.Operator):
    method poll (line 473) | def poll(cls, context):
    method execute (line 483) | def execute(self, context):
  class ForensicImportaMentalis (line 490) | class ForensicImportaMentalis(bpy.types.Operator):
    method poll (line 497) | def poll(cls, context):
    method execute (line 507) | def execute(self, context):
  class ForensicImportaSternocleidomastoid (line 514) | class ForensicImportaSternocleidomastoid(bpy.types.Operator):
    method poll (line 521) | def poll(cls, context):
    method execute (line 531) | def execute(self, context):
  class ForensicImportaOlho (line 538) | class ForensicImportaOlho(bpy.types.Operator):
    method poll (line 545) | def poll(cls, context):
    method execute (line 555) | def execute(self, context):
  function CopiaEspelhaDef (line 562) | def CopiaEspelhaDef():
  class CopiaEspelha (line 575) | class CopiaEspelha(bpy.types.Operator):
    method execute (line 582) | def execute(self, context):
  function ForensicEsculturaGrabDef (line 588) | def ForensicEsculturaGrabDef():
  class ForensicEsculturaGrab (line 598) | class ForensicEsculturaGrab(bpy.types.Operator):
    method poll (line 604) | def poll(cls, context):
    method execute (line 617) | def execute(self, context):
  function ForensicEsculturaClayStripsDef (line 624) | def ForensicEsculturaClayStripsDef():
  class ForensicEsculturaClayStrips (line 634) | class ForensicEsculturaClayStrips(bpy.types.Operator):
    method poll (line 640) | def poll(cls, context):
    method execute (line 653) | def execute(self, context):
  function ForensicEsculturaSmoothDef (line 660) | def ForensicEsculturaSmoothDef():
  class ForensicEsculturaSmooth (line 670) | class ForensicEsculturaSmooth(bpy.types.Operator):
    method poll (line 676) | def poll(cls, context):
    method execute (line 689) | def execute(self, context):
  function GeraBaseSculptDef (line 697) | def GeraBaseSculptDef():
  class GeraBaseSculpt (line 749) | class GeraBaseSculpt(bpy.types.Operator):
    method execute (line 755) | def execute(self, context):
  class RenomeiaCranio (line 762) | class RenomeiaCranio(bpy.types.Operator):
    method poll (line 769) | def poll(cls, context):
    method execute (line 779) | def execute(self, context):
  class ForensicImportaLuzes (line 787) | class ForensicImportaLuzes(bpy.types.Operator):
    method poll (line 794) | def poll(cls, context):
    method execute (line 804) | def execute(self, context):
  function CriaMaterialOssosDef (line 839) | def CriaMaterialOssosDef():
  class CriaMaterialOssos (line 897) | class CriaMaterialOssos(bpy.types.Operator):
    method poll (line 904) | def poll(cls, context):
    method execute (line 914) | def execute(self, context):
  function ForensicGeraImagemDef (line 921) | def ForensicGeraImagemDef():
  class ForensicGeraImagem (line 973) | class ForensicGeraImagem(bpy.types.Operator):
    method execute (line 979) | def execute(self, context):
  function ForensicImportaOBJDef (line 985) | def ForensicImportaOBJDef():
  class ForensicImportaOBJ (line 1294) | class ForensicImportaOBJ(bpy.types.Operator):
    method execute (line 1300) | def execute(self, context):

FILE: FotogrametriaMeshroom.py
  function GeraModeloFotoMeshroomDef (line 16) | def GeraModeloFotoMeshroomDef(self, context):
  class GeraModeloFotoMeshroom (line 307) | class GeraModeloFotoMeshroom(bpy.types.Operator):
    method execute (line 312) | def execute(self, context):

FILE: FotogrametriaOpenMVG.py
  class MessageFaltaFotos (line 17) | class MessageFaltaFotos(bpy.types.Operator):
    method execute (line 21) | def execute(self, context):
    method invoke (line 26) | def invoke(self, context, event):
  function ConverteHEICtoJPG (line 46) | def ConverteHEICtoJPG():
  function PreparaCenaFotogramDef (line 138) | def PreparaCenaFotogramDef(self, context):
  class PreparaCenaFotogram (line 149) | class PreparaCenaFotogram(bpy.types.Operator):
    method execute (line 154) | def execute(self, context):
  function GeraModeloFotoDef (line 162) | def GeraModeloFotoDef(self, context):
  class GeraModeloFoto (line 619) | class GeraModeloFoto(bpy.types.Operator):
    method execute (line 624) | def execute(self, context):

FILE: FotogrametriaOpenMVGWinWSL.py
  class MessageFaltaFotos (line 17) | class MessageFaltaFotos(bpy.types.Operator):
    method execute (line 21) | def execute(self, context):
    method invoke (line 26) | def invoke(self, context, event):
  function PreparaCenaFotogramDef (line 46) | def PreparaCenaFotogramDef(self, context):
  class PreparaCenaFotogram (line 57) | class PreparaCenaFotogram(bpy.types.Operator):
    method execute (line 62) | def execute(self, context):
  function GeraModeloFotoDef (line 70) | def GeraModeloFotoDef(self, context):
  class GeraModeloFoto (line 511) | class GeraModeloFoto(bpy.types.Operator):
    method execute (line 516) | def execute(self, context):

FILE: FotogrametriaSMVS.py
  function ERROruntimeFotosDef (line 16) | def ERROruntimeFotosDef(self, context):
  function ERROTermFoto (line 19) | def ERROTermFoto():
  function GeraModeloFotoSMVSDef (line 24) | def GeraModeloFotoSMVSDef(self, context):
  class GeraModeloFotoSMVS (line 292) | class GeraModeloFotoSMVS(bpy.types.Operator):
    method execute (line 297) | def execute(self, context):
  class DisplaceSMVS (line 303) | class DisplaceSMVS(bpy.types.Operator):
    method execute (line 308) | def execute(self, context):

FILE: GeraModelosTomo.py
  function GeraModeloTomoAutoMoleDef (line 19) | def GeraModeloTomoAutoMoleDef():
  class GeraModeloTomoAutoMole (line 37) | class GeraModeloTomoAutoMole(bpy.types.Operator):
    method execute (line 43) | def execute(self, context):
  class MessageFaltaDICOM (line 54) | class MessageFaltaDICOM(bpy.types.Operator):
    method execute (line 58) | def execute(self, context):
    method invoke (line 63) | def invoke(self, context, event):
  class MessageFaltaObjeto (line 70) | class MessageFaltaObjeto(bpy.types.Operator):
    method execute (line 74) | def execute(self, context):
    method invoke (line 79) | def invoke(self, context, event):
  function GeraModelosTomoDef (line 100) | def GeraModelosTomoDef(self, context):
  class GeraModelosTomo (line 236) | class GeraModelosTomo(bpy.types.Operator):
    method execute (line 241) | def execute(self, context):
  function GeraModelosTomoArcDef (line 247) | def GeraModelosTomoArcDef(self, context):
  function ReconTomo (line 274) | def ReconTomo(pathdir, interes, saida, simplif):
  function CopiaTomoDir (line 329) | def CopiaTomoDir(Origem):
  function ReduzDimDICOMDef (line 349) | def ReduzDimDICOMDef():
  class ReduzDimDICOM (line 399) | class ReduzDimDICOM(bpy.types.Operator):
    method execute (line 404) | def execute(self, context):
  function IdentificaTomografo (line 411) | def IdentificaTomografo(Arquivo):
  function GeraModeloTomoAutoDef (line 4101) | def GeraModeloTomoAutoDef(self, context):
  class GeraModeloTomoAuto (line 4277) | class GeraModeloTomoAuto(bpy.types.Operator):
    method execute (line 4282) | def execute(self, context):
  function DesagrupaTomoDef (line 4328) | def DesagrupaTomoDef(self, context):
  class DesagrupaTomo (line 4360) | class DesagrupaTomo(bpy.types.Operator):
    method execute (line 4365) | def execute(self, context):
  function GeraModelosTomoManualDef (line 4371) | def GeraModelosTomoManualDef(self, context):
  class GeraModelosTomoManual (line 4544) | class GeraModelosTomoManual(bpy.types.Operator):
    method execute (line 4549) | def execute(self, context):
  function GeraModelosTomoCustomlDef (line 4556) | def GeraModelosTomoCustomlDef():
  class GeraModelosTomoCustom (line 4671) | class GeraModelosTomoCustom(bpy.types.Operator):
    method execute (line 4676) | def execute(self, context):

FILE: GeraRelatorio.py
  function DeslocamentoINIFIN (line 17) | def DeslocamentoINIFIN(obj, obj1, obj2):
  function CapturaCefaloINI (line 33) | def CapturaCefaloINI():
  function CapturaCefaloFIN (line 51) | def CapturaCefaloFIN():
  function GeraRelatorioDef (line 67) | def GeraRelatorioDef(self, context):
  class GeraRelatorio (line 281) | class GeraRelatorio(bpy.types.Operator):
    method execute (line 286) | def execute(self, context):

FILE: ImportaObjMat.py
  function ImportaMaterial (line 4) | def ImportaMaterial(impMaterial, SelObj):

FILE: NomePaciente.py
  class PatientName (line 7) | class PatientName(bpy.types.Operator):
    method execute (line 12) | def execute(self, context):
    method invoke (line 17) | def invoke(self, context, event):
  function NomePacienteDef (line 27) | def NomePacienteDef(self, context):
  class NomePaciente (line 59) | class NomePaciente(bpy.types.Operator):
    method poll (line 65) | def poll(cls, context):
    method execute (line 90) | def execute(self, context):
  function NomePacienteVoxelDef (line 96) | def NomePacienteVoxelDef(self, context):
  class NomePacienteVoxel (line 123) | class NomePacienteVoxel(bpy.types.Operator):
    method poll (line 129) | def poll(cls, context):
    method execute (line 155) | def execute(self, context):
  function NomePacienteTomoDef (line 165) | def NomePacienteTomoDef(self, context):
  class NomePacienteTomo (line 192) | class NomePacienteTomo(bpy.types.Operator):
    method poll (line 198) | def poll(cls, context):
    method execute (line 224) | def execute(self, context):
  function NomePacienteTomoAutoDef (line 230) | def NomePacienteTomoAutoDef(self, context):
  class NomePacienteTomoAuto (line 257) | class NomePacienteTomoAuto(bpy.types.Operator):
    method poll (line 263) | def poll(cls, context):
    method execute (line 289) | def execute(self, context):
  function NomePacienteArcDef (line 295) | def NomePacienteArcDef(self, context):
  class NomePacienteArc (line 317) | class NomePacienteArc(bpy.types.Operator):
    method poll (line 323) | def poll(cls, context):
    method execute (line 349) | def execute(self, context):
  function NomePacienteRefDef (line 355) | def NomePacienteRefDef(self, context):
  class NomePacienteRef (line 377) | class NomePacienteRef(bpy.types.Operator):
    method poll (line 383) | def poll(cls, context):
    method execute (line 409) | def execute(self, context):
  function NomePacienteSegDef (line 415) | def NomePacienteSegDef(self, context):
  class NomePacienteSeg (line 437) | class NomePacienteSeg(bpy.types.Operator):
    method poll (line 443) | def poll(cls, context):
    method execute (line 469) | def execute(self, context):
  function NomePacienteFotogramDef (line 475) | def NomePacienteFotogramDef(self, context):
  class NomePacienteFotogram (line 497) | class NomePacienteFotogram(bpy.types.Operator):
    method poll (line 503) | def poll(cls, context):
    method execute (line 529) | def execute(self, context):
  function NomePacienteAlinhaFaceDef (line 535) | def NomePacienteAlinhaFaceDef(self, context):
  class NomePacienteAlinhaFace (line 557) | class NomePacienteAlinhaFace(bpy.types.Operator):
    method poll (line 563) | def poll(cls, context):
    method execute (line 589) | def execute(self, context):
  function NomePacienteAlinhaFotoTomoDef (line 595) | def NomePacienteAlinhaFotoTomoDef(self, context):
  class NomePacienteAlinhaFotoTomo (line 617) | class NomePacienteAlinhaFotoTomo(bpy.types.Operator):
    method poll (line 623) | def poll(cls, context):
    method execute (line 649) | def execute(self, context):
  function NomePacientePointsHeadDef (line 655) | def NomePacientePointsHeadDef(self, context):
  class NomePacientePointsHead (line 682) | class NomePacientePointsHead(bpy.types.Operator):
    method poll (line 688) | def poll(cls, context):
    method execute (line 714) | def execute(self, context):
  function NomePacientePointsMaxillaDef (line 723) | def NomePacientePointsMaxillaDef(self, context):
  class NomePacientePointsMaxilla (line 750) | class NomePacientePointsMaxilla(bpy.types.Operator):
    method poll (line 756) | def poll(cls, context):
    method execute (line 782) | def execute(self, context):
  function NomePacientePointsMandibleDef (line 790) | def NomePacientePointsMandibleDef(self, context):
  class NomePacientePointsMandible (line 817) | class NomePacientePointsMandible(bpy.types.Operator):
    method poll (line 823) | def poll(cls, context):
    method execute (line 849) | def execute(self, context):
  function NomePacientePointsTeethDef (line 857) | def NomePacientePointsTeethDef(self, context):
  class NomePacientePointsTeeth (line 884) | class NomePacientePointsTeeth(bpy.types.Operator):
    method poll (line 890) | def poll(cls, context):
    method execute (line 916) | def execute(self, context):
  function NomePacientePointsSoftDef (line 924) | def NomePacientePointsSoftDef(self, context):
  class NomePacientePointsSoft (line 951) | class NomePacientePointsSoft(bpy.types.Operator):
    method poll (line 957) | def poll(cls, context):
    method execute (line 983) | def execute(self, context):
  function NomePacienteOsteotomyDef (line 991) | def NomePacienteOsteotomyDef(self, context):
  class NomePacienteOsteotomy (line 1018) | class NomePacienteOsteotomy(bpy.types.Operator):
    method poll (line 1024) | def poll(cls, context):
    method execute (line 1050) | def execute(self, context):
  function NomePacienteDynamicDef (line 1058) | def NomePacienteDynamicDef(self, context):
  class NomePacienteDynamic (line 1085) | class NomePacienteDynamic(bpy.types.Operator):
    method poll (line 1091) | def poll(cls, context):
    method execute (line 1117) | def execute(self, context):
  function NomePacienteKinematicDef (line 1125) | def NomePacienteKinematicDef(self, context):
  class NomePacienteKinematic (line 1152) | class NomePacienteKinematic(bpy.types.Operator):
    method poll (line 1158) | def poll(cls, context):
    method execute (line 1184) | def execute(self, context):
  function NomePacienteGuideDef (line 1193) | def NomePacienteGuideDef(self, context):
  class NomePacienteGuide (line 1220) | class NomePacienteGuide(bpy.types.Operator):
    method poll (line 1226) | def poll(cls, context):
    method execute (line 1252) | def execute(self, context):
  function NomePacienteMarkersDef (line 1259) | def NomePacienteMarkersDef(self, context):
  class NomePacienteMarkers (line 1286) | class NomePacienteMarkers(bpy.types.Operator):
    method poll (line 1292) | def poll(cls, context):
    method execute (line 1318) | def execute(self, context):
  function NomePacienteMusclesDef (line 1325) | def NomePacienteMusclesDef(self, context):
  class NomePacienteMuscles (line 1352) | class NomePacienteMuscles(bpy.types.Operator):
    method poll (line 1358) | def poll(cls, context):
    method execute (line 1384) | def execute(self, context):
  function NomePacienteSculptDef (line 1392) | def NomePacienteSculptDef(self, context):
  class NomePacienteSculpt (line 1419) | class NomePacienteSculpt(bpy.types.Operator):
    method poll (line 1425) | def poll(cls, context):
    method execute (line 1451) | def execute(self, context):

FILE: OrtogMeshes.py
  function LinhaBaseDef (line 15) | def LinhaBaseDef(self, context):
  class LinhaBase (line 30) | class LinhaBase(Operator, AddObjectHelper):
    method execute (line 36) | def execute(self, context):
  function CriaMentoDef (line 43) | def CriaMentoDef(self, context):
  class CriaMento (line 72) | class CriaMento(Operator, AddObjectHelper):
    method execute (line 78) | def execute(self, context):
  function CriaRamoDef (line 85) | def CriaRamoDef(self, context):
  class CriaRamo (line 114) | class CriaRamo(Operator, AddObjectHelper):
    method execute (line 120) | def execute(self, context):
  function CriaMaxilaDef (line 126) | def CriaMaxilaDef(self, context):
  class CriaMaxila (line 159) | class CriaMaxila(Operator, AddObjectHelper):
    method execute (line 165) | def execute(self, context):
  function CriaMeshAlinhOrigDef (line 173) | def CriaMeshAlinhOrigDef(self, context):
  class CriaMeshAlinhOrig (line 195) | class CriaMeshAlinhOrig(Operator, AddObjectHelper):
    method execute (line 201) | def execute(self, context):
  function CriaMeshAlinhAlinhDef (line 213) | def CriaMeshAlinhAlinhDef(self, context):
  class CriaMeshAlinhAlinh (line 235) | class CriaMeshAlinhAlinh(Operator, AddObjectHelper):
    method execute (line 241) | def execute(self, context):
  function AdicionaPlanosCorteAutoDef (line 256) | def AdicionaPlanosCorteAutoDef():
  class AdicionaPlanosCorteAuto (line 382) | class AdicionaPlanosCorteAuto(Operator, AddObjectHelper):
    method execute (line 388) | def execute(self, context):

FILE: OtherOnBlender.py
  class OTHER_PT_AtualizaAddonSec (line 12) | class OTHER_PT_AtualizaAddonSec(bpy.types.Panel):
    method draw (line 19) | def draw(self, context):
  class OTHER_PT_Converte_Video (line 37) | class OTHER_PT_Converte_Video(bpy.types.Panel):
    method draw (line 44) | def draw(self, context):
  class OTHER_PT_Converte_Img_Tomo (line 70) | class OTHER_PT_Converte_Img_Tomo(bpy.types.Panel):
    method draw (line 77) | def draw(self, context):
  class OTHER_PT_Objeto_para_Dicom (line 180) | class OTHER_PT_Objeto_para_Dicom(bpy.types.Panel):
    method draw (line 187) | def draw(self, context):
  class OTHER_PT_Cut_Points (line 250) | class OTHER_PT_Cut_Points(bpy.types.Panel):
    method draw (line 257) | def draw(self, context):
  class OTHER_PT_Vein (line 321) | class OTHER_PT_Vein(bpy.types.Panel):
    method draw (line 328) | def draw(self, context):
  function CriaSplintDentesPintaDef (line 354) | def CriaSplintDentesPintaDef():
  class CriaSplintDentesPinta (line 412) | class CriaSplintDentesPinta(bpy.types.Operator):
    method execute (line 418) | def execute(self, context):
  class OTHER_PT_PintaOffset (line 425) | class OTHER_PT_PintaOffset(bpy.types.Panel):
    method draw (line 432) | def draw(self, context):
  class OTHER_PT_MicrosXYZ (line 484) | class OTHER_PT_MicrosXYZ(bpy.types.Panel):
    method draw (line 491) | def draw(self, context):

FILE: Poisson.py
  function PoissonDef (line 7) | def PoissonDef(self, context):
  class Poisson (line 32) | class Poisson(bpy.types.Operator):
    method execute (line 37) | def execute(self, context):
  function ReconstXYZDef (line 43) | def ReconstXYZDef():
  class ReconstXYZ (line 84) | class ReconstXYZ(bpy.types.Operator):
    method execute (line 89) | def execute(self, context):

FILE: PontosAnatomicos.py
  function PontosMostraNomesDef (line 8) | def PontosMostraNomesDef(self, context):
  class PontosMostraNomes (line 20) | class PontosMostraNomes(bpy.types.Operator):
    method execute (line 26) | def execute(self, context):
  function PontosOcultaNomesDef (line 32) | def PontosOcultaNomesDef(self, context):
  class PontosOcultaNomes (line 43) | class PontosOcultaNomes(bpy.types.Operator):
    method execute (line 49) | def execute(self, context):
  function TestaPontoCollDef (line 56) | def TestaPontoCollDef():
  function CriaPontoDef (line 76) | def CriaPontoDef(nome, colecao):
  class Orbital_right_pt (line 134) | class Orbital_right_pt(bpy.types.Operator):
    method poll (line 141) | def poll(cls, context):
    method execute (line 152) | def execute(self, context):
  class Orbital_left_pt (line 157) | class Orbital_left_pt(bpy.types.Operator):
    method poll (line 164) | def poll(cls, context):
    method execute (line 175) | def execute(self, context):
  class N_pt (line 180) | class N_pt(bpy.types.Operator):
    method poll (line 187) | def poll(cls, context):
    method execute (line 198) | def execute(self, context):
  class Po_right_pt (line 203) | class Po_right_pt(bpy.types.Operator):
    method poll (line 210) | def poll(cls, context):
    method execute (line 221) | def execute(self, context):
  class Po_left_pt (line 226) | class Po_left_pt(bpy.types.Operator):
    method poll (line 233) | def poll(cls, context):
    method execute (line 244) | def execute(self, context):
  class Pt_right_pt (line 249) | class Pt_right_pt(bpy.types.Operator):
    method poll (line 256) | def poll(cls, context):
    method execute (line 267) | def execute(self, context):
  class Pt_left_pt (line 272) | class Pt_left_pt(bpy.types.Operator):
    method poll (line 279) | def poll(cls, context):
    method execute (line 290) | def execute(self, context):
  class Ba_pt (line 295) | class Ba_pt(bpy.types.Operator):
    method poll (line 302) | def poll(cls, context):
    method execute (line 313) | def execute(self, context):
  class S_pt (line 318) | class S_pt(bpy.types.Operator):
    method poll (line 325) | def poll(cls, context):
    method execute (line 336) | def execute(self, context):
  class U1_Tip_pt (line 343) | class U1_Tip_pt(bpy.types.Operator):
    method poll (line 350) | def poll(cls, context):
    method execute (line 361) | def execute(self, context):
  class U1_LabGenBor_pt (line 366) | class U1_LabGenBor_pt(bpy.types.Operator):
    method poll (line 373) | def poll(cls, context):
    method execute (line 384) | def execute(self, context):
  class U1_LinGenBor_pt (line 389) | class U1_LinGenBor_pt(bpy.types.Operator):
    method poll (line 396) | def poll(cls, context):
    method execute (line 407) | def execute(self, context):
  class M_U6_pt (line 412) | class M_U6_pt(bpy.types.Operator):
    method poll (line 419) | def poll(cls, context):
    method execute (line 430) | def execute(self, context):
  class D_U6_pt (line 435) | class D_U6_pt(bpy.types.Operator):
    method poll (line 442) | def poll(cls, context):
    method execute (line 453) | def execute(self, context):
  class U6_Occlusal_pt (line 458) | class U6_Occlusal_pt(bpy.types.Operator):
    method poll (line 465) | def poll(cls, context):
    method execute (line 476) | def execute(self, context):
  class PNS_pt (line 481) | class PNS_pt(bpy.types.Operator):
    method poll (line 488) | def poll(cls, context):
    method execute (line 499) | def execute(self, context):
  class A_pt (line 504) | class A_pt(bpy.types.Operator):
    method poll (line 511) | def poll(cls, context):
    method execute (line 522) | def execute(self, context):
  class ANS_pt (line 527) | class ANS_pt(bpy.types.Operator):
    method poll (line 534) | def poll(cls, context):
    method execute (line 545) | def execute(self, context):
  class U1_Root_pt (line 550) | class U1_Root_pt(bpy.types.Operator):
    method poll (line 557) | def poll(cls, context):
    method execute (line 568) | def execute(self, context):
  class L1_Tip_pt (line 575) | class L1_Tip_pt(bpy.types.Operator):
    method poll (line 582) | def poll(cls, context):
    method execute (line 593) | def execute(self, context):
  class L1_Root_pt (line 598) | class L1_Root_pt(bpy.types.Operator):
    method poll (line 605) | def poll(cls, context):
    method execute (line 616) | def execute(self, context):
  class L1_LabGenBor_pt (line 621) | class L1_LabGenBor_pt(bpy.types.Operator):
    method poll (line 628) | def poll(cls, context):
    method execute (line 639) | def execute(self, context):
  class L1_LinGenBor_pt (line 644) | class L1_LinGenBor_pt(bpy.types.Operator):
    method poll (line 651) | def poll(cls, context):
    method execute (line 662) | def execute(self, context):
  class B_pt (line 667) | class B_pt(bpy.types.Operator):
    method poll (line 674) | def poll(cls, context):
    method execute (line 685) | def execute(self, context):
  class M_L6_pt (line 690) | class M_L6_pt(bpy.types.Operator):
    method poll (line 697) | def poll(cls, context):
    method execute (line 708) | def execute(self, context):
  class L6_Occlusal_pt (line 713) | class L6_Occlusal_pt(bpy.types.Operator):
    method poll (line 720) | def poll(cls, context):
    method execute (line 731) | def execute(self, context):
  class D_L6_pt (line 736) | class D_L6_pt(bpy.types.Operator):
    method poll (line 743) | def poll(cls, context):
    method execute (line 754) | def execute(self, context):
  class MidRamusRight_pt (line 759) | class MidRamusRight_pt(bpy.types.Operator):
    method poll (line 766) | def poll(cls, context):
    method execute (line 777) | def execute(self, context):
  class MidRamusLeft_pt (line 782) | class MidRamusLeft_pt(bpy.types.Operator):
    method poll (line 789) | def poll(cls, context):
    method execute (line 800) | def execute(self, context):
  class R_right_pt (line 805) | class R_right_pt(bpy.types.Operator):
    method poll (line 812) | def poll(cls, context):
    method execute (line 823) | def execute(self, context):
  class R_left_pt (line 828) | class R_left_pt(bpy.types.Operator):
    method poll (line 835) | def poll(cls, context):
    method execute (line 846) | def execute(self, context):
  class Go_right_pt (line 851) | class Go_right_pt(bpy.types.Operator):
    method poll (line 858) | def poll(cls, context):
    method execute (line 869) | def execute(self, context):
  class Go_left_pt (line 874) | class Go_left_pt(bpy.types.Operator):
    method poll (line 881) | def poll(cls, context):
    method execute (line 892) | def execute(self, context):
  class Ar_right_pt (line 897) | class Ar_right_pt(bpy.types.Operator):
    method poll (line 904) | def poll(cls, context):
    method execute (line 915) | def execute(self, context):
  class Ar_left_pt (line 920) | class Ar_left_pt(bpy.types.Operator):
    method poll (line 927) | def poll(cls, context):
    method execute (line 938) | def execute(self, context):
  class Sigmoid_right_pt (line 943) | class Sigmoid_right_pt(bpy.types.Operator):
    method poll (line 950) | def poll(cls, context):
    method execute (line 961) | def execute(self, context):
  class Sigmoid_left_pt (line 966) | class Sigmoid_left_pt(bpy.types.Operator):
    method poll (line 973) | def poll(cls, context):
    method execute (line 984) | def execute(self, context):
  class Co_right_pt (line 989) | class Co_right_pt(bpy.types.Operator):
    method poll (line 996) | def poll(cls, context):
    method execute (line 1007) | def execute(self, context):
  class Co_left_pt (line 1012) | class Co_left_pt(bpy.types.Operator):
    method poll (line 1019) | def poll(cls, context):
    method execute (line 1030) | def execute(self, context):
  class Pg_pt (line 1035) | class Pg_pt(bpy.types.Operator):
    method poll (line 1042) | def poll(cls, context):
    method execute (line 1053) | def execute(self, context):
  class Gn_pt (line 1058) | class Gn_pt(bpy.types.Operator):
    method poll (line 1065) | def poll(cls, context):
    method execute (line 1076) | def execute(self, context):
  class Me_pt (line 1081) | class Me_pt(bpy.types.Operator):
    method poll (line 1088) | def poll(cls, context):
    method execute (line 1099) | def execute(self, context):
  class Condylar_Process_left_pt (line 1105) | class Condylar_Process_left_pt(bpy.types.Operator):
    method poll (line 1112) | def poll(cls, context):
    method execute (line 1122) | def execute(self, context):
  class Condylar_Process_right_pt (line 1130) | class Condylar_Process_right_pt(bpy.types.Operator):
    method poll (line 1137) | def poll(cls, context):
    method execute (line 1147) | def execute(self, context):
  class Coronoid_Process_left_pt (line 1155) | class Coronoid_Process_left_pt(bpy.types.Operator):
    method poll (line 1162) | def poll(cls, context):
    method execute (line 1172) | def execute(self, context):
  class Coronoid_Process_right_pt (line 1180) | class Coronoid_Process_right_pt(bpy.types.Operator):
    method poll (line 1187) | def poll(cls, context):
    method execute (line 1197) | def execute(self, context):
  class Go_Ramus_Fracure_left_pt (line 1205) | class Go_Ramus_Fracure_left_pt(bpy.types.Operator):
    method poll (line 1212) | def poll(cls, context):
    method execute (line 1222) | def execute(self, context):
  class Go_Ramus_Fracure_right_pt (line 1230) | class Go_Ramus_Fracure_right_pt(bpy.types.Operator):
    method poll (line 1237) | def poll(cls, context):
    method execute (line 1247) | def execute(self, context):
  class Mid_Mandibula_Angle_left_pt (line 1255) | class Mid_Mandibula_Angle_left_pt(bpy.types.Operator):
    method poll (line 1262) | def poll(cls, context):
    method execute (line 1272) | def execute(self, context):
  class Mid_Mandibula_Angle_right_pt (line 1279) | class Mid_Mandibula_Angle_right_pt(bpy.types.Operator):
    method poll (line 1286) | def poll(cls, context):
    method execute (line 1296) | def execute(self, context):
  class Mid_Upper_Incisors_pt (line 1304) | class Mid_Upper_Incisors_pt(bpy.types.Operator):
    method poll (line 1311) | def poll(cls, context):
    method execute (line 1321) | def execute(self, context):
  class Tooth_8_pt (line 1331) | class Tooth_8_pt(bpy.types.Operator):
    method poll (line 1338) | def poll(cls, context):
    method execute (line 1349) | def execute(self, context):
  class Tooth_9_pt (line 1356) | class Tooth_9_pt(bpy.types.Operator):
    method poll (line 1363) | def poll(cls, context):
    method execute (line 1374) | def execute(self, context):
  class Tooth_6_pt (line 1381) | class Tooth_6_pt(bpy.types.Operator):
    method poll (line 1388) | def poll(cls, context):
    method execute (line 1399) | def execute(self, context):
  class Tooth_11_pt (line 1406) | class Tooth_11_pt(bpy.types.Operator):
    method poll (line 1413) | def poll(cls, context):
    method execute (line 1424) | def execute(self, context):
  class Tooth_3_pt (line 1431) | class Tooth_3_pt(bpy.types.Operator):
    method poll (line 1438) | def poll(cls, context):
    method execute (line 1449) | def execute(self, context):
  class Tooth_14_pt (line 1456) | class Tooth_14_pt(bpy.types.Operator):
    method poll (line 1463) | def poll(cls, context):
    method execute (line 1474) | def execute(self, context):
  class Tooth_24_pt (line 1481) | class Tooth_24_pt(bpy.types.Operator):
    method poll (line 1488) | def poll(cls, context):
    method execute (line 1499) | def execute(self, context):
  class Tooth_25_pt (line 1506) | class Tooth_25_pt(bpy.types.Operator):
    method poll (line 1513) | def poll(cls, context):
    method execute (line 1524) | def execute(self, context):
  class Tooth_22_pt (line 1531) | class Tooth_22_pt(bpy.types.Operator):
    method poll (line 1538) | def poll(cls, context):
    method execute (line 1549) | def execute(self, context):
  class Tooth_27_pt (line 1556) | class Tooth_27_pt(bpy.types.Operator):
    method poll (line 1563) | def poll(cls, context):
    method execute (line 1574) | def execute(self, context):
  class Tooth_19_pt (line 1581) | class Tooth_19_pt(bpy.types.Operator):
    method poll (line 1588) | def poll(cls, context):
    method execute (line 1599) | def execute(self, context):
  class Tooth_30_pt (line 1606) | class Tooth_30_pt(bpy.types.Operator):
    method poll (line 1613) | def poll(cls, context):
    method execute (line 1624) | def execute(self, context):
  class ST_Glabella_pt (line 1634) | class ST_Glabella_pt(bpy.types.Operator):
    method poll (line 1641) | def poll(cls, context):
    method execute (line 1652) | def execute(self, context):
  class ST_Nasion_pt (line 1660) | class ST_Nasion_pt(bpy.types.Operator):
    method poll (line 1667) | def poll(cls, context):
    method execute (line 1678) | def execute(self, context):
  class Bridge_Nose_pt (line 1685) | class Bridge_Nose_pt(bpy.types.Operator):
    method poll (line 1692) | def poll(cls, context):
    method execute (line 1703) | def execute(self, context):
  class Tip_Nose_pt (line 1710) | class Tip_Nose_pt(bpy.types.Operator):
    method poll (line 1717) | def poll(cls, context):
    method execute (line 1728) | def execute(self, context):
  class Columella_pt (line 1735) | class Columella_pt(bpy.types.Operator):
    method poll (line 1742) | def poll(cls, context):
    method execute (line 1753) | def execute(self, context):
  class Subnasale_pt (line 1760) | class Subnasale_pt(bpy.types.Operator):
    method poll (line 1767) | def poll(cls, context):
    method execute (line 1778) | def execute(self, context):
  class ST_A_point_pt (line 1785) | class ST_A_point_pt(bpy.types.Operator):
    method poll (line 1792) | def poll(cls, context):
    method execute (line 1803) | def execute(self, context):
  class Upper_Lip_pt (line 1810) | class Upper_Lip_pt(bpy.types.Operator):
    method poll (line 1817) | def poll(cls, context):
    method execute (line 1828) | def execute(self, context):
  class Stomion_Superius_pt (line 1835) | class Stomion_Superius_pt(bpy.types.Operator):
    method poll (line 1842) | def poll(cls, context):
    method execute (line 1853) | def execute(self, context):
  class Stomion_Inferius_pt (line 1860) | class Stomion_Inferius_pt(bpy.types.Operator):
    method poll (line 1867) | def poll(cls, context):
    method execute (line 1878) | def execute(self, context):
  class Lower_Lip_pt (line 1885) | class Lower_Lip_pt(bpy.types.Operator):
    method poll (line 1892) | def poll(cls, context):
    method execute (line 1903) | def execute(self, context):
  class ST_B_point_pt (line 1910) | class ST_B_point_pt(bpy.types.Operator):
    method poll (line 1917) | def poll(cls, context):
    method execute (line 1928) | def execute(self, context):
  class ST_Pogonion_pt (line 1936) | class ST_Pogonion_pt(bpy.types.Operator):
    method poll (line 1943) | def poll(cls, context):
    method execute (line 1954) | def execute(self, context):
  class ST_Gnathion_pt (line 1962) | class ST_Gnathion_pt(bpy.types.Operator):
    method poll (line 1969) | def poll(cls, context):
    method execute (line 1980) | def execute(self, context):
  class ST_Menton_pt (line 1988) | class ST_Menton_pt(bpy.types.Operator):
    method poll (line 1995) | def poll(cls, context):
    method execute (line 2006) | def execute(self, context):
  class Throat_point_pt (line 2014) | class Throat_point_pt(bpy.types.Operator):
    method poll (line 2021) | def poll(cls, context):
    method execute (line 2032) | def execute(self, context):
  class Subpupil_right_pt (line 2039) | class Subpupil_right_pt(bpy.types.Operator):
    method poll (line 2046) | def poll(cls, context):
    method execute (line 2057) | def execute(self, context):
  class Subpupil_left_pt (line 2064) | class Subpupil_left_pt(bpy.types.Operator):
    method poll (line 2071) | def poll(cls, context):
    method execute (line 2082) | def execute(self, context):
  class CB_right_pt (line 2089) | class CB_right_pt(bpy.types.Operator):
    method poll (line 2096) | def poll(cls, context):
    method execute (line 2107) | def execute(self, context):
  class CB_left_pt (line 2115) | class CB_left_pt(bpy.types.Operator):
    method poll (line 2122) | def poll(cls, context):
    method execute (line 2133) | def execute(self, context):
  class OR_right_pt (line 2140) | class OR_right_pt(bpy.types.Operator):
    method poll (line 2147) | def poll(cls, context):
    method execute (line 2158) | def execute(self, context):
  class OR_left_pt (line 2166) | class OR_left_pt(bpy.types.Operator):
    method poll (line 2173) | def poll(cls, context):
    method execute (line 2184) | def execute(self, context):
  class Cheekbone_left_pt (line 2191) | class Cheekbone_left_pt(bpy.types.Operator):
    method poll (line 2198) | def poll(cls, context):
    method execute (line 2209) | def execute(self, context):
  class Cheekbone_right_pt (line 2216) | class Cheekbone_right_pt(bpy.types.Operator):
    method poll (line 2223) | def poll(cls, context):
    method execute (line 2234) | def execute(self, context):
  class SP_right_pt (line 2242) | class SP_right_pt(bpy.types.Operator):
    method poll (line 2249) | def poll(cls, context):
    method execute (line 2260) | def execute(self, context):
  class SP_left_pt (line 2267) | class SP_left_pt(bpy.types.Operator):
    method poll (line 2274) | def poll(cls, context):
    method execute (line 2285) | def execute(self, context):
  class AB_right_pt (line 2293) | class AB_right_pt(bpy.types.Operator):
    method poll (line 2300) | def poll(cls, context):
    method execute (line 2311) | def execute(self, context):
  class AB_left_pt (line 2319) | class AB_left_pt(bpy.types.Operator):
    method poll (line 2326) | def poll(cls, context):
    method execute (line 2337) | def execute(self, context):
  class Head_of_Condyle_pt (line 2345) | class Head_of_Condyle_pt(bpy.types.Operator):
    method poll (line 2352) | def poll(cls, context):
    method execute (line 2363) | def execute(self, context):
  class Lateral_Canthus_left_pt (line 2371) | class Lateral_Canthus_left_pt(bpy.types.Operator):
    method poll (line 2378) | def poll(cls, context):
    method execute (line 2388) | def execute(self, context):
  class Lateral_Canthus_right_pt (line 2395) | class Lateral_Canthus_right_pt(bpy.types.Operator):
    method poll (line 2402) | def poll(cls, context):
    method execute (line 2412) | def execute(self, context):
  function ParenteiaPonto (line 2421) | def ParenteiaPonto(ponto):
  function ParenteiaPontoMole (line 2492) | def ParenteiaPontoMole(ponto):
  class testaPontos (line 2582) | class testaPontos(bpy.types.Operator):
    method execute (line 2588) | def execute(self, context):
  function ParenteiaEMPDef (line 2594) | def ParenteiaEMPDef(self, context):
  class ParenteiaEMP (line 2620) | class ParenteiaEMP(bpy.types.Operator):
    method execute (line 2626) | def execute(self, context):
  function OcultaPontosAnatomicosDef (line 2632) | def OcultaPontosAnatomicosDef():
  class OcultaPontosAnatomicos (line 2637) | class OcultaPontosAnatomicos(bpy.types.Operator):
    method execute (line 2643) | def execute(self, context):
  function MostraPontosAnatomicosDef (line 2649) | def MostraPontosAnatomicosDef():
  class MostraPontosAnatomicos (line 2655) | class MostraPontosAnatomicos(bpy.types.Operator):
    method execute (line 2661) | def execute(self, context):

FILE: RelatorioAnimacao.py
  function AnimaLocRotDef (line 3) | def AnimaLocRotDef(self, context):
  class AnimaLocRot (line 11) | class AnimaLocRot(bpy.types.Operator):
    method execute (line 16) | def execute(self, context):

FILE: RhinOnBlender.py
  class RHIN_PT_AtualizaAddonSec (line 8) | class RHIN_PT_AtualizaAddonSec(bpy.types.Panel):
    method draw (line 15) | def draw(self, context):
  class RHIN_PT_NomePaciente (line 30) | class RHIN_PT_NomePaciente(bpy.types.Panel):
    method draw (line 37) | def draw(self, context):
  class RHIN_PT_Fotogrametria (line 63) | class RHIN_PT_Fotogrametria(bpy.types.Panel):
    method draw (line 70) | def draw(self, context):
  class RHIN_PT_AlinhaFace (line 162) | class RHIN_PT_AlinhaFace(bpy.types.Panel):
    method draw (line 169) | def draw(self, context):
  class RHIN_PT_PontosAnatomicos (line 280) | class RHIN_PT_PontosAnatomicos(bpy.types.Panel):
    method draw (line 287) | def draw(self, context):
  class RHIN_PT_DistAngles (line 423) | class RHIN_PT_DistAngles(bpy.types.Panel):
    method draw (line 430) | def draw(self, context):
  class RHIN_PT_Escultura (line 658) | class RHIN_PT_Escultura(bpy.types.Panel):
    method draw (line 665) | def draw(self, context):
  class RHIN_PT_GuideCreation (line 735) | class RHIN_PT_GuideCreation(bpy.types.Panel):
    method draw (line 742) | def draw(self, context):

FILE: RhinOpenGL.py
  function LinhasCentraisCria (line 6) | def LinhasCentraisCria():
  class RhinVisualizaGL (line 68) | class RhinVisualizaGL(bpy.types.Operator):
    method execute (line 73) | def execute(self, context):
  function LinhasCentraisApaga (line 80) | def LinhasCentraisApaga():
  class RhinRemoveGL (line 86) | class RhinRemoveGL(bpy.types.Operator):
    method execute (line 91) | def execute(self, context):

FILE: RhinTools.py
  class Alar_Cheek_Groove_right_pt (line 14) | class Alar_Cheek_Groove_right_pt(bpy.types.Operator):
    method poll (line 21) | def poll(cls, context):
    method execute (line 32) | def execute(self, context):
  class Alar_Cheek_Groove_left_pt (line 40) | class Alar_Cheek_Groove_left_pt(bpy.types.Operator):
    method poll (line 47) | def poll(cls, context):
    method execute (line 58) | def execute(self, context):
  class Medial_Canthus_right_pt (line 66) | class Medial_Canthus_right_pt(bpy.types.Operator):
    method poll (line 73) | def poll(cls, context):
    method execute (line 84) | def execute(self, context):
  class Medial_Canthus_left_pt (line 91) | class Medial_Canthus_left_pt(bpy.types.Operator):
    method poll (line 98) | def poll(cls, context):
    method execute (line 109) | def execute(self, context):
  class Radix_pt (line 116) | class Radix_pt(bpy.types.Operator):
    method poll (line 123) | def poll(cls, context):
    method execute (line 134) | def execute(self, context):
  class Anterior_Nostril_left_pt (line 141) | class Anterior_Nostril_left_pt(bpy.types.Operator):
    method poll (line 148) | def poll(cls, context):
    method execute (line 159) | def execute(self, context):
  class Anterior_Nostril_right_pt (line 167) | class Anterior_Nostril_right_pt(bpy.types.Operator):
    method poll (line 174) | def poll(cls, context):
    method execute (line 185) | def execute(self, context):
  class Posterior_Nostril_left_pt (line 193) | class Posterior_Nostril_left_pt(bpy.types.Operator):
    method poll (line 200) | def poll(cls, context):
    method execute (line 211) | def execute(self, context):
  class Posterior_Nostril_right_pt (line 219) | class Posterior_Nostril_right_pt(bpy.types.Operator):
    method poll (line 226) | def poll(cls, context):
    method execute (line 237) | def execute(self, context):
  class Rhinion_pt (line 244) | class Rhinion_pt(bpy.types.Operator):
    method poll (line 251) | def poll(cls, context):
    method execute (line 262) | def execute(self, context):
  class Alar_Groove_right_pt (line 269) | class Alar_Groove_right_pt(bpy.types.Operator):
    method poll (line 276) | def poll(cls, context):
    method execute (line 287) | def execute(self, context):
  class Alar_Groove_left_pt (line 294) | class Alar_Groove_left_pt(bpy.types.Operator):
    method poll (line 301) | def poll(cls, context):
    method execute (line 312) | def execute(self, context):
  class Supratip_pt (line 319) | class Supratip_pt(bpy.types.Operator):
    method poll (line 326) | def poll(cls, context):
    method execute (line 337) | def execute(self, context):
  class Infratip_Lobule_pt (line 344) | class Infratip_Lobule_pt(bpy.types.Operator):
    method poll (line 351) | def poll(cls, context):
    method execute (line 362) | def execute(self, context):
  class Alar_Rim_right_pt (line 369) | class Alar_Rim_right_pt(bpy.types.Operator):
    method poll (line 376) | def poll(cls, context):
    method execute (line 387) | def execute(self, context):
  class Alar_Rim_left_pt (line 394) | class Alar_Rim_left_pt(bpy.types.Operator):
    method poll (line 401) | def poll(cls, context):
    method execute (line 412) | def execute(self, context):
  class Columella_right_pt (line 419) | class Columella_right_pt(bpy.types.Operator):
    method poll (line 426) | def poll(cls, context):
    method execute (line 437) | def execute(self, context):
  class Columella_left_pt (line 444) | class Columella_left_pt(bpy.types.Operator):
    method poll (line 451) | def poll(cls, context):
    method execute (line 462) | def execute(self, context):
  class Trichion_pt (line 470) | class Trichion_pt(bpy.types.Operator):
    method poll (line 477) | def poll(cls, context):
    method execute (line 487) | def execute(self, context):
  class Submental_pt (line 495) | class Submental_pt(bpy.types.Operator):
    method poll (line 502) | def poll(cls, context):
    method execute (line 512) | def execute(self, context):
  class Supraglabella_pt (line 520) | class Supraglabella_pt(bpy.types.Operator):
    method poll (line 527) | def poll(cls, context):
    method execute (line 537) | def execute(self, context):
  class Glabella_pt (line 544) | class Glabella_pt(bpy.types.Operator):
    method poll (line 551) | def poll(cls, context):
    method execute (line 561) | def execute(self, context):
  function CopiaFaceDef (line 570) | def CopiaFaceDef():
  class CopiaFace (line 582) | class CopiaFace(bpy.types.Operator):
    method poll (line 589) | def poll(cls, context):
    method execute (line 600) | def execute(self, context):
  function CalculaDistsNarizDef (line 607) | def CalculaDistsNarizDef():
  class CalculaDistsNariz (line 836) | class CalculaDistsNariz(bpy.types.Operator):
    method execute (line 841) | def execute(self, context):
  class MostraOcultaPontos (line 873) | class MostraOcultaPontos(bpy.types.Operator):
    method execute (line 878) | def execute(self, context):
  function GeraGuiaNarizDef (line 896) | def GeraGuiaNarizDef():
  class GeraGuiaNariz (line 1010) | class GeraGuiaNariz(bpy.types.Operator):
    method execute (line 1015) | def execute(self, context):
  function EsculturaGrabDef (line 1022) | def EsculturaGrabDef():
  class EsculturaGrab (line 1033) | class EsculturaGrab(bpy.types.Operator):
    method poll (line 1039) | def poll(cls, context):
    method execute (line 1052) | def execute(self, context):
  function EsculturaSmoothDef (line 1059) | def EsculturaSmoothDef():
  class EsculturaSmooth (line 1069) | class EsculturaSmooth(bpy.types.Operator):
    method poll (line 1075) | def poll(cls, context):
    method execute (line 1088) | def execute(self, context):
  function EsculturaMaskDef (line 1095) | def EsculturaMaskDef():
  class EsculturaMask (line 1105) | class EsculturaMask(bpy.types.Operator):
    method poll (line 1111) | def poll(cls, context):
    method execute (line 1124) | def execute(self, context):
  function MaterialTransparentePosDef (line 1131) | def MaterialTransparentePosDef():
  function MaterialTransparentePreDef (line 1163) | def MaterialTransparentePreDef():
  class MaterialTransparenteDois (line 1195) | class MaterialTransparenteDois(bpy.types.Operator):
    method execute (line 1200) | def execute(self, context):
  function MaterialTranspPreDef (line 1220) | def MaterialTranspPreDef():
  class MaterialTranspPre (line 1223) | class MaterialTranspPre(bpy.types.Operator):
    method execute (line 1228) | def execute(self, context):
  function MaterialTranspPosDef (line 1235) | def MaterialTranspPosDef():
  class MaterialTranspPos (line 1239) | class MaterialTranspPos(bpy.types.Operator):
    method execute (line 1244) | def execute(self, context):
  class MaterialOpacoDois (line 1250) | class MaterialOpacoDois(bpy.types.Operator):
    method execute (line 1255) | def execute(self, context):
  function RhinFotogrametriaDecDef (line 1278) | def RhinFotogrametriaDecDef():
  class RhinFotogrametriaDec (line 1289) | class RhinFotogrametriaDec(bpy.types.Operator):
    method execute (line 1295) | def execute(self, context):

FILE: SegmentaImagens.py
  function SegmentacaoImagemFaceDef (line 9) | def SegmentacaoImagemFaceDef():
  class SegmentacaoImagemFace (line 130) | class SegmentacaoImagemFace(bpy.types.Operator):
    method execute (line 135) | def execute(self, context):

FILE: TomoReconsRapida.py
  function GeraModelo3DTomo (line 10) | def GeraModelo3DTomo(ossos, mole, dentes):
  function CorrigeTomoRawDef (line 36) | def CorrigeTomoRawDef():
  class CorrigeTomoRaw (line 54) | class CorrigeTomoRaw(bpy.types.Operator):
    method execute (line 60) | def execute(self, context):
  function TomoRecRapidaDef (line 67) | def TomoRecRapidaDef():
  class TomoRecRapida (line 325) | class TomoRecRapida(bpy.types.Operator):
    method execute (line 331) | def execute(self, context):

FILE: __init__.py
  class ORTOG_PT_AtualizaAddonSec (line 73) | class ORTOG_PT_AtualizaAddonSec(bpy.types.Panel):
    method draw (line 80) | def draw(self, context):
  class ORTOG_PT_NomePaciente (line 94) | class ORTOG_PT_NomePaciente(bpy.types.Panel):
    method draw (line 101) | def draw(self, context):
  class ORTOG_UI_Local (line 136) | class ORTOG_UI_Local(PropertyGroup):
  class ENUM_VALUES_CTSCAN (line 189) | class ENUM_VALUES_CTSCAN:
  class ORTOG_PT_CTScanSelect (line 198) | class ORTOG_PT_CTScanSelect(bpy.types.Panel):
    method draw (line 205) | def draw(self, context):
  class ORTOG_OT_GeraModelosTomoArc (line 524) | class ORTOG_OT_GeraModelosTomoArc(bpy.types.Operator):
    method execute (line 529) | def execute(self, context):
  class ORTOG_PT_ImportaArc (line 534) | class ORTOG_PT_ImportaArc(bpy.types.Panel):
    method draw (line 541) | def draw(self, context):
  class ORTOG_PT_GraphicRefs (line 704) | class ORTOG_PT_GraphicRefs(bpy.types.Panel):
    method draw (line 711) | def draw(self, context):
  class ORTOG_PT_Segmentation (line 778) | class ORTOG_PT_Segmentation(bpy.types.Panel):
    method draw (line 785) | def draw(self, context):
  class ORTOG_PT_SegmentacaoFace (line 997) | class ORTOG_PT_SegmentacaoFace(bpy.types.Panel):
    method draw (line 1004) | def draw(self, context):
  class ORTOG_PT_Converte_Video (line 1018) | class ORTOG_PT_Converte_Video(bpy.types.Panel):
    method draw (line 1025) | def draw(self, context):
  class ENUM_VALUES_PHOTOGRAMMETRY (line 1039) | class ENUM_VALUES_PHOTOGRAMMETRY:
  class ORTOG_PT_Fotogrametria (line 1046) | class ORTOG_PT_Fotogrametria(bpy.types.Panel):
    method draw (line 1053) | def draw(self, context):
  class ORTOG_PT_AlinhaFace (line 1151) | class ORTOG_PT_AlinhaFace(bpy.types.Panel):
    method draw (line 1158) | def draw(self, context):
  class ORTOG_PT_FotogramModif (line 1231) | class ORTOG_PT_FotogramModif(bpy.types.Panel):
    method draw (line 1238) | def draw(self, context):
  class ORTOG_PT_AlinhaFaceCT (line 1262) | class ORTOG_PT_AlinhaFaceCT(bpy.types.Panel):
    method draw (line 1269) | def draw(self, context):
  class ENUM_VALUES_ANATOMICAL (line 1333) | class ENUM_VALUES_ANATOMICAL:
  class ORTOG_PT_PontosAnatomicos (line 1341) | class ORTOG_PT_PontosAnatomicos(bpy.types.Panel):
    method draw (line 1348) | def draw(self, context):
  class ENUM_VALUES_CEFALOMETRIA (line 1685) | class ENUM_VALUES_CEFALOMETRIA:
  class ORTOG_PT_Cefalometria (line 1689) | class ORTOG_PT_Cefalometria(bpy.types.Panel):
    method draw (line 1696) | def draw(self, context):
  class ENUM_VALUES_OSTEOTOMY (line 2241) | class ENUM_VALUES_OSTEOTOMY:
  class ORTOG_PT_Osteotomia (line 2247) | class ORTOG_PT_Osteotomia(bpy.types.Panel):
    method draw (line 2254) | def draw(self, context):
  class ENUM_VALUES_DYNAMIC (line 2392) | class ENUM_VALUES_DYNAMIC:
  class ORTOG_PT_ArmatureDynamic (line 2397) | class ORTOG_PT_ArmatureDynamic(bpy.types.Panel):
    method draw (line 2404) | def draw(self, context):
  class ORTOG_PT_CinematicaPanel (line 2504) | class ORTOG_PT_CinematicaPanel(bpy.types.Panel):
    method draw (line 2511) | def draw(self, context):
  class ORTOG_PT_FechaLabios (line 2768) | class ORTOG_PT_FechaLabios(bpy.types.Panel):
    method draw (line 2775) | def draw(self, context):
  class ENUM_VALUES_ARCHSCOLLISION (line 2816) | class ENUM_VALUES_ARCHSCOLLISION:
  class ORTOG_PT_GuideCreation (line 2820) | class ORTOG_PT_GuideCreation(bpy.types.Panel):
    method draw (line 2827) | def draw(self, context):
  class ORTOG_PT_ImportTomoImg (line 3051) | class ORTOG_PT_ImportTomoImg(bpy.types.Panel):
    method draw (line 3058) | def draw(self, context):
  class ORTOG_PT_Render (line 3093) | class ORTOG_PT_Render(bpy.types.Panel):
    method draw (line 3099) | def draw(self, context):
  function register (line 3106) | def register():
  function unregister (line 3394) | def unregister():
Condensed preview — 47 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,162K chars).
[
  {
    "path": "AjustaTomo.py",
    "chars": 19903,
    "preview": "import bpy\nimport os\nimport os.path\nimport json\nimport re\nimport shutil\n# from datetime import datetime\nimport tempfile\n"
  },
  {
    "path": "AlinhaObjetos.py",
    "chars": 27847,
    "preview": "import bpy\nimport math\n\nfrom .FerrMalhas import *\n\n# MENSAGENS\n\nclass MessageSelecioneObjAlinhar(bpy.types.Operator):\n  "
  },
  {
    "path": "AlinhaRedimensiona.py",
    "chars": 6648,
    "preview": "import bpy\nimport math\nimport fnmatch\n\n# MENSAGENS\n\nclass MessageSelecioneObj(bpy.types.Operator):\n    bl_idname = \"obje"
  },
  {
    "path": "AtualizaScript.py",
    "chars": 2669,
    "preview": "import bpy\r\nimport subprocess\r\nimport platform\r\nfrom os.path import expanduser\r\n\r\ndef AtualizaScriptDef(self, context):\r"
  },
  {
    "path": "BooleanaOsteo.py",
    "chars": 40034,
    "preview": "import bpy\nimport os\nimport tempfile\nimport subprocess\nimport platform\nfrom os.path import expanduser\n\nclass MessageErro"
  },
  {
    "path": "CalculaPontos.py",
    "chars": 9183,
    "preview": "import bpy\n\ndef capturaINI(ObjSelecionado):\n    bpy.ops.object.select_all(action='DESELECT')\n    Objeto = bpy.data.objec"
  },
  {
    "path": "Cefalometria.py",
    "chars": 37308,
    "preview": "import bpy\nimport math\nfrom .FerrMedidas import *\n\ndef CursorToSelectedObj(objeto):\n\n    context = bpy.context\n    scn ="
  },
  {
    "path": "CompareOnBlender.py",
    "chars": 4876,
    "preview": "import bpy\n#import platform\n\nfrom .CompareTools import *\n\nclass FORENSIC_PT_PontosFace17(bpy.types.Panel):\n    bl_label "
  },
  {
    "path": "CompareTools.py",
    "chars": 27192,
    "preview": "import bpy\nfrom .Cefalometria import *\nfrom .GeraRelatorio import *\nfrom .PontosAnatomicos import *\nfrom .FerrMedidas im"
  },
  {
    "path": "ConfOsteotomiaAuto.py",
    "chars": 25368,
    "preview": "import bpy\nimport platform\nimport bmesh\nfrom random import randint\n\nfrom .FerrImgTomo import *\n\n# MENSAGENS\n\ndef CriaMat"
  },
  {
    "path": "CortaOssoFibula.py",
    "chars": 4091,
    "preview": "import fnmatch\n\nfrom .PontosAnatomicos import *\n\n# Pontos\n\nclass Cut_Point_pt(bpy.types.Operator):\n    \"\"\"Tooltip\"\"\"\n   "
  },
  {
    "path": "CriaSplint.py",
    "chars": 18981,
    "preview": "import bpy\nimport platform\nimport time\nfrom random import randint\n\n# IMPORTA SPLINT COM ARMATURE\n\ndef ImportaSplintDef(s"
  },
  {
    "path": "DesenhaGuia.py",
    "chars": 3702,
    "preview": "import bpy\nimport fnmatch\nimport bmesh\nimport time\n\ndef DesenhaGuiaDef(self, context):\n    \n    context = bpy.context\n  "
  },
  {
    "path": "DesenhaObjetos.py",
    "chars": 52933,
    "preview": "import bpy\nimport fnmatch\nimport bmesh\nimport time\n\nfrom bpy.types import (Panel,\n                       Operator,\n     "
  },
  {
    "path": "DinamicaMole.py",
    "chars": 24299,
    "preview": "import bpy\nimport bmesh\nfrom mathutils import Matrix # Deformação do nariz\n\ndef AreasInfluenciaDef(self, context):\n\n    "
  },
  {
    "path": "FerrFisica.py",
    "chars": 16445,
    "preview": "import bpy\nimport fnmatch\n\ndef ColisaoArcosDef():\n\n    context = bpy.context\n    scn = context.scene\n\n    bpy.context.sc"
  },
  {
    "path": "FerrImgTomo.py",
    "chars": 53646,
    "preview": "import bpy\nimport os\nimport pydicom as dicom\nimport subprocess\nimport tempfile\nimport platform\nfrom os.path import expan"
  },
  {
    "path": "FerrMalhas.py",
    "chars": 2821,
    "preview": "import bpy\n\n\ndef FechaMoldeSimplesDef(self, context):\n\n    context = bpy.context\n    obj = context.object\n    scn = cont"
  },
  {
    "path": "FerrMedidas.py",
    "chars": 19478,
    "preview": "import bpy\nimport math\nfrom math import sqrt\n\ndef CriaPontoMedidasDef():\n\n    context = bpy.context\n    objInicial = con"
  },
  {
    "path": "FerrSegmentacao.py",
    "chars": 45990,
    "preview": "\nimport bpy\nimport bmesh\nimport tempfile\nimport subprocess\nimport platform\n\n#from .__init__ import *\n\nfrom .AjustaTomo i"
  },
  {
    "path": "ForensicOnBlender.py",
    "chars": 15576,
    "preview": "import bpy\nimport platform\nfrom .__init__ import *\nfrom .ForensicTools import *\nfrom .Version import *\n\nclass FORENSIC_P"
  },
  {
    "path": "ForensicTools.py",
    "chars": 39742,
    "preview": "import bpy\nimport re\nimport platform\nimport subprocess\nimport tempfile\n\nfrom datetime import datetime\n\nfrom .PontosAnato"
  },
  {
    "path": "FotogrametriaMeshroom.py",
    "chars": 10210,
    "preview": "import bpy\nimport subprocess\nimport platform\nfrom os.path import expanduser\nimport shutil\nimport tempfile\nfrom os import"
  },
  {
    "path": "FotogrametriaOpenMVG.py",
    "chars": 24530,
    "preview": "import bpy\nimport subprocess\nimport platform\nfrom os.path import expanduser\nimport shutil\nimport tempfile\nfrom os import"
  },
  {
    "path": "FotogrametriaOpenMVGWinWSL.py",
    "chars": 22208,
    "preview": "import bpy\nimport subprocess\nimport platform\nfrom os.path import expanduser\nimport shutil\nimport tempfile\nfrom os import"
  },
  {
    "path": "FotogrametriaSMVS.py",
    "chars": 13038,
    "preview": "import bpy\nimport subprocess\nimport platform\nfrom os.path import expanduser\nimport shutil\nimport tempfile\nimport bmesh\nf"
  },
  {
    "path": "GeraModelosTomo.py",
    "chars": 141304,
    "preview": "import bpy\nimport platform\nimport tempfile\nimport subprocess\nimport multiprocessing\nimport os\nimport pydicom\nimport shut"
  },
  {
    "path": "GeraRelatorio.py",
    "chars": 10081,
    "preview": "import bpy\nimport csv\nimport tempfile\nimport subprocess\nimport openpyxl\nimport platform\nfrom string import ascii_upperca"
  },
  {
    "path": "ImportaObjMat.py",
    "chars": 1482,
    "preview": "import bpy\nimport platform\n\ndef ImportaMaterial(impMaterial, SelObj):\n\n    context = bpy.context\n    obj = context.activ"
  },
  {
    "path": "ListaArquivos.txt",
    "chars": 19998,
    "preview": "/tmp/tmptqwi9nhvCOPY/IMG0074.dcm\n/tmp/tmptqwi9nhvCOPY/IMG0566.dcm\n/tmp/tmptqwi9nhvCOPY/IMG0574.dcm\n/tmp/tmptqwi9nhvCOPY/"
  },
  {
    "path": "MicrosGenerate3D.mlx",
    "chars": 1965,
    "preview": "<!DOCTYPE FilterScript>\n<FilterScript>\n <filter name=\"Compute normals for point sets\">\n  <Param description=\"Neighbour n"
  },
  {
    "path": "NomePaciente.py",
    "chars": 41813,
    "preview": "import bpy\nfrom os.path import expanduser\nimport os\n\n# MENSAGENS\n\nclass PatientName(bpy.types.Operator):\n    bl_idname ="
  },
  {
    "path": "OrtogMeshes.py",
    "chars": 10930,
    "preview": "import bpy\n\nfrom random import randint\nfrom mathutils import Matrix, Vector\n\nfrom bpy.types import (Panel,\n             "
  },
  {
    "path": "OtherOnBlender.py",
    "chars": 15229,
    "preview": "import bpy\nimport platform\nfrom .__init__ import *\nfrom .Version import *\nfrom .FerrSegmentacao import *\nfrom .CortaOsso"
  },
  {
    "path": "Poisson.py",
    "chars": 3063,
    "preview": "import bpy\nimport tempfile\nimport platform\nimport subprocess\nimport shutil\n\ndef PoissonDef(self, context):\n\n    tmpdir ="
  },
  {
    "path": "PontosAnatomicos.py",
    "chars": 73013,
    "preview": "import bpy\nimport bmesh\nfrom math import sqrt\nimport fnmatch\n\n# OCULTAR MOSTRAR Pontos\n\ndef PontosMostraNomesDef(self, c"
  },
  {
    "path": "README.md",
    "chars": 5232,
    "preview": "**OrtogOnBlender**\n==================\n![GitHub Logo](http://www.ciceromoraes.com.br/ups/OrtogOnBlender.jpg)\n<h2>História"
  },
  {
    "path": "RelatorioAnimacao.py",
    "chars": 433,
    "preview": "import bpy\n\ndef AnimaLocRotDef(self, context):\n\n    context = bpy.context\n    scn = context.scene\n\n    bpy.ops.anim.keyf"
  },
  {
    "path": "RhinOnBlender.py",
    "chars": 27458,
    "preview": "import bpy\nimport platform\nfrom .__init__ import *\nfrom .RhinTools import *\nfrom .Version import *\nfrom .RhinOpenGL impo"
  },
  {
    "path": "RhinOpenGL.py",
    "chars": 4124,
    "preview": "import bpy\nimport gpu\nimport bgl\nfrom gpu_extras.batch import batch_for_shader\n\ndef LinhasCentraisCria():\n\n    CantusRig"
  },
  {
    "path": "RhinTools.py",
    "chars": 39114,
    "preview": "import bpy\nfrom .PontosAnatomicos import *\nfrom .Cefalometria import *\nfrom .FerrMedidas import *\nfrom .FerrImgTomo impo"
  },
  {
    "path": "SegmentaImagens.py",
    "chars": 6857,
    "preview": "import bpy\nimport tempfile\nimport platform\nimport os\n\nfrom .AjustaTomo import *\nfrom .FotogrametriaOpenMVG import *\n\ndef"
  },
  {
    "path": "TomoReconsRapida.py",
    "chars": 10099,
    "preview": "import bpy\nimport os\nimport pydicom as dicom\nfrom collections import Counter\nimport tempfile\nimport shutil\nimport subpro"
  },
  {
    "path": "Version.py",
    "chars": 40,
    "preview": "import bpy\n\nVERSION = \"2020-08-18a-lin\"\n"
  },
  {
    "path": "__init__.py",
    "chars": 122291,
    "preview": "bl_info = {\n    \"name\": \"New Object\",\n    \"author\": \"Your Name Here\",\n    \"version\": (1, 0),\n    \"blender\": (2, 80, 0),\n"
  }
]

// ... and 2 more files (download for full content)

About this extraction

This page contains the full source code of the cogitas3d/OrtogOnBlender GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 47 files (1.1 MB), approximately 286.6k tokens, and a symbol index with 1369 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!