Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Vignola authored Feb 11, 2023
1 parent 8b71f35 commit a5846fb
Show file tree
Hide file tree
Showing 14 changed files with 701 additions and 364 deletions.
Binary file added __pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/_generators.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/_language.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/attributes.cpython-37.pyc
Binary file not shown.
12 changes: 6 additions & 6 deletions _examples/perspective_image_planes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
"""

import maya.cmds as mc
import rig.commands as rc
import rig.nodes as rn
import rig.functions as rf
import rig2.commands as rc
import rig2.nodes as rn
import rig2.functions as rf

from rig.attributes import Int, Float, String, Enum, lock, hide
from rig import Node, List, container, condition
from rig import trigonometry as trig
from rig2.attributes import Int, Float, String, Enum, lock, hide
from rig2 import Node, List, container, condition
from rig2 import trigonometry as trig

from collections import namedtuple

Expand Down
42 changes: 16 additions & 26 deletions _examples/rail_spine.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@
"""

import maya.cmds as mc
import rig.commands as rc
import rig.nodes as rn
import rig.functions as rf
import rig2.commands as rc
import rig2.nodes as rn
import rig2.functions as rf
import numbers

from rig.attributes import Float, Vector, Enum, lock, hide
from rig import Node, List, container, condition
from rig import matrix
from rig import interpolate
from rig import constant
from rig._language import _is_sequence
from rig2.attributes import Float, Vector, Enum, lock, hide
from rig2 import Node, List, container, condition
from rig2 import matrix
from rig2 import interpolate
from rig2 import constant
from rig2._language import _is_sequence



Expand Down Expand Up @@ -498,30 +498,20 @@ def _order_controls(controls, position_controls):



#import rig
#import rig2
#rig2.options(create_container = True)

## set this to false to expose the crazyness within
#rig.options(create_container=True)

## create a few control locators and select them
#position_controls = rc.ls(sl=True) # will define the curve's control points
#orient_controls = position_controls # defines which controllers will orient the riders
#scale_controls = position_controls # defines which controllers will scale the riders

## pick u coordinates where "riders" will be positioned
#u = [x/10.0 for x in list(range(11))]

# Choose a Maya supported curve degree (1,2,3,5,7)
#import numpy as np
#position_controls = rc.ls(sl=True)
#u = np.linspace(0,1,20)
#degree = 3

# Choose if the curve is open or closed
#periodic = True


#create_rail(position_controls,
#u,
#scale_controls=scale_controls,
#orient_controls=orient_controls,
#scale_controls=position_controls,
#orient_controls=position_controls,
#degree=degree,
#periodic=periodic,
#aim_axis=1, up_axis=0)
Expand Down
8 changes: 5 additions & 3 deletions _language.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,8 +1163,7 @@ def _set_or_connect(src, dst, force=True):
sets attr or connects [src] to [dst]
[dst] is always presumed to be a Node with an attr
"""



# is src a node?
if _is_node(src):
if '.' in src:
Expand Down Expand Up @@ -1213,9 +1212,12 @@ def _set_or_connect(src, dst, force=True):
raise Exception("Don't know how to handle {} for set/plug purposes.".format(dst))


# Disconnect Attr
if src is None:
_disconnect_attr(str(dst))

# if destination is typed, trust the user knows what they want
if dst.__data__.type == 'typed':
elif dst.__data__.type == 'typed':
#print (f'compound to typed {src} ---> {dst}')
_set_or_connect(src, dst, force=force)

Expand Down
Binary file added _test/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added _test/__pycache__/test_interpolate.cpython-37.pyc
Binary file not shown.
Binary file added _test/__pycache__/test_node.cpython-37.pyc
Binary file not shown.
Binary file added _test/__pycache__/test_random.cpython-37.pyc
Binary file not shown.
2 changes: 0 additions & 2 deletions _test/test_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@
class TestInterpolate(unittest.TestCase):

def setUp(self):
print ('berp')
pass


def testElerp(self):

mc.file(new=True, f=True)
obj1 = polyCube()[0]
obj2 = polyCube()[0]
Expand Down
11 changes: 9 additions & 2 deletions _test/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,15 @@ def testInject(self):

self.assertEqual(mc.getAttr(str(obj3.t)), [(10.0, 20.0, 30.0)])




# Test disconnect attr
connections = bool(mc.listConnections(str(obj3.t), s=True, d=False, p=True))
self.assertEqual(connections, True)

obj3.t << None
connections = bool(mc.listConnections(str(obj3.t), s=True, d=False, p=True))
self.assertEqual(connections, False)


def testArithmetic(self):

Expand Down
Loading

0 comments on commit a5846fb

Please sign in to comment.