Skip to content

Commit

Permalink
Add support for 2 parameter style noise function.
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyDodo committed Jun 5, 2017
1 parent 9448e77 commit 48684b0
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions Opcodes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .OpcodeBaseTypes import Opcode, Opcode_DS, Opcode_DSS, Opcode_SDD
from .OpcodeBaseTypes import Opcode_DSSS, Opcode_DSI, Opcode_DIS, Opcode_D
from .OpcodeBaseTypes import Opcode_basicMath1, Opcode_basicMath

from .OSOVariable import OSOVariable

def float_range(start, stop, step):
while start < stop:
Expand Down Expand Up @@ -681,9 +681,26 @@ def Generate(self, nodeGraph):
nodeGraph.SetVar(self.Destination, node, 0)


class Opcode_noise(Opcode_DSS):
class Opcode_noise(Opcode):
def __init__(self, OSO, index):
Opcode_DSS.__init__(self, OSO, index)
Opcode.__init__(self, OSO, index)
self.Destination = OSO.GetVariable(self.Instuction.Parameters[0])
if (len(self.Instuction.Parameters) == 3):
self.Source1 = OSO.GetVariable(self.Instuction.Parameters[1])
self.Source2 = OSO.GetVariable(self.Instuction.Parameters[2])
elif (len(self.Instuction.Parameters) == 2):
self.Source1 = OSOVariable('const string uperlin "uperlin"')
self.Source2 = OSO.GetVariable(self.Instuction.Parameters[1])

def Destination(self):
return self.Destination

def Source1(self):
return self.Source1

def Source2(self):
return self.Source2


def Generate(self, nodeGraph):

Expand Down

0 comments on commit 48684b0

Please sign in to comment.