Jump to content
Juraj

Juraj's playground

Recommended Posts

On 4/28/2017 at 9:31 PM, Juraj said:

Hello, thanks! Glad you like it :) Unfortunately I cannot share scripts because of the university policy, but will try to write a new one save incremental function :) 


# splits versioning string into letter and number, e.g. v025 -> ['v','025']
def verSplit(ver):
	head = ver.rstrip('0123456789')
	tail = ver[len(head):]
	return head, tail

# save incremental, tries to preserve version formatting
def saveInc():
	hipname = hou.getenv('HIPNAME')
	if hipname != 'untitled':
		v, num = verSplit( hipname.split("_")[-1] )
		num = str( int(num) + 1 ).zfill( len(num) )
		newName = hipname.split("_")
		newName[-1] = v + num
		newNameStr = hou.getenv('HIP') + "/" + "_".join(newName) + "." + hou.getenv('HIPFILE').split(".")[-1]
		hou.hipFile.save(newNameStr)
	else:
		print "cannot increment version name in untitled.hip"

 

Hi, thanks :) Maybe, but this setup is not very portable and was made for our pipeline. It would require a bit of work to prepare for release and to make it work in most of the environments.

LOD switching would not require much of work in this setup. Just computing distance to render camera and then thresholding it into an LOD attribute. But in our case manual decisions proved to be most suitable.

Hello Juraj,

I stumbled across your incremental save function and I just want to let you know it could be done also with following command:

hou.hipFile.saveAndIncrementFileName()

Anyway your work is very cool and inspiring. :)

Cheers

Peter

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×