export PYTHONPATH=$PYTHONPATH:$RMANTREE/bin
export PATH=$RMANTREE/bin:$PATH
export MAYA_USER_DIR=$HOME/Documents/maya
export RMS_SCRIPT_PATHS=$MAYA_USER_DIR/rfm_scripts/image_tool
RMANFB=it
# change directory below to where your cutter is
cd /Users/ddu/Desktop/ddu/projects/vsfx_705/cutter
# To uncomment the next line - remove the '#' character
java -Xms512m -Xmx512m -classpath .:cutter.jar Cutter
# script is called test.py but it # implements a module called "test"# a modules contrains attributes# an attribute can be, eg. name of a variable # the built-in datatypes are, nubmers, text(string),# (and collections) list, tuple, dictionary. file.age =26name ="tom"family ='jones'nationatlity ='welsh'# an attribute can also be the name of function #create functiondefperson() print(age)print(name)print(family)#creating list countries = []countries.append('usa')countries.append('china')countries.append('new zealand')countries.append('england')#countries.sort() #countries.reverse# using a tuple (fixed value list) - for vertices data structures transferlocked = (2,4,3,6,8,9)# i can test my code by printing some value # this call the values # but comment it out if used asa moduleperson()if __ name__ =='__main__':#person() #(debugging purposes) #for place in countries:# print(place)#print(countries[3])print(locked[0])#print(__name__) # return name of module from where it was run
# file_test.py# an example of how to store text in a document out_file=open('file directory', 'w')for n inrange(10): out_file.write('sphere -r 1;\n) out_file.write('move %f%f 0;\n'% (n,(n-2))) # placeholder %out_file.close()# to run the mel document in Maya use this mel...#source "filedirectory"
#vsfx705/cutter/using_test.py# only possible if the python files exist in the same directoryimport test from importlib importreloadprint(test.nationality)test.person
# importing randomimport randomval = random.uniform(0,1)print(val)for n inrange(10): val = random.uniform(0,1)if val>0.5:print(val)
# maya/scripts/gen_points.pyimport randomdefcubic(num,side): data = [] n =0while n < num: x = random.uniform(-side/2, side/2) y = random.uniform(-side/2, side/2) z = random.uniform(-side/2, side/2) data.append( (x,y,z) ) n = n +1return datadefbox(num,width,height,depth): data = [] n =0while n < num: x = random.uniform(-width/2, width/2) y = random.uniform(-height/2, height/2) z = random.uniform(-depth/2, depth/2) data.append( (x,y,z) ) n = n +1return data# how to create a spherical point cloud defspherical(num,radius):pass# define function but not implemented