Unity3DAnimation外文文献.docx

上传人:b****6 文档编号:5172610 上传时间:2022-12-13 格式:DOCX 页数:18 大小:516.49KB
下载 相关 举报
Unity3DAnimation外文文献.docx_第1页
第1页 / 共18页
Unity3DAnimation外文文献.docx_第2页
第2页 / 共18页
Unity3DAnimation外文文献.docx_第3页
第3页 / 共18页
Unity3DAnimation外文文献.docx_第4页
第4页 / 共18页
Unity3DAnimation外文文献.docx_第5页
第5页 / 共18页
点击查看更多>>
下载资源
资源描述

Unity3DAnimation外文文献.docx

《Unity3DAnimation外文文献.docx》由会员分享,可在线阅读,更多相关《Unity3DAnimation外文文献.docx(18页珍藏版)》请在冰豆网上搜索。

Unity3DAnimation外文文献.docx

Unity3DAnimation外文文献

Untiy3DAnimation

Unity’sAnimationfeaturesincludeRetargetableanimations,Fullcontrolofanimationweightsatruntime,Eventcallingfromwithintheanimationplayback,SophisticatedStateMachinehierarchiesandtransitions,Blendshapesforfacialanimations,andmore.

Readthissectiontofindouthowtoimportandworkwithimportedanimationandhowtoanimateobjects,colours,andanyotherparameterswithinUnityitself.

AnimationSystemOverview

Unityhasarichandsophisticatedanimationsystem(sometimesreferredtoas‘Mecanim’).Itprovides:

EasyworkflowandsetupofanimationsforallelementsofUnityincludingobjects,characters,andproperties.

Supportforimported animationclips andanimationcreatedwithinUnity

Humanoidanimation retargeting -theabilitytoapplyanimationsfromonecharactermodelontoanother.

Simplifiedworkflowforaligninganimationclips.

Convenientpreviewofanimationclips,transitionsandinteractionsbetweenthem.Thisallowsanimatorstoworkmoreindependentlyofprogrammers,prototypeandpreviewtheiranimationsbeforegameplaycodeishookedin.

Managementofplexinteractionsbetweenanimationswithavisualprogrammingtool.

Animatingdifferentbodypartswithdifferentlogic.

Layeringandmaskingfeatures

Animationworkflow

Unity’sanimationsystemisbasedontheconceptof AnimationClips,whichcontaininformationabouthowcertainobjectsshouldchangetheirposition,rotation,orotherpropertiesovertime.Eachclipcanbethoughtofasasinglelinearrecording.Animationclipsfromexternalsourcesarecreatedbyartistsoranimatorswith3rdpartytoolssuchasMaxorMaya,orefrommotioncapturestudiosorothersources.

AnimationClipsarethenorganisedintoastructuredflowchart-likesystemcalledanAnimatorController.TheAnimatorControlleractsasa“StateMachine”whichkeepstrackofwhichclipshouldcurrentlybeplaying,andwhentheanimationsshouldchangeorblendtogether.

AverysimpleAnimatorControllermightonlycontainoneortwoclips,forexampletocontrolapowerupspinningandbouncing,ortoanimateadooropeningandclosingatthecorrecttime.AmoreadvancedAnimatorControllermightcontaindozensofhumanoidanimationsforallthemaincharacter’sactions,andmightblendbetweenmultipleclipsatthesametimetoprovideafluidmotionastheplayermovesaroundthescene.

Unity’sAnimationsystemalsohasnumerousspecialfeaturesforhandlinghumanoidcharacterswhichgiveyoutheabilityto retargethumanoidanimationfromanysource(Eg.motioncapture,theassetstore,orsomeotherthird-partyanimationlibrary)toyourowncharactermodel,aswellasadjusting muscledefinitions.ThesespecialfeaturesareenabledbyUnity’s Avatar system,wherehumanoidcharactersaremappedtoamoninternalformat.

Eachofthesepieces-the AnimationClips,the AnimatorController,andthe Avatar,arebroughttogetheronaGameObjectviatheAnimatorponent.ThisponenthasareferencetoanAnimatorController,and(ifrequired)theAvatarforthismodel.TheAnimatorController,inturn,containsthereferencestothe AnimationClips ituses.

Theabovediagramshowsthefollowing:

AnimationclipsareimportedfromanexternalsourceorcreatedwithinUnity.Inthisexample,theyareimportedmotioncapturedhumanoidanimations.

TheanimationclipsareplacedandarrangedinanAnimatorController.ThisshowsaviewofanAnimatorControllerintheAnimatorwindow.TheStates(whichmayrepresentanimationsornestedsub-statemachines)appearasnodesconnectedbylines.ThisAnimatorControllerexistsasanassetintheProjectwindow.

Theriggedcharactermodel(inthiscase,theastronaut“Astrella”)hasaspecificconfigurationofboneswhicharemappedtoUnity’smon Avatar format.ThismappingisstoredasanAvatarassetaspartoftheimportedcharactermodel,andalsoappearsintheProjectwindowasshown.

Whenanimatingthecharactermodel,ithasanAnimatorponentattached.IntheInspectorviewshownabove,youcanseethe Animatorponent whichhasboththe AnimatorController andthe Avatar assigned.Theanimatorusesthesetogethertoanimatethemodel.TheAvatarreferenceisonlynecessarywhenanimatingahumanoidcharacter.Forothertypesofanimation,onlyanAnimatorControllerisrequired.

Unity’sanimationsystem(Knownas“Mecanim”)eswithalotofconceptsandterminology.Ifatanypoint,youneedtofindoutwhatsomethingmeans,gotoour AnimationGlossary.

