def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_FloatSocket", "1.")
		self.inputs.new("mn_FloatSocket", "2.")
		self.inputs.new("mn_EmptySocket", "...")
		self.outputs.new("mn_FloatSocket", "Result")
		allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_StringSocket", "1.")
		self.inputs.new("mn_StringSocket", "2.")
		self.inputs.new("mn_EmptySocket", "...").passiveSocketType = "mn_StringSocket"
		self.outputs.new("mn_StringSocket", "Text")
		allowCompiling()
Esempio n. 3
0
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_StringSocket", "Text")
     self.inputs.new("mn_IntegerSocket", "Start").number = 0
     self.inputs.new("mn_IntegerSocket", "Length").number = 5
     self.outputs.new("mn_StringSocket", "Text")
     allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_MeshDataSocket", "Mesh Data")
		self.outputs.new("mn_VectorListSocket", "Vertex Locations")
		self.outputs.new("mn_EdgeIndicesListSocket", "Edges Indices")
		self.outputs.new("mn_PolygonIndicesListSocket", "Polygons Indices")
		allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_IntegerSocket", "Index")
		self.inputs.new("mn_IntegerSocket", "Width").number = 10
		self.inputs.new("mn_FloatSocket", "Distance").number = 3
		self.outputs.new("mn_VectorSocket", "Vector")
		allowCompiling()
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_VertexSocket", "Vertex")
     self.outputs.new("mn_VectorSocket", "Location")
     self.outputs.new("mn_VectorSocket", "Normal")
     self.outputs.new("mn_FloatListSocket", "Group Weights")
     allowCompiling()
Esempio n. 7
0
 def init(self, context):
     forbidCompiling()
     self.outputs.new("mn_FloatSocket", "Frame")
     self.outputs.new("mn_FloatSocket", "Start Frame")
     self.outputs.new("mn_FloatSocket", "End Frame")
     self.outputs.new("mn_FloatSocket", "Frame Rate")
     allowCompiling()
 def buildOutputSocket(self):
     forbidCompiling()
     connections = getConnectionDictionaries(self)
     self.outputs.clear()
     self.outputs.new(getSocketNameByDataType(self.convertType), "New")
     tryToSetConnectionDictionaries(self, connections)
     allowCompiling()
Esempio n. 9
0
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_ObjectSocket", "Object").showName = False
		self.outputs.new("mn_PolygonListSocket", "Polygons")
		self.outputs.new("mn_VertexListSocket", "Vertices")
		self.outputs.new("mn_MeshDataSocket", "Mesh Data")
		allowCompiling()
	def newInputSocket(self):
		forbidCompiling()
		newSocketName = str(len(self.inputs)) + "."
		newSocket = self.inputs.new("mn_StringSocket", newSocketName)
		self.inputs.move(len(self.inputs) - 1, len(self.inputs) - 2)
		allowCompiling()
		nodeTreeChanged()
