Skip to content

Commit

Permalink
fix using correct pip install
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo committed Jan 15, 2022
1 parent 4183590 commit e01004f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
27 changes: 27 additions & 0 deletions ops/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<<<<<<< Updated upstream
import os, subprocess
=======
import os
import sys
>>>>>>> Stashed changes
import json
from sre_constants import SUCCESS
import bpy
import bge_netlogic
import bge_netlogic.utilities as utils
Expand Down Expand Up @@ -42,6 +48,27 @@
]


class NLInstallUplogicModuleOperator(bpy.types.Operator):
bl_idname = "bge_netlogic.install_uplogic_module"
bl_label = "Install or Update Uplogic Module"
bl_description = (
'Downloads the latest version of the uplogic module required for '
'running logic nodes.\n\n'
'NOTE:This may take a few seconds and requires internet connection.'
)
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
utils.notify('Installing uplogic module...')
try:
os.system(f'{sys.executable} -m ensurepip')
os.system(f'{sys.executable} -m pip install uplogic')
utils.success('Installed.')
except Exception:
utils.error('Install failed.')
return {"FINISHED"}


class TreeCodeWriterOperator(bpy.types.Operator):
bl_idname = "bgenetlogic.treecodewriter_operator"
bl_label = "Timed code writer"
Expand Down
24 changes: 12 additions & 12 deletions ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ def draw_item(self, context, layout, data, item, icon, active_data, active_propn


class BGE_PT_GlobalValuePanel(bpy.types.Panel):
bl_label = "Globals"
bl_space_type = "NODE_EDITOR"
bl_region_type = "UI"
bl_category = "Dashboard"
bl_label = "Scene Game Properties"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = 'scene'
bl_category = "Global Values"

@classmethod
def poll(cls, context):
enabled = (context.space_data.tree_type == BGELogicTree.bl_idname)
return enabled
return True

def draw(self, context):
layout = self.layout
Expand Down Expand Up @@ -469,11 +469,11 @@ def draw(self, context):
text="Apply To Selected",
icon='PREFERENCES'
).owner = "BGE_PT_LogicPanel"
tree = context.space_data.edit_tree
if tree:
r = apply.row()
r.label(text='Apply As:')
r.prop(tree, 'mode', toggle=True, text='Component' if tree.mode else 'Bricks')
# tree = context.space_data.edit_tree
# if tree:
# r = apply.row()
# r.label(text='Apply As:')
# r.prop(tree, 'mode', toggle=True, text='Component' if tree.mode else 'Bricks')
code = layout.box()
code.operator(
bge_netlogic.ops.NLGenerateLogicNetworkOperator.bl_idname,
Expand Down Expand Up @@ -671,7 +671,7 @@ class BGELogicTree(bpy.types.NodeTree):
mode: bpy.props.BoolProperty(
name='Compile Mode',
default=False,
description='Whether to apply this tree using bricks or as a component.\nNOTE: Changing this value does not remove already applied trees',
description='Nope',
update=update_tree_mode
)

Expand Down

0 comments on commit e01004f

Please sign in to comment.