Wiki

PaulsProductionHelpers

Da Vinci

Features

The Scatter Mesh Tool has been built for artists that want to quickly scatter one or more objects on another object or surface. Select a few objects, and click "Add Selected", this will let the tool know which objects should be used for the scattering process. Configure additional settings like how many objects should be scattered, their transform offsets from vertices, their rotation, alignment to surface and scale.


Q: Do I need to keep my selection in order to unscatter a mesh?
A: No, the tool will figure out for you, what objects have been scattered on the mesh or surface you want to unscatter.


Q: Can I also make the tool scatter on surfaces instead of just meshes?
A: Currently you can't, but thats a feature currently in development!


The "In Dev" tab shows the user what features are currently being developed, and a small roadmap of what features are to be expected in the near future.


Q: Can I request features?
A: Yes! Please send your requests to pph@ambrosiussen.com


Q: How long does developing a feature take?
A: That solely depends on the complexity of the requested feature / tool. For a tool like the Channel Packer, it takes about a day.



Tool Development

PaulsProductionHelpers

PaulsProductionHelpers is a collection of tools combined in a toolbox, that automatically checks if the user is using the newest tool available. This prevents many issues like developers filing bugreports for older versions of the tool. It also ensures developers get the newest tools available to decrease their time spent on problemsolving and time consuming work, and instead get more time to be creative. The tool has two buttons at the bottom that the user can press should there be a problem, or for any questions. The "@" button opens up a contact form to email the developer, and the "?" button opens the wiki with the FAQ. To visit the FAQ and Wiki, please go here.

Just copy the script below and run it in Maya (Also save it on your tool-shelf for easy access).
Or Click HERE to download the toolbox.


#### PaulsProductionHelpers
##   
##    Author: Paul Ambrosiussen
##    Date Created: 01-07-2016
##    Questions & Support: paul@ambrosiussen.com
##
#### PaulsProductionHelpers

#IMPORT ALL REQUIRED LIB
#-----------------------
import sys, os, urllib2, zipfile

#### FOR POWER USERS, SPECIFY CUSTOM LOCATION ####
CustomDirectory = 'C:/PaulsProductionHelpers'
#### ---------------------------------------- ####

#Check user directory formatting
if CustomDirectory[-1] != '/':
	CustomDirectory+= '/'

#Function to return version number online copy
def GetVersionNumberOnline():
	return int(urllib2.urlopen('http://ambrosiussen.com/downloads/pyTools/PaulsProductionHelpers/version.txt').read())

#Function to return version number local copy
def GetVersionNumberLocal():
	return int(open(CustomDirectory + 'version.txt').read())

#Function to check if directory exists
def DoesDirectoryExist(a_dirLocation):
	return os.path.exists(a_dirLocation)

#Function to check if version file exists
def DoesVersionFileExist(a_dirLocation):
	return os.path.isfile(a_dirLocation+'version.txt')

#Function to create directory on provided location
def MakeDirectory(a_dirLocation):
	os.makedirs(a_dirLocation)

#Function to return 'has internet?'
def HasActiveInternetConnection():
	try:
		response = urllib2.urlopen('http://google.com',timeout=1)
		return True
	except urllib2.URLError as err: pass

	return False

#Function to display no internet popup
def NoInternetPopup():
    window = cmds.window( title='Error: No Internet Connection', iconName='Error', widthHeight=(450, 140), mnb=0, mxb=0, s=0 )
    cmds.columnLayout( adjustableColumn=1 )
    cmds.text( label='\nTo download this tool you need an active internet connection, or get a local copy.', ww=1, fn='boldLabelFont' )
    cmds.showWindow( window )

#Function to get latest tool version from server
def GetLatestToolVersion():
	t_zipLocation = CustomDirectory+'PaulsProductionHelpers.zip'

	try:
		#Download and save zipfile to disk
		t_zipFile = urllib2.urlopen('http://ambrosiussen.com/downloads/pyTools/PaulsProductionHelpers/download.php?dl=1')
		output = open(t_zipLocation,'wb')
		output.write(t_zipFile.read())
		output.close()

		#Unzip saved file to user specified location
		with zipfile.ZipFile(t_zipLocation) as zf:
			zf.extractall(CustomDirectory)

		#Cleanup downloaded zip file
		os.remove(t_zipLocation)

	except urllib2.URLError as err:
		NoInternetPopup()
		sys.exit()

def RunToolBox():
	#Add custom script location
	if CustomDirectory not in sys.path:
		sys.path.append(CustomDirectory)

	from Tools import ToolBox
	reload(ToolBox)

	ToolBox.run_plugin()

def MainFunction():

	t_activeConnection = False

	if HasActiveInternetConnection():
		t_activeConnection = True

		#Check if users local copy is latest version
		if DoesDirectoryExist(CustomDirectory) and DoesVersionFileExist(CustomDirectory):
			#Check version number
			if GetVersionNumberLocal() < GetVersionNumberOnline():

				#UPDATE
				urllib2.urlopen('http://ambrosiussen.com/downloads/pyTools/PaulsProductionHelpers/download.php?us=1')
				#Download latest version tool
				cmds.warning( 'USER HAS OLD VERSION, DOWNLOADING LATEST' )
				GetLatestToolVersion()
				
			else:
				#TOOL BEING USED
				cmds.warning( 'USER HAS LATEST, GOING TO RUN TOOL NOW' )


		else:
			#NEW DOWNLOAD
			urllib2.urlopen('http://ambrosiussen.com/downloads/pyTools/PaulsProductionHelpers/download.php?us=0')
			cmds.warning( 'FIRST TIME USE, DOWNLOADING ASSETS' )
			#Directory does not exist yet, therefore making one
			MakeDirectory(CustomDirectory)
			#Download latest version tool
			GetLatestToolVersion()

	else:
		cmds.warning( 'USER HAS NO INTERNET' )
		#Checking if user has a local copy we can run
		if not (DoesDirectoryExist(CustomDirectory) and DoesVersionFileExist(CustomDirectory)):
			NoInternetPopup()
			sys.exit()

	#Everything is set up, running tool
	if t_activeConnection: 
		urllib2.urlopen('http://ambrosiussen.com/downloads/pyTools/PaulsProductionHelpers/download.php?us=2')
	RunToolBox()

MainFunction()