Esempio n. 11
0
    def update(self):
        nodeTree = self.id_data
        treeInfo = NodeTreeInfo(nodeTree)

        listInput = treeInfo.getDataOriginSocket(self.inputs.get("List"))
        elementInput = treeInfo.getDataOriginSocket(self.inputs.get("Element"))
        listOutputs = treeInfo.getDataTargetSockets(self.outputs.get("List"))

        forbidCompiling()

        if listInput is not None and elementInput is None and len(
                listOutputs) == 0:
            self.generateSockets(listInput.bl_idname)
            nodeTree.links.new(self.inputs.get("List"), listInput)

        if listInput is None and elementInput is not None and len(
                listOutputs) == 0:
            self.generateSockets(getListSocketType(elementInput.bl_idname))
            nodeTree.links.new(self.inputs.get("Element"), elementInput)

        if listInput is None and elementInput is None and len(
                listOutputs) == 1:
            self.generateSockets(listOutputs[0].bl_idname)
            nodeTree.links.new(listOutputs[0], self.outputs.get("List"))

        allowCompiling()
	def addProperty(self, propertyName):
		"""This function called to add a shape key socket as input/output or both according to propertyIOType attribute of the node.
		
		Note:
			The new node socket has enabled attribute False, so execution string load it's proper value and enable it.
		
		Args:
			propertyName (str): The name of the property.
		"""
		forbidCompiling()
		# if propertyIOType is INPUT or BOTH add new input socket to the node
		if self.propertyIOType != 'OUTPUT':
			try:
				# Search for existing socket with the same name so no duplicates exists
				socket = self.inputs[propertyName]
			except KeyError:
				socket = self.inputs.new("mn_FloatSocket", propertyName)
			socket.removeable = True
			socket.callNodeToRemove = True
			socket.enabled = False
		# if propertyIOType is OUTPUT or BOTH add new output socket to the node
		if self.propertyIOType != 'INPUT':
			try:
				# Search for existing socket with the same name so no duplicates exists
				socket = self.outputs[propertyName]
			except KeyError:
				socket = self.outputs.new("mn_FloatSocket", propertyName)
			socket.removeable = True
			socket.callNodeToRemove = True
		allowCompiling()
		nodeTreeChanged()
Esempio n. 13
0
	def updateSockets(self, socketStartValue = (None, None)):
		forbidCompiling()
		startNode = self.getStartNode()
		if startNode is None:
			self.resetSockets()
		else:
			connections = getConnectionDictionaries(self)
			self.resetSockets()
			fromListSockets, fromSingleSockets = startNode.getSocketDescriptions()
			
			self.inputs["Amount"].hide = len(fromListSockets) != 0
			
			for socket in fromListSockets:
				idName = self.getSocketTypeForListSocket(socket.bl_idname)
				self.inputs.new(idName, socket.customName + " List", socket.identifier + "list")
				self.outputs.new(idName, socket.customName + " List", socket.identifier + "list")
				
			for socket in fromSingleSockets:
				inputSocket = self.inputs.new(socket.bl_idname, socket.customName, socket.identifier)
				if socket == socketStartValue[0]:
					inputSocket.setStoreableValue(socketStartValue[1])
				self.outputs.new(socket.bl_idname, socket.customName, socket.identifier)
				
			tryToSetConnectionDictionaries(self, connections)
		allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.width = 200
		self.inputs.new("mn_ObjectSocket", "Object").showName = False
		self.inputs.new("mn_GenericSocket", "Value")
		self.outputs.new("mn_ObjectSocket", "Object")
		allowCompiling()
Esempio n. 15
0
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_FloatSocket", "Factor")
		self.inputs.new("mn_ColorSocket", "Color 1")
		self.inputs.new("mn_ColorSocket", "Color 2")
		self.outputs.new("mn_ColorSocket", "Color")
		allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_IntegerSocket", "Seed")
		self.inputs.new("mn_FloatSocket", "Min").number = 0.0
		self.inputs.new("mn_FloatSocket", "Max").number = 1.0
		self.outputs.new("mn_FloatSocket", "Float Value")
		allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_IntegerSocket", "Seed")
		self.inputs.new("mn_IntegerSocket", "Length").number = 5
		self.inputs.new("mn_StringSocket", "Characters").string = "abcdefghijklmnopqrstuvwxyz"
		self.outputs.new("mn_StringSocket", "Text")
		allowCompiling()
Esempio n. 18
0
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_VectorSocket", "Position")
     self.inputs.new("mn_VectorSocket", "Rotation")
     self.inputs.new("mn_VectorSocket", "Scale").vector = [1, 1, 1]
     self.outputs.new("mn_MatrixSocket", "Matrix")
     allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_ObjectSocket", "Object").showName = False
		self.outputs.new("mn_PolygonListSocket", "Polygons")
		self.outputs.new("mn_VertexListSocket", "Vertices")
		self.outputs.new("mn_MeshDataSocket", "Mesh Data")
		allowCompiling()
