Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Fix docstring syntax (PEP8)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzBrueckner committed Oct 11, 2020
1 parent 31b708b commit 0181cb6
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion logicnode_definitions/Template.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

# class <NodeName>(ArmLogicTreeNode):
# '''<Short Desciption (optional)>'''
# """<Short Desciption (optional)>"""
# bl_idname = 'LN<NodeName>'
# bl_label = '<Name of the Node inside Blender>'
# bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/action_camera_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class CameraController(ArmLogicTreeNode):
'''CameraController'''
"""CameraController"""
bl_idname = 'LNCameraController'
bl_label = 'Camera Controller'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/action_look.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class LookNode(ArmLogicTreeNode):
'''Look Node'''
"""Look Node"""
bl_idname = 'LNLookNode'
bl_label = 'Look'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/action_looking_at.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class LookingAtNode(ArmLogicTreeNode):
'''Looking at Node'''
"""Looking at Node"""
bl_idname = 'LNLookingAtNode'
bl_label = 'Looking At'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/action_player_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class PlayerController(ArmLogicTreeNode):
'''PlayerController'''
"""PlayerController"""
bl_idname = 'LNPlayerController'
bl_label = 'Player Controller'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/animation_animation_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class AnimationControllerNode(ArmLogicTreeNode):
'''AnimationController node'''
"""AnimationController node"""
bl_idname = 'LNAnimationControllerNode'
bl_label = 'AnimationController'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/event_call_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class CallFunctionNode(ArmLogicTreeNode):
'''Call Function Node'''
"""Call Function Node"""
bl_idname = 'LNCallFunctionNode'
bl_label = 'Call Function'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/event_end_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class EndFunctionNode(ArmLogicTreeNode):
'''End Function Node'''
"""End Function Node"""
bl_idname = 'LNEndFunctionNode'
bl_label = 'End Function'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/event_return_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class ReturnFunctionNode(ArmLogicTreeNode):
'''Return Function Node'''
"""Return Function Node"""
bl_idname = 'LNReturnFunctionNode'
bl_label = 'Return Function'
bl_icon = 'CURVE_PATH'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/event_start_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class StartFunctionNode(ArmLogicTreeNode):
'''Start Function Node'''
"""Start Function Node"""
bl_idname = 'LNStartFunctionNode'
bl_label = 'Start Function'
bl_icon = 'CURVE_PATH'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/logic_array_loop_indice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class ArrayLoopIndiceNode(ArmLogicTreeNode):
'''ArrayLoop node avec indice'''
"""ArrayLoop node avec indice"""
bl_idname = 'LNArrayLoopIndiceNode'
bl_label = 'Array Loop Indice'
bl_icon = 'CURVE_PATH'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/logic_bool_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class BoolOperationNode(ArmLogicTreeNode):
'''Boolean Operations'''
"""Boolean Operations"""
bl_idname = 'LNBoolOperationNode'
bl_label = 'Boolean Operation'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/logic_number_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class CompareNumberNode(ArmLogicTreeNode):
'''Compares two numbers'''
"""Compares two numbers"""
bl_idname = 'LNCompareNumberNode'
bl_label = 'Compare Numbers'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/logic_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class TimerNode(ArmLogicTreeNode):
'''TimerNode'''
"""TimerNode"""
bl_idname = 'LNTimerNode'
bl_label = 'Timer Node'
bl_icon = 'QUESTION'
Expand Down
38 changes: 19 additions & 19 deletions logicnode_definitions/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class SaveSelectedNodesOperator(bpy.types.Operator):
name: bpy.props.StringProperty(name = "Node Name: ", description = "The Name of the exported Nodes", default = "exported_node")
library: bpy.props.StringProperty(name = "Library Name: ", description = "The Name of the Library into which the noder are being exported", default = "exported_nodes")
category: bpy.props.StringProperty(name = "Node Category: ", description = "The Category of the exported Nodes", default = "exported_nodes")


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

def execute(self, context):

invalidCharacters = [" ", ".", "/", "\\", ":", ";"]
Expand All @@ -29,12 +29,12 @@ def replaceInvalidCharacters(name):
fp = arm.utils.get_fp()

lfp = fp+"/Libraries"

if not os.path.exists(lfp):
os.makedirs(lfp)

enfp = lfp+"/"+library_name

if not os.path.exists(enfp):
os.makedirs(enfp)

Expand All @@ -44,7 +44,7 @@ def replaceInvalidCharacters(name):
bl_file.write("from "+library_name+"_definitions import *\n")
bl_file.write("def register():\n")
bl_file.write("\tarm.nodes_logic.register_nodes()\n")

ndfp = enfp+"/"+library_name+"_definitions"

if not os.path.exists(ndfp):
Expand All @@ -65,46 +65,46 @@ def replaceInvalidCharacters(name):
while os.path.isfile(ndfp+"/"+file_name+str(index)+".py"):
index += 1
file_name += str(index) + ".py"

node_file = open(ndfp+"/"+file_name,"w")
node_file.write("import bpy\n")
node_file.write("from bpy.props import *\n")
node_file.write("from bpy.types import Node, NodeSocket\n")
node_file.write("from arm.logicnode.arm_nodes import *\n")