Legacyanimationsystem

WhileMecanimisremendedforuseinmostsituations,UnityhasretaineditslegacyanimationsystemwhichexistedbeforeUnity4.YoumayneedtousewhenworkingwitholdercontentcreatedbeforeUnity4.ForinformationontheLegacyanimationsystem,see thissection

UnityintendstophaseouttheLegacyanimationsystemovertimeforallcasesbymergingtheworkflowsintoMecanim.

AnimationClips

AnimationClipsareoneofthecoreelementstoUnity’sanimationsystem.Unitysupportsimportinganimationfromexternalsources,andofferstheabilitytocreateanimationclipsfromscratchwithintheeditorusingtheAnimationwindow.

AnimationfromExternalSources

Animationclipsimportedfromexternalsourcescouldinclude:

Humanoidanimationscapturedatamotioncapturestudio

Animationscreatedfromscratchbyanartistinanexternal3Dapplication(suchas3DSMaxorMaya)

Animationsetsfrom3rd-partylibraries(eg,fromUnity’sassetstore)

Multipleclipscutandslicedfromasingleimportedtimeline.

AnimationCreatedandEditedWithinUnity

Unity’sAnimationWindowalsoallowsyoutocreateandeditanimationclips.Theseclipscananimate:

Theposition,rotationandscaleofGameObjects

ponentpropertiessuchasmaterialcolour,theintensityofalight,thevolumeofasound

Propertieswithinyourownscriptsincludingfloat,int,Vectorandbooleanvariables

Thetimingofcallingfunctionswithinyourownscripts

AnimationfromExternalSources

OverviewofImportedAnimation

AnimationfromexternalsourcesisimportedintoUnityinthesamewayasregular3Dfiles.Thesefiles,whetherthey’regenericFBXfilesornativeformatsfrom3DsoftwaresuchasMaya,Cinema4D,3DStudioMax,cancontainanimationdataintheformofalinearrecordingofthemovementsofobjectswithinthefile.

Insomesituationstheobjecttobeanimated(eg,acharacter)andtheanimationstogowithitcanbepresentinthesamefile.Inothercases,theanimationsmayexistinaseparatefiletothemodeltobeanimated.

Itmaybethatanimationsarespecifictoaparticularmodel,andcannotbere-usedonothermodels.Forexample,agiantoctopusend-bossinyourgamemighthaveauniquearrangementoflimbsandbones,anditsownsetofanimations.

Inothersituations,itmaybethatyouhavealibraryofanimationswhicharetobeusedonvariousdifferentmodelsinyourscene.Forexample,anumberofdifferenthumanoidcharactersmightallusethesamewalkandrunanimations.Inthesesituations,it’smontohaveasimpleplaceholdermodelinyouranimationfilesforthepurposesofpreviewingthem.Alternatively,itispossibletouseanimationfileseveniftheyhavenogeometryatall,justtheanimationdata.

Whenimportingmultipleanimations,theanimationscaneachexistasseparatefileswithinyourprojectfolder,oryoucanextractmultipleanimationclipsfromasingleFBXfileifexportedastakesfromMotionbuilderorwithaplugin/scriptforMaya,Maxorother3Dpackages.Youmightwanttodothisifyourfilecontainsmultipleseparateanimationsarrangedonasingletimeline.Forexample,alongmotioncapturedtimelinemightcontaintheanimationforafewdifferentjumpmotions,andyoumaywanttocutoutcertainsectionsofthistouseasindividualclipsanddiscardtherest.Unityprovidesanimationcuttingtoolstoachievethiswhenyouimportallanimationsinonetimelinebyallowingyoutoselecttheframerangeforeachclip.

ImportingAnimationFiles

BeforeanyanimationcanbeusedinUnity,itmustfirstbeimportedintoyourproject.UnitycanimportnativeMaya(.mbor.ma),3DStudioMax(.max)andCinema4D(.c4d)files,andalsogenericFBXfileswhichcanbeexportedfrommostanimationpackages(see thispage forfurtherdetailsonexporting).Toimportananimation,simplydragthefiletothe Assets folderofyourproject.Whenyouselectthefileinthe ProjectView youcaneditthe ImportSettings intheinspector.

Workingwithhumanoidanimations

TheMecanimAnimationSystemisparticularlywellsuitedforworkingwithanimationsforhumanoidskeletons.Sincehumanoidskeletonsareusedextensivelyingames,Unityprovidesaspecializedworkflow,andanextendedtoolsetforhumanoidanimations.

Becauseofthesimilarityinbonestructure,itispossibletomapanimationsfromonehumanoidskeletontoanother,allowingretargeting and inversekinematics.Withrareexceptions,humanoidmodelscanbeexpectedtohavethesamebasicstructure,representingthemajorarticulatepartsofthebody,headandlimbs.TheMecanimsystemmakesgooduseofthisideatosimplifytheriggingandcontrolofanimations.AfundamentalstepincreatingaanimationistosetupamappingbetweenthesimplifiedhumanoidbonestructureunderstoodbyMecanimandtheactualbonespresentintheskeleton;inMecanimterminology,thismappingiscalledan Avatar.ThepagesinthissectionexplainhowtocreateanAvatarforyourmodel.

CreatingtheAvatar

Afteramodelfile(FBX,COLLADA,etc.)isimported,youcanspecifywhatkindofrigitisinthe Rig tabofthe ModelImporteroptions.

Humanoidanimations

ForaHumanoidrig,select Humanoid andclick Apply.Mecanimwillattempttomatc

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 艺术

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1