Esempio n. 20
0
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_IntegerSocket", "Index")
     self.inputs.new("mn_IntegerSocket", "Width").number = 10
     self.inputs.new("mn_FloatSocket", "Distance").number = 3
     self.outputs.new("mn_VectorSocket", "Vector")
     allowCompiling()
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_FloatSocket", "Back").number = 1.70158
     self.outputs.new("mn_InterpolationSocket", "Interpolation")
     self.hideInputSockets()
     self.createCurveNode()
     allowCompiling()
Esempio n. 22
0
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_VertexSocket", "Vertex")
		self.outputs.new("mn_VectorSocket", "Location")
		self.outputs.new("mn_VectorSocket", "Normal")
		self.outputs.new("mn_FloatListSocket", "Group Weights")
		allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_FloatSocket", "Back").number = 1.70158
		self.outputs.new("mn_InterpolationSocket", "Interpolation")
		self.hideInputSockets()
		self.createCurveNode()
		allowCompiling()
	def addProperty(self, propertyName):
		"""This function called to add a modifier property socket as input/output or both according to propertyIOType attribute of the node.
		
		Note:
			The new node socket has enabled attribute False, so execution string load it's proper value and enable it.
			Needs modifierSubClass attribute of node to determine the type of the socket.
		
		Args:
			propertyName (str): The name of the property.
		"""
		socketType = getSocketTypeByDataPath("bpy.types." + self.modifierSubClass + ".bl_rna.properties['" + propertyName + "']")
#		print("Socket: ", socketType)
		forbidCompiling()
		# if propertyIOType is INPUT or BOTH add new input socket to the node
		if self.propertyIOType != 'OUTPUT' and socketType is not None:
			try:
				# Search for existing socket with the same name so no duplicates exists
				socket = self.inputs[propertyName]
			except KeyError:
				socket = self.inputs.new(socketType, propertyName)
			socket.removeable = True
			socket.callNodeToRemove = True
			socket.enabled = False
#TODO: replace '_' from name with ' '
		# if propertyIOType is OUTPUT or BOTH add new output socket to the node
		if self.propertyIOType != 'INPUT' and socketType is not None:
			try:
				# Search for existing socket with the same name so no duplicates exists
				socket = self.outputs[propertyName]
			except KeyError:
				socket = self.outputs.new(socketType, propertyName)
			socket.removeable = True
			socket.callNodeToRemove = True
		allowCompiling()
		nodeTreeChanged()
Esempio n. 25
0
	def buildOutputSocket(self):
		forbidCompiling()
		connections = getConnectionDictionaries(self)
		self.outputs.clear()
		self.outputs.new(getSocketNameByDataType(self.convertType), "New")
		tryToSetConnectionDictionaries(self, connections)
		allowCompiling()
Esempio n. 26
0
	def bakeSound(self):
		if self.filePath == "":
			return
		forbidCompiling()
		scene = bpy.context.scene
		oldFrame = scene.frame_current
		scene.frame_current = 1
		soundObject = self.getSoundObject()
		self.removeSoundCurves(soundObject)
		soundCombinations = [(0, 50), (50, 150), (150, 300), (300, 500), (500, 1000), (1000, 2000), (2000, 4000), (4000, 10000), (10000, 20000)]
		wm = bpy.context.window_manager
		wm.progress_begin(0.0, len(soundCombinations) - 1.0)
		wm.progress_update(0.0)
		for index, (low, high) in enumerate(soundCombinations):
			self.bakeIndividualSound(soundObject, self.filePath, low, high)
			wm.progress_update(index + 1.0)
		wm.progress_end()
		soundObject.hide = True
		self.name = re.sub(r"\W+", "", os.path.basename(self.filePath))
		loadSound(self.filePath)
		if self.setSyncMode:
			scene.sync_mode = "AUDIO_SYNC"
		scene.frame_current = oldFrame
		allowCompiling()
		nodeTreeChanged()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_VectorSocket", "Position")
		self.inputs.new("mn_VectorSocket", "Rotation")
		self.inputs.new("mn_VectorSocket", "Scale").vector = [1, 1, 1]
		self.outputs.new("mn_MatrixSocket", "Matrix")
		allowCompiling()