# give the node the same name that is used for the file for now...
node_file.write("class {0}(Node, ArmLogicTreeNode):\n".format(node_name+"_"+str(index)))
node_file.write("\t'''{0}'''\n".format(node_name+"_"+str(index)))
node_file.write("class {0}(ArmLogicTreeNode):\n".format(node_name+"_"+str(index)))
node_file.write('\t"""{0}"""\n'.format(node_name+"_"+str(index)))
node_file.write("\tbl_idname=\"LN{0}\"\n".format(node_name+"_"+str(index)))
node_file.write("\tbl_label=\"{0}\"\n".format(node_name))
node_file.write("\tbl_icon=\"QUESTION\"\n")

node_file.write("\tdef init(self, context):\n")
node_file.write("\t\t# convenience functions\n")
node_file.write("\t\tdef placeNodeWithOffset(node, reference, offset):\n")
node_file.write("\t\t\tnode.location = [reference[0]+offset[0], reference[1]+offset[1]]\n\n")

# node_file.write("\t\tdef selectNodes(node_tree, nodes):\n")
# node_file.write("\t\t\tfor node in nodes:\n")
# node_file.write("\t\t\t\tnode.select = True\n\n")

# node_file.write("\t\tdef frameNodes(node_tree, nodes, title):\n")
# node_file.write("\t\t\tbpy.ops.node.select_all(action='DESELECT')\n")
# node_file.write("\t\t\tselectNodes(node_tree, nodes)\n")
# node_file.write("\t\t\tbpy.ops.node.join()\n")
# node_file.write("\t\t\tframe = node_tree.active\n")
# node_file.write("\t\t\tframe.label = title\n")
# node_file.write("\t\t\treturn frame\n\n")

node_file.write("\t\tdef linkNodes(node_links, node_1, node_2, output_socket_index, input_socket_index):\n")
node_file.write("\t\t\tlinks.new(node_1.outputs[output_socket_index], node_2.inputs[input_socket_index])\n\n")

node_file.write("\t\t# easy access\n")
node_file.write("\t\tnode_tree_nodes = bpy.context.space_data.node_tree.nodes\n")
node_file.write("\t\tlinks = bpy.context.space_data.node_tree.links\n")
node_file.write("\t\tloc = bpy.context.space_data.cursor_location\n\n")


node_tree = context.space_data.node_tree
nodes = context.selected_nodes
links = node_tree.links
Expand All @@ -117,7 +117,7 @@ def replaceInvalidCharacters(name):
node_file.write("\t\tnode_{0} = node_tree_nodes.new(\"{1}\")\n".format(replaceInvalidCharacters(node.name), node.bl_idname))
averageX += node.location[0]/len(nodes)
averageY += node.location[1]/len(nodes)

# position nodes, based on their distance to the average location
node_file.write("\t\t# create node layout\n")
for node in nodes:
Expand All @@ -132,7 +132,7 @@ def replaceInvalidCharacters(name):
off_y += parent.location[1]
parent = parent.parent
node_file.write("\t\tplaceNodeWithOffset(node_{0}, loc, [{1}, {2}])\n".format(replaceInvalidCharacters(node.name), node.location[0] + off_x - averageX, node.location[1] + off_y - averageY))

# handle frames
node_file.write("\t\t# handle parenting, this is needed for frames\n")
for node in nodes:
Expand Down Expand Up @@ -206,7 +206,7 @@ def replaceInvalidCharacters(name):
node_file.write("add_node({0}, category='{1}')".format(node_name+"_"+str(index), self.category))

return {'FINISHED'}

@classmethod
def poll(cls, context):
return context.space_data != None and context.space_data.type == 'NODE_EDITOR'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/physics_get_contact_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class GetContactCoordsNode(ArmLogicTreeNode):
'''Get contact coords Node'''
"""Get contact coords Node"""
bl_idname = 'LNGetContactCoordsNode'
bl_label = 'Get Contact Coords'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/value_lerp_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class LerpVectorsNode(ArmLogicTreeNode):
'''Lerp Vectors node'''
"""Lerp Vectors node"""
bl_idname = 'LNLerpVectorsNode'
bl_label = 'Lerp Vectors'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/value_quat_to_euler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class QuatToEulerNode(ArmLogicTreeNode):
'''QuatToEulerNode'''
"""QuatToEulerNode"""
bl_idname = 'LNQuatToEulerNode'
bl_label = 'Quat To Euler'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/value_seperate_quat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class SeparateQuatNode(ArmLogicTreeNode):
'''SeparateQuatNode'''
"""SeparateQuatNode"""
bl_idname = 'LNSeparateQuatNode'
bl_label = 'Separate Quat'
bl_icon = 'QUESTION'
Expand Down
2 changes: 1 addition & 1 deletion logicnode_definitions/variable_min_max.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from arm.logicnode.arm_nodes import *

class MinMaxNode(ArmLogicTreeNode):
'''Min/Max Node'''
"""Min/Max Node"""
bl_idname = 'LNMinMaxNode'
bl_label = 'Clamp Variable'
bl_icon = 'QUESTION'
Expand Down

0 comments on commit 0181cb6

Please sign in to comment.