Skip to content

Commit

Permalink
Simplify osteotomy translation button
Browse files Browse the repository at this point in the history
  • Loading branch information
cogitas3d committed Dec 30, 2018
1 parent bc1cf72 commit 6715b53
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 40 deletions.
53 changes: 51 additions & 2 deletions CalculaPontos.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def apagaObjeto(ObjSelecionado):



def capturaINItodosDef(self, context):
def capturaINItodosDef():
capturaINI('EMP11')
capturaINI('EMP21')
capturaINI('EMP13')
Expand All @@ -52,7 +52,7 @@ def capturaINItodosDef(self, context):
capturaINI('EMPMentonL')
capturaINI('EMPMentonR')

def capturaFINtodosDef(self, context):
def capturaFINtodosDef():
capturaFIN('EMP11')
capturaFIN('EMP21')
capturaFIN('EMP13')
Expand Down Expand Up @@ -98,12 +98,33 @@ def calculaDeslocamento(obj, obj1, obj2):
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'
Expand Down Expand Up @@ -180,4 +201,32 @@ def geraDeslocamentoTODOSDef(self, context):
apagaObjeto('EMPMentonR.INI')
apagaObjeto('EMPMentonR.FIN')

# 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'}
45 changes: 7 additions & 38 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,37 +148,6 @@ def execute(self, context):
AtualizaScriptDef(self, context)
return {'FINISHED'}

# 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'}

#ABRE TEMPORARIO

class AbreTMP(bpy.types.Operator):
Expand Down Expand Up @@ -1627,9 +1596,9 @@ def draw(self, context):
row = layout.row()
row.label(text="Capturing:")

row = layout.row()
row.operator("object.captura_ini_todos", text="Start Cap", icon="TRIA_LEFT_BAR")
row.operator("object.captura_fin_todos", text="End Cap", icon="TRIA_RIGHT_BAR")
# row = layout.row()
# row.operator("object.captura_ini_todos", text="Start Cap", icon="TRIA_LEFT_BAR")
# row.operator("object.captura_fin_todos", text="End Cap", icon="TRIA_RIGHT_BAR")

row = layout.row()
row.operator("object.gera_deslocamento_todos", text="Generate Data Action", icon="FULLSCREEN_ENTER")
Expand Down Expand Up @@ -1877,8 +1846,8 @@ def register():
bpy.utils.register_class(ImportaCameras)
bpy.utils.register_class(AtualizaScript)
bpy.utils.register_class(CorrigeDicom)
bpy.utils.register_class(capturaINItodos)
bpy.utils.register_class(capturaFINtodos)
# bpy.utils.register_class(capturaINItodos)
# bpy.utils.register_class(capturaFINtodos)
bpy.utils.register_class(geraDeslocamentoTODOS)
bpy.utils.register_class(AbreTMP)
bpy.utils.register_class(AjustaTomo)
Expand Down Expand Up @@ -2072,8 +2041,8 @@ def unregister():
bpy.utils.unregister_class(ImportaCameras)
bpy.utils.unregister_class(AtualizaScript)
bpy.utils.unregister_class(CorrigeDicom)
bpy.utils.unregister_class(capturaINItodos)
bpy.utils.unregister_class(capturaFINtodos)
# bpy.utils.unregister_class(capturaINItodos)
# bpy.utils.unregister_class(capturaFINtodos)
bpy.utils.unregister_class(geraDeslocamentoTODOS)
bpy.utils.unregister_class(AbreTMP)
bpy.utils.unregister_class(AjustaTomo)
Expand Down

0 comments on commit 6715b53

Please sign in to comment.