Esempio n. 28
0
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_StringSocket", "Text")
		self.inputs.new("mn_StringSocket", "Split By")
		self.outputs.new("mn_StringListSocket", "Text List")
		self.outputs.new("mn_IntegerSocket", "Length")
		allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_VectorSocket", "Vector")
		self.outputs.new("mn_FloatSocket", "X")
		self.outputs.new("mn_FloatSocket", "Y")
		self.outputs.new("mn_FloatSocket", "Z")
		allowCompiling()
Esempio n. 30
0
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_FloatSocket", "Factor").setMinMax(0, 1)
		self.inputs.new("mn_InterpolationSocket", "Interpolation 1").showName = False
		self.inputs.new("mn_InterpolationSocket", "Interpolation 2").showName = False
		self.outputs.new("mn_InterpolationSocket", "Interpolation")
		allowCompiling()
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_FloatSocket", "1.")
     self.inputs.new("mn_FloatSocket", "2.")
     self.inputs.new("mn_EmptySocket", "...")
     self.outputs.new("mn_FloatSocket", "Result")
     allowCompiling()
Esempio n. 32
0
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_StringSocket", "Text")
		self.inputs.new("mn_IntegerSocket", "Start").number = 0
		self.inputs.new("mn_IntegerSocket", "Length").number = 5
		self.outputs.new("mn_StringSocket", "Text")
		allowCompiling()
Esempio n. 33
0
	def init(self, context):
		forbidCompiling()
		self.outputs.new("mn_FloatSocket", "Frame")
		self.outputs.new("mn_FloatSocket", "Start Frame")
		self.outputs.new("mn_FloatSocket", "End Frame")
		self.outputs.new("mn_FloatSocket", "Frame Rate")
		allowCompiling()
Esempio n. 34
0
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_IntegerSocket", "Amount").number = 5
		self.inputs.new("mn_FloatSocket", "Start")
		self.inputs.new("mn_FloatSocket", "Step").number = 1
		self.outputs.new("mn_FloatListSocket", "List")
		allowCompiling()
Esempio n. 35
0
	def customSocketNameChanged(self, socket):
		forbidCompiling()
		if socket.name != emptySocketName:
			if self.enableUINameConversion:
				socket.name = convertVariableNameToUI(socket.customName)
			else:
				socket.name = socket.customName
		allowCompiling()
	def generateInputSockets(self):
		forbidCompiling()
		connections = getConnectionDictionaries(self)
		self.inputs.clear()
		for i in range(self.amount):
			self.inputs.new("mn_IntegerSocket", "Index " + str(i)).number = i
		tryToSetConnectionDictionaries(self, connections)
		allowCompiling()
Esempio n. 37
0
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_MeshSocket", "Mesh")
     socket = self.inputs.new("mn_FloatSocket", "Distance")
     socket.number = 0.0001
     socket.setMinMax(0.0, 10000.0)
     self.outputs.new("mn_MeshSocket", "Mesh")
     allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_BooleanSocket", "Condition")
		self.inputs.new("mn_GenericSocket", "If True")
		self.inputs.new("mn_GenericSocket", "If False")
		self.outputs.new("mn_GenericSocket", "Output")
		self.outputs.new("mn_GenericSocket", "Other")
		allowCompiling()
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_BooleanSocket", "Condition")
     self.inputs.new("mn_GenericSocket", "If True")
     self.inputs.new("mn_GenericSocket", "If False")
     self.outputs.new("mn_GenericSocket", "Output")
     self.outputs.new("mn_GenericSocket", "Other")
     allowCompiling()
