Unity3DAnimation外文文献.docx

上传人:b****7 文档编号:9026703 上传时间:2023-02-02 格式:DOCX 页数:15 大小:25.71KB
下载 相关 举报
Unity3DAnimation外文文献.docx_第1页
第1页 / 共15页
Unity3DAnimation外文文献.docx_第2页
第2页 / 共15页
Unity3DAnimation外文文献.docx_第3页
第3页 / 共15页
Unity3DAnimation外文文献.docx_第4页
第4页 / 共15页
Unity3DAnimation外文文献.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

Unity3DAnimation外文文献.docx

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

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。

Managementofcomplexinteractionsbetweenanimationswithavisualprogrammingtool。

Animatingdifferentbodypartswithdifferentlogic.

Layeringandmaskingfeatures

Animationworkflow

Unity'sanimationsystemisbasedontheconceptof AnimationClips,whichcontaininformationabouthowcertainobjectsshouldchangetheirposition,rotation,orotherpropertiesovertime.Eachclipcanbethoughtofasasinglelinearrecording.Animationclipsfromexternalsourcesarecreatedbyartistsoranimatorswith3rdpartytoolssuchasMaxorMaya,orcomefrommotioncapturestudiosorothersources.

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,wherehumanoidcharactersaremappedtoacommoninternalformat。

Eachofthesepieces—the AnimationClips,the AnimatorController,andthe Avatar,arebroughttogetheronaGameObjectviatheAnimatorComponent。

ThiscomponenthasareferencetoanAnimatorController,and(ifrequired)theAvatarforthismodel。

TheAnimatorController,inturn,containsthereferencestothe AnimationClips ituses。

Theabovediagramshowsthefollowing:

AnimationclipsareimportedfromanexternalsourceorcreatedwithinUnity.Inthisexample,theyareimportedmotioncapturedhumanoidanimations。

TheanimationclipsareplacedandarrangedinanAnimatorController.ThisshowsaviewofanAnimatorControllerintheAnimatorwindow.TheStates(whichmayrepresentanimationsornestedsub—statemachines)appearasnodesconnectedbylines。

ThisAnimatorControllerexistsasanassetintheProjectwindow.

Theriggedcharactermodel(inthiscase,theastronaut“Astrella”)hasaspecificconfigurationofboneswhicharemappedtoUnity’scommon Avatar format。

ThismappingisstoredasanAvatarassetaspartoftheimportedcharactermodel,andalsoappearsintheProjectwindowasshown。

Whenanimatingthecharactermodel,ithasanAnimatorcomponentattached.IntheInspectorviewshownabove,youcanseethe AnimatorComponent whichhasboththe AnimatorController andthe Avatar assigned。

Theanimatorusesthesetogethertoanimatethemodel。

TheAvatarreferenceisonlynecessarywhenanimatingahumanoidcharacter.Forothertypesofanimation,onlyanAnimatorControllerisrequired。

Unity’sanimationsystem(Knownas“Mecanim”)comeswithalotofconceptsandterminology。

Ifatanypoint,youneedtofindoutwhatsomethingmeans,gotoour AnimationGlossary。

Legacyanimationsystem

WhileMecanimisrecommendedforuseinmostsituations,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

Componentpropertiessuchasmaterialcolour,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’scommontohaveasimpleplaceholdermodelinyouranimationfilesforthepurposesofpreviewingthem。

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 A

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

当前位置:首页 > 解决方案 > 学习计划

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

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