Maya 2016 devkit

Okay, so i had ran myself into some problems while upgrading to 2016 and realized that i could not run some of the plugins for unknown reason.

Well, not reading docs was my problem… Autodesk no long inlcudes DEVKIT modules together with Maya and you have to get it standalone from their site.

here is a link for the future me.

 

MAYA 2016 DEVKIT

Logarithmic spiral – 3DS MaxScript

Okay, so i remember getting deeper into this spiral RnD, and had been working on understanding different types of spirals.

Here is a result of my RnD that i did a while ago, using MaxScript:

--Basic start point,
pCenter = Dummy()
pCenter.scale = point3 0.05 0.05 0.05
pCenter.pos = point3 0 0 0
centerX = pCenter.position.x
centerY = pCenter.position.y
centerZ = pcenter.position.z

/*
Thank you:
https://swiftcoder.wordpress.com/2010/06/21/logarithmic-spiral-distance-field/

HINT: convert to and from

radians = degrees * (pi/180)

degrees = radians * (180/pi)

*/


--initial vars from formula:r = ae^{b*theta}\,
a = 0.0  -- controls the starting angle
b = 0.1  -- controls how tightly the spiral is wound.
t = 0.0  -- this is start angle

theta = t * (pi/180)

across = atan(1/b)
end = 180.0 -- specify max degrees

for theta = 0 to end do 
(
	r = pow e (b*theta)
	r *=0.01
	
	print r
	x = centerX + cos(theta) * r
	y = centerY + sin(theta) * r
	
	pt = Dummy()
	pt.scale = point3 0.1 0.1 0.1
	pt.pos = point3 x y centerZ
	
)

Archimedean spiral in maxScript

Hi everyone,  i was going through some files on my HDD and found short script that i wrote while researching few topics. this was rather to understand what Spirals were, math behind them and so on. I came about a number of code examples that helped me understand it much better. Here is more about Spirals -> Archimedean spiral

Below is a snippet of 3d MaxScript that i made:

--Basic start point,
pCenter = Dummy()
pCenter.scale = point3 0.05 0.05 0.05
pCenter.pos = point3 0 0 0
centerX = pCenter.position.x
centerY = pCenter.position.y
centerZ = pcenter.position.z

/*
HINT: convert to and from

radians = degrees * (pi/180)

degrees = radians * (180/pi)

*/


--initial vars from formula:r=a+b*theta
a = 0.0  --this will be replaced in params via centerX and centerY
b = 1.0  -- this is distance for offset
t = 0.0  -- this is start angle
theta = t * (pi/180)


end = 1440.0 -- specify max degrees

for theta =0 to end do 
(
	r = a + theta * b
	r *=0.1
	x = centerX + cos(theta) * r
	y = centerY + sin(theta) * r
	
	pt = Dummy()
	pt.scale = point3 0.1 0.1 0.1
	pt.pos = point3 x y centerZ
	
)

python and IDE-Editors – Few things to remember

for daily work i use some more or less suitable IDE’s for python development, like PyCharm, or Eclipce with pydev.

but i cannot go without my sublime editor

sublime already packaged with default python interpreter, which is what makes it super powerful out of the box python programming tool for quick scripts that do not require any custom modules or what not.

but when there is a need to switch to system-default or alternative version of python,

you can create a simple configuration.

more about this is described here

A little bit from history, and wiki

Hey, so i am doing some research regarding proper date conversion from excel to python datetime object and had found myself digging deeper and deeper into explanations of how Julian day system works, what it means and how it is translated into today, there a quote that had made itself quite interesting to me:

Julian days begin at noon because when Herschel recommended them, the astronomical day began at noon. The astronomical day had begun at noon ever since Ptolemy chose to begin the days in his astronomical periods at noon. He chose noon because the transit of the Sun across the observer’s meridian occurs at the same apparent time every day of the year, unlike sunrise or sunset, which vary by several hours.

See more: WIKI>Julian_day

few python quickies

this is a snippet from an data-audit application i made for work.

i often have to convert between file sizes and these are just quick and handy functions to keep around.

def _printDict(d):
    for key, value in d.items():
        print '%s = %s' % (key, value)

def _formatSize(s):
    if s > 1024 * 1024:
        return '%10s (~%s Mb)' % (s, s / (1024 * 1024))
    if s > 1024:
        return '%10s (~%s Kb)' % (s, s / 1024)
    else:
        return '%10s' % s

def _formatSizeInMb(s):
    sizemb = float(s) / (1024 * 1024)
    return '%0.2f' % sizemb

3D modelling videos – Hummer H1