Esempio n. 40
0
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_ObjectSocket", "Object").showName = False
     self.outputs.new("mn_MatrixSocket", "Basis")
     self.outputs.new("mn_MatrixSocket", "Local")
     self.outputs.new("mn_MatrixSocket", "Parent Inverse")
     self.outputs.new("mn_MatrixSocket", "World")
     allowCompiling()
Esempio n. 41
0
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_FloatSocket", "Red")
		self.inputs.new("mn_FloatSocket", "Green")
		self.inputs.new("mn_FloatSocket", "Blue")
		self.inputs.new("mn_FloatSocket", "Alpha").number = 1
		self.outputs.new("mn_ColorSocket", "Color")
		allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.width = 200
		self.inputs.new("mn_BooleanSocket", "Enable").value = False
		self.inputs.new("mn_BooleanSocket", "Set Keyframe")
		self.inputs.new("mn_BooleanSocket", "Remove Unwanted")
		self.inputs.new("mn_ObjectSocket", "Object")
		allowCompiling()
Esempio n. 43
0
 def init(self, context):
     forbidCompiling()
     self.outputs.new("mn_StringSocket", "Lower Case")
     self.outputs.new("mn_StringSocket", "Upper Case")
     self.outputs.new("mn_StringSocket", "Digits")
     self.outputs.new("mn_StringSocket", "Special")
     self.outputs.new("mn_StringSocket", "All")
     allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.outputs.new("mn_StringSocket", "Lower Case")
		self.outputs.new("mn_StringSocket", "Upper Case")
		self.outputs.new("mn_StringSocket", "Digits")
		self.outputs.new("mn_StringSocket", "Special")
		self.outputs.new("mn_StringSocket", "All")
		allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_ObjectSocket", "Object").showName = False
		self.outputs.new("mn_MatrixSocket", "Basis")
		self.outputs.new("mn_MatrixSocket", "Local")
		self.outputs.new("mn_MatrixSocket", "Parent Inverse")
		self.outputs.new("mn_MatrixSocket", "World")
		allowCompiling()
Esempio n. 46
0
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_IntegerSocket", "Seed")
     self.inputs.new("mn_IntegerSocket", "Length").number = 5
     self.inputs.new("mn_StringSocket",
                     "Characters").string = "abcdefghijklmnopqrstuvwxyz"
     self.outputs.new("mn_StringSocket", "Text")
     allowCompiling()
 def init(self, context):
     forbidCompiling()
     self.inputs.new("mn_BakedSoundSocket", "Sound")
     self.inputs.new("mn_FloatSocket", "Frequence")
     self.inputs.new("mn_FloatSocket", "Frame")
     self.outputs.new("mn_FloatListSocket", "Strengths")
     self.outputs.new("mn_FloatSocket", "Strength")
     allowCompiling()
	def init(self, context):
		forbidCompiling()
		self.inputs.new("mn_FloatSocket", "Frame")
		self.inputs.new("mn_FloatSocket", "From")
		self.inputs.new("mn_FloatSocket", "To")
		self.inputs.new("mn_ObjectSocket", "Object")
		
		allowCompiling()
 def init(self, context):
     forbidCompiling()
     self.width = 200
     self.inputs.new("mn_ObjectSocket", "Object").showName = False
     self.inputs.new("mn_StringSocket", "Attribute").string = ""
     self.inputs.new("mn_GenericSocket", "Value")
     self.outputs.new("mn_ObjectSocket", "Object")
     allowCompiling()
Esempio n. 50
0
    def init(self, context):
        forbidCompiling()
        self.inputs.new("mn_FloatSocket", "Frame")
        self.inputs.new("mn_FloatSocket", "From")
        self.inputs.new("mn_FloatSocket", "To")
        self.inputs.new("mn_ObjectSocket", "Object")

        allowCompiling()