complete commands added to agk
//plugin written by sheldon macdonald
//updated June 19,2015
[important commands]
-initialize_objects(value) initialize plugin... and how many objects from 1-# will be animated objects? if 50 was your value then object id's 1-50 would be
animated model objects only
-updateobject(object,limbcount) to update a model from everychange made to it [** very important**]
-updateobjectanimation(object1) [**important**] this or updateobject must be called once per sync to update an animation or position
[animated model]
-setobjectspeed(object,value#) This sets the objects playback speed. 1.0 being extreamly fast to 0.001 being very slow.
-moveobjectz(object,value#) This moves the entire animated models local z
-moveobjectx(object,value#) This moves the entire animated models local x
-moveobjecty(object,value#) This moves the entire animated models local y
-setlimbcolor(object,limb,r,g,b) sets a limb colors rgb values
-texturemodel(object,image) sets an entire animated model to the same texture image
-setmodelcolor(object,r,g,b) sets an entire animated model to the same color rgb values
-rotateobject(object,limb,x#,y#,z#) sets the entire models rotation if limb 0 is selected. If limb id greator then 1 then it only adjusts limb angles and effects the
child limbs connected
-positionobject(object,limb,x#,y#,z#) sets an animated model+limbs positions. Limb 0 will modify the entire models position where limb 1+ will adjust piviting points of
limbs
-getlimbangley(object,limb) gets the limbs pivot angle y
-getlimbanglex(object,limb) gets the limbs pivot angle x
-getlimbanglez(object,limb) gets the limbs pivot angle z
-getlimbrotationy(object,limb) gets final limb angle value y
-getlimbrotationx(object,limb) gets final limb angle value x
-getlimbrotationz(object,limb) gets final limb angle value z
-getlimbpositionx(object,limb) gets final limb position x
-getlimbpositiony(object,limb) gets final limb position y
-getlimbpositionz(object,limb) gets final limb position z
-getobjectscalex(object) gets the x scale value of model
-getobjectscaley(object) gets the y scale value of model
-getobjectscalez(object) gets the z scale value of model
-setmodelscale(object,sx#,sy#,sz#) sets models scale 1.0 is original size
-setobjectscalex(object,size#) sets models x scale
-setobjectscaley(object,size#) sets models y scale
-setobjectscalez(object,size#) sets models z scale
-getlimbpositionxf(object,limb,frame) gets the framed position x
-getlimbpositionyf(object,limb,frame) gets the framed position y
-getlimbpositionzf(object,limb,frame) gets the framed position z
-getlimbrotationxf(object,limb,frame) gets the framed rotation x
-getlimbrotationyf(object,limb,frame) gets the framed rotation y
-getlimbrotationzf(object,limb,frame) gets the framed rotation z
-cloneanimatedobject(source,destination) clones animated model
-deleteanimatedobject(object1) deletes an animated model and its limbs
-instanceanimatedobject(source,destination) instances an animated model...do not delete the source before deleting any instances or it will crash
-hideobject(object1) hides animated model
-hidelimb(object1,limb) hide an animated models limb
-showlimb(object1,limb) shows an animated models limb
-showobject(object1) shows an animated model completely
-saveanimatedmodel(object1,filenameb$,flag) saves a newly built animated model +animation ob2 file
-loadanimatedmodel(object1,directory$,fname$,flag) load obj animated model file
[limb commands]
-linklimb(object,child,parent) ??????????????????????????????????????????????????
-setlimbparent(object,limb,parent) changes a limbs parrent limb
-getlimbexists(object,limb) returns 1 if a limb exists
-getlimbcount(object) counts how many limbs are in an object (do not make frequent calls to this or your code will be slow)
-addlimb(objtoadd,object) to add a model shape to an existing model to form multiple limbs
-setlimbkeyposition(object,limb,x#,y#,z#,key_frame) sets animation frame position
-setlimbkeyrotation(object,limb,x#,y#,z#,key_frame) sets animation frame rotation
[animation commands]
-playobject(object,startkey,endkey,continous,speed#,limbcount) called to playback an animation sequence
-setobjectframe(object,frame#) used to set a specific animation frame for a model //may be bad to call if the animation has not been stopped first
-runanimationtransition(object,startframe,endframe,continous,speed#,limbcount) used to change from one animation to another smoothly! [** very important**]
-getobjectplaying(object) returns a 1 if the model is playing
-getobjectframe#(object) gets the exact frame of animation with decimal place
-getobjectspeed#(object) returns objects playback speed
-stopobject(object1) stops model from playing animation
[object creation]
-makenewobject(vertex_cnt,index_cnt,normal_cnt,uv_cnt) makes an object array for editting
-setvertexdataposition(vertex,x#,y#,z#)
-setvertexdatanormals(vertex,x#,y#,z#)
-setvertexdatauv(vertex,u#,v#,w#)
-setindexdata(index,v1,s)
-savenewobject(object_number,filename$,flag1,flag2) saves a newly built model obj file
[extra commands]
-wrapvalue(a#) wraps a 360 degree value (does not work for angle x# !)
-wrapvaluex(a#) doesnt actualy wrap x but locks it from glitching out. x rotation can be from -90 to 90
-getdistance#(x1#,y1#,z1#,x2#,y2#,z2#) gets a 3d distance
[internal commands]
-count_objectdata(objecta,limb) [internal command]
-savenewobjectlimb(object,filename4$) [internal command]
-adjustpivotpoint(object1,limb,x#,y#,z#) adjusts a limb or objects pivot point
-setobjectmeshfilename(object1,limb1,file$) [internal command not needed]
-loadobject2(object,filename$,texture$) [internal command]
-setobjecttexturefilename(object1,limb1,file$) [internal command not needed]
-loadobj(object1,filename$) [internal command]
-loadobjectarray(object1,limb) [internal command]
instructions:
-object files should be trianglar based not quads.... they will appear to work but will not load correctly if the plugin needs to recreate the 3d files.
-holding rightmouseclick in allows you to navigate camera
-holding leftmouseclick zooms camera in
-you cannot load a model into limb 0
-you can set a child limb to a non existing limb....crazy things happen so try not to do that.
-try to link limbs in order
-frame 0 is the base pose
-every frame after 0 defaults to base pose
-if you want to quickly rig another character with same anims as another....just edit that character and change out the body parts. animation will stay intact
I will post an example here for the demo cat walk that i did on the editor.
example of what the code looks like:
#include "objects_include.agc"
initialize_objects(50)
createlightdirectional(1,0,.25,.5,255,255,255)
SetVirtualResolution(1024,768)
loadanimatedmodel(1,"","devil_cat.ob2",1)
playobject(1,0,4,1,0.08,20)
setobjectlightmode(1,1)
setcamerarange(1,1,10000)
do
rotateobject(1,0,0,wrapvalue(getlimbangley(1,0)+.5),0)
updateobjectanimation(1)
setcameraposition(1,0,0,-500)
setcameralookat(1,0,0,0,0)
Print( ScreenFPS() )
Sync()
loop
this is after you have included the objects_include functions file...
edit: file removed for compatibility reasons... dont worry i will post new examples!
keyboard shortcuts:
-qwe,asd for editing by 1 value
-arrowkeys to flip through frames,limbs
video tutorials:
(there is a slight pause in between 1 of my takes...don't worry voice comes back)
Tutorial 2 ... using AGK_SM3D
www.sheldonscreations.com