i was teaching at university few years back, and one of the 3D modelling demos that i was going over was advanced modelling techniques for graduate students.  It spanned over a course of few weeks, where each Saturday we had a 2 hour sessions going over steps to model a 3D Car. The car was selected by popular vote (where i was the one calling the results), so H1- HUMMER won:) (i had most references for it collected head of the time). All of the sessions were screencaptured, and i had posted them on my YouTube a while ago, but just recently going through my videos there found that i had them sorted into a play list. I think i am missing few final videos, where i go render the car and doing some final touch-up work:)

see it for yourself, it also is accompanied by nice tunes (imho)

MaxScript – bake animation to vertex

Okay, so this was an attempt to transfer some animation into vertex positions and set key-frames on each vertex . Remove the animation at the end from the object itself, so that we  are left with “baked” vertices.  If you try to copy/paste and run this – probably a ton of errors will take place, but if you study this -> a lot of good can come out ( now this is mainly a personal note 😉 )

fn collectVertPosition geometryNode VertexList  = 
(
	for v=1 to (polyop.getNumVerts geometryNode) do
		(
			vertex = polyop.getVert geometryNode v
			append VertexList vertex
		)
)

fn getXYZlocation vertexList axis = 
(
	for v = 1 to vertexList.count do 
	(
		if (axis == "x" or axis == "X") then 
			(
				vertX = vertexList[v].x
				return vertX
			)
		if (axis == "y" or axis == "Y") then 
			(
				vertY = vertexList[v].y
				return vertY
			)
		if (axis == "z" or axis == "Z") then 
			(
				vertZ = vertexList[v].z
				return vertZ
			)
	)
)

fn updateXYZlocation vertList axis location = 
(
	for v = 1 to vertexList.count do 
	(
		if (axis == "x" or axis == "X") then 
			(
				vertexList[v].x = location
			)
		if (axis == "y" or axis == "Y") then 
			(
				vertexList[v].y = location
			)
		if (axis == "z" or axis == "Z") then 
			(
				vertexList[v].z = location
			)
	)
)

-------------------------
sliderTime = 0
--animateVertex $ #all
originalModel = $

------------------------------------------------------------
--Create TMP model and append to TMP Layer
targetMeshModel = copy originalModel
targetMeshModel.name = "baked_" + originalModel.name
targetAnimation = LayerManager.newLayer()
targetAnimation.setname "Baked_Animation"
targetAnimation.addnode targetMeshModel
----------------------------------------------------------
targetMeshModel = convertToMesh targetMeshModel
--targetMeshModel = convertToPoly targetMeshModel

sourceVertexList = #()
targetVertexList = #()

collectVertPosition originalModel sourceVertexList
collectVertPosition targetMeshModel targetVertexList

format "source Verts Count: %" sourceVertexList.count
format "target Verts Count: %" targetVertexList.count

--enable animation of the Vertex for Target Node
animateVertex targetMeshModel #all

--set keys to Target Node
with animate on
	(
		for frame=0 to 120 do 
		(
			for v = 1 to meshop.getNumVerts targetMeshModel do 
				(
					with animate on at time frame meshop.setVert targetMeshModel v sourceVertexList[v]
					x = getXYZlocation sourceVertexList "x"
					y = getXYZlocation sourceVertexList "y"
					z = getXYZlocation sourceVertexList "z"
					updateXYZlocation targetVertexList "x" x
					updateXYZlocation targetVertexList "y" y
					updateXYZlocation targetVertexList "z" z
				)
			sliderTime = frame
			sourceVertexList = #()
			collectVertPosition originalModel sourceVertexList
					
		)

	)

About that GDC talk i did while working in New Zealand

Okay, so at the time it was all calm and everything was just fine, i had been doing some routine work at the studio, making sure our deliverables were on time and that artists could talk to programmers 😉

When our PR had sent out email asking for volunteers to present at an upcoming New Zealand GDC… No real alarms had been going off in my head, and i safely ignored this email and carried on with my duties.

A little time later, i had to take a several interviews for Technical Artists positions that we had opened at the time, and most of the interviews where via Skype.  While being all confident with my skills and that my bosses recognized a TRUE ME in ME 🙂 (lol) , i made a huge list of tech-questions that i was using to “filter” the right candidate. To my surprise, most of the candidates failed… Very few were able to even come close to some of the tech questions i had. And as for me, those were quite standard, considering that position for a Senior Level too.

Now, let me get that email from PR-Lady again… and Listen – i want to do this talk, I have a great topic, is what i replied.

Here it is…

Go from Student to Technical Artist