Maya VFX Series: Pouring Syrup using Bifröst Liquid

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone this is reza welcome to another video of effects series in maya in this video we're going to create a viscous liquid using bifrost system to create this image [Music] as you all know bifrost is a simulation system for high quality liquid effects using a flip solver which is fluid implicit particle you can generate fluid from emitters and have it fall under gravity interact with colliders and these attributes are exactly what we need to create this effect just to add to it because i received this question a lot for aerodynamic effects we use bifrost extension instead of bifrost liquid and i have a video on it as well in this channel all right let's get started with the session now to the scene itself i've got three objects and two objects are going to act as colliders so the syrup is going to collide with the cake and eventually drops down into the plate that i have and this guy here the table is just acts as a ground floor that's all i've got 250 frames and the playback speed is set to play every frame needless to say if you go to windows setting preferences and plug-in manager you need to make sure that your bifrost plug-in is enabled as well also if you go to panel orthographic and front one thing that i always check when i deal with dynamics in general is scene size so if i go and enable my measure tools you can see i've got 41 cm and 15 cm that's the extent of the scene scale which is not really too big if i go into render cam and hide the entire geometry you can still see maya grid which is kind of okay you know it's not too bad so be mindful of it because of course scene scale will change the way that fluid simulation have an impact on any model in general now let's get to the emitter let's create the emitter i'm also going to turn off lights and textures to be more efficient so going to create polygon primitive and cylinder i'm going to move up this cylinder probably going to increase its size to 1.5 so it's not too small and there's not much i need to do here to be honest i'm going to go smooth exponentially smooth that probably twice you need a little bit of resolution here so you can actually change this here or select the geometry and press g to do that again then i'm going to go here probably delete these faces in here need to make sure that you select everything good you press delete and i'm going to close the cap so i'm going to go here and fill hole one thing you need to be careful is you should not leave any n-gon behind you never know how this is going to hit you so for that shift right click and i'm going to poke that so there is no end gun i have a bunch of triangles but that's okay i'm fine with it it's not going to be any trouble so that's it for my emitter i'm probably going to change the translation of it a little bit so um let's kind of move it up further more and probably yeah that's uh the x value is okay you kind of need to make sure it's not right on top of this um kind of hole here so maybe 2.5 will get the job done and i've got my camera here so you just need to make sure it's not in the frame and my intention is not to include any bottle so all you see is a liquid pouring down so i really don't care about what's out of the shot how pretty the emitter is because we're actually not going to see it we are going to hide it soon all i need to do is just to name this properly and of course next step is to select one or more polygon as emitter we've got only one we can have more than one and go to bifrost fluid make sure you're in effects menu set bifrost fluid and go liquid now instantly maya creates five nodes for us bifrost liquid the property of liquid if you would like to have any guide liquid which correlates with bas system we're not going to use that and now this node is going to contain the mesh node which we will use and one node one individual node for the emitter so anything to do with emitter goes in here that's great so once you click on bifrost liquid that fills the object with the liquid and the gravity takes over and particles get emitted only on the very first frame so if i click you can see it drops and goes through the model obviously there is no collider so it just drops into infinity that's not quite what we want because it it creates a single drop as a result of simulating only one frame we need continuous emission so every time you deal with a water hose or effect like this or if you're pouring wine or things like that then you need that continuous image and it can be found under by frost emitter prop so ctrl a to go to its attribute editor and it's under here under properties continuous emission so i need to kind of take that off i'm going to rewind enable this and play again and you can see it's no longer a single drop bifrost is constantly pouring content or liquid now you got to be very careful because you either need to kill it with a sort of a kill plane that we have here or you need to somewhat control that flow you cannot let it run forever because well i'm dealing with 250 frames you may deal with thousand frames and you cannot have that emission on for thousand frames otherwise maya will crash now one thing that many don't know is this continuous emission is keyable how cool is that so you can actually control your emission via this attribute by key framing your emission so what i can do is to right click go to frame one i'm going to right click set key and it sets a key going to 220 right click set key or you can use middle mouse pause go to 220 and insert key and then i'm going to go one frame forward and turn this off right click set a key now look at here if i go only one frame back you can see continuous emission is on going one frame forward continuous emission is off that's good this assures us that we're not going to run out of memory and right after frame 220 there won't be any emission so that's good let's create colliders colliders um prevent liquid from kind of falling away under gravity into infinity um the only thing you need to be mindful when you deal with collider is make sure not to have any n-gons again again i went through the trouble of smoothing this little guy over and over again and it doesn't matter how dense the model is obviously the denser the model that the more time consuming the calculation will be but i'm fine with it as long as you don't have any weird polygonal modeling error in your scene so if you have holes if you have stray vertices if you have kind of messy geometry in terms of the number of end guns in your scene there's a good chance that maya or bifrost won't react properly to it and eventually maya will crash so be careful make sure you have a clean geometry one workaround if you have to have that geometry with n-gons is to create a proxy so create a proxy from your height resolution have a low-resolution mesh place it carefully and make that a collider for my case although i'm dealing with a dense collider i'm fine with it so i'm going to select that as a matter of fact the way you select things you select number of colliders and then you go into the liquid itself select that and then you go to bifrost and then you create collider i've got no error message so if i play now you can see the liquid being emitted and it collides with the geometry i'm just going to wait to see if it collides with the plate itself yes it collides with the plate as well perfect so it's working now time to add viscosity that's a key attribute to create syrup like liquid anything that resembles lava honey syrup viscous objects in general we need to find and change the viscosity attribute and that is under bifrost liquid properties so if i select bifrost liquid properties in my outliner i'm looking at that in the attribute editor we've got a viscosity tab and so far there is no viscosity now be mindful of the fact that how viscous the liquid is it would be up to you i'm using syrup so it's not really that thick so something like i don't know maybe 500 will get the job done but if you go for a more viscous material something like honey then you definitely need to increase this value and again this is scene scale sensitive as well that's another thing that you need to be mindful of we also have scale here and that scale smooths or dampens liquid flow i found um default value kind of works for more scenarios you can increase that to slow down the simulation i've noticed any value above two can give you a very unpredictable result so and that's why it's one of those tricky attributes it's not physically accurate either so don't use a crazy number like five or ten cool so um viscosity to 500 is going to work for me and let's play back actually i'm not going to go too far let's play back or play blast for 100 frames and see what we're getting and only then we can move forward i'm going to go to windows play blast and say that i just want to get 100 frames that should do it and i'm gonna set this guy to h264 and i'm going to save it and we'll be back with the result okay the play blast is ready if i play you can see the viscosity the amount of viscosity i'm getting is not too bad it's it's syrup like so i'm not going to change that what i dislike is the flow though it's really boring it's more like a faucet tab just running there is no turbulence so the way that you fix this there are many ways of doing this you can do it manually with animation which we are going to actually use to intensify the effect but the first workaround and the first place to go to would be the actual force field we need force field to add a little bit of turbulence to this flow so it's not too straight or too boring so what we're going to do is with the liquid selected i'm going to go to bifrost liquid and i'm going to add motion filled now motion filled is great especially when you're dealing with continuous emission ninety percent of the time you want to use motion field uh because it directly affects the velocity of your bifrost liquid and when you deal with the velocity then there's so many things you can do we can change the direction you can add drag introduce noise or for our case bring some turbulence so as you can see i've got magnitude which i will use a magnitude of three maybe something that you need to test for your own case and see if three is good enough high enough or too low so direction is not what we're going to use we don't want to push velocity it's not like a water hose or garden hose so we definitely don't want direction but we want turbulence we want a little bit of waviness to make the flow look more interesting and turbulence definitely is going to help us now if i go to turbulence and noise we have a little bit of control over how turbulence is going to take place as well so turbulence magnitude is the strength of the acceleration itself which i tend to use the same figure same digit here so if you put magnitude of 3 i tend to use the same number or close to the actual number that i use in my turbulence magnitude and then i've got the frequency which you know higher values produce smaller kind of denser vorticities um the default is set to one i'm going to actually reduce it a little bit i want actually wider waves rather than smaller frequencies and then we have turbulence speed and it's not the speed of the simulation don't get that one wrong it's how fast your turbulence pattern evolves over time which is a completely different story and i want to reduce that actually as much as i can but if you go for a more viscous material you probably want to reduce it even further so point one is going to work for us i guess now with only those changes in place let's do another play blast and see the change that we have in our scene look you can see we get a little bit of curviness especially right at the beginning which is quite nice i might increase the magnitude more to get a more interesting result for that so let's select the bifrost motion field in our outliner gonna scroll down and increase magnitude to something like five now it's time to kind of animate our emitter as well and make the result look even more interesting believe it or not the result i got comes mostly from the animation that i applied to my emitter so let's uh let's see how i went about that so i tend not to apply any animation on directly on the geometry itself because i've got a few information here that i would like to preserve i always put that into a group node another advantage of having a group node is it actually puts the pivot right at the center and because my scene is also right at the center it makes the animation much easier so i'm just going to rename this to a meter grp a little bit picky about naming convention you may have noticed so every time i change something or i create something i tend to rename it now i'm going to put my keyframes on the group node rather than the emitter itself so be mindful of that i'm going to go to i'm going to go to top menu if i have this pivot at the center i can easily kind of rotate this guy around and keyframe it without being worried about the path and that's that's great so i'm going to keyframe two attributes one is going to be rotation of y and the other one is going to be translate y i want to i'm going to move this up and down as well a little bit to intensify the velocity the force of velocity as well and that's going to create interesting results as well so for rotation obviously i'm going to keyframe only rotate y frame 0 going to keyframe it then i'm going to go to towards the end of my simulation maybe 190 and i'm going to rotate it maybe something like that 117 and set a key i'm going to go to frame 230 and bring this back quite a fair bit so i'm just going to put something like 8. you can set it to 0 but i'm just going to set it to 8. now you may say this sudden jump is crazy and confusing and that's why we're going to have translate y animation on top of rotate y as well so i'm going to switch back from orthographic top to let's say orthographic front have a look at our emitter and let's see what we can do to make this look more interesting so i'm going to frame 0 obviously and translate y the default key set to zero and then probably going to frame 75 halfway through the animation and move this up nine units right click and set a key so i'm trying to create as like a sinus curve sort of a shape i'm going to go to frame 190 or 191 i'm going to set it to 190 because our rotation was set to 190 as well bring it back to its original position set a key you can of course always enable other key and for frame 230 going to kind of shoot this up that's something that you do in real life as well when you pour syrup or honey we kind of move the bottle up so it won't leave stain on the table and i try to simulate that type of effect so i'm going to kind of move this up quite a fair bit like 100 units and remember by the time we reach this the emission is off so you see only a few droplets dropping not on the table but on the plate itself and then no emission after that so that should give us enough to start with our animation but before i go through another round of play blasts i need kind of more force to pull down the syrup that can happen by going through bifrost liquid properties and kind of increase the force field that i have internal force field 11 even maybe 12 should get the job done now let's play blast and see what we're getting we've made a good number of changes here let's see how this animation is going to help us to get a pleasing result or pattern and see how gravity can take place to pull the liquid down sort of speak so i'm going to pause the video do another round of play blast and we come back soon the play blast is ready let's have a look at the result yeah that's what i'm talking about see you can completely see that kind of flow that we're talking about is there and the emission ends it's very good it's pretty cool actually then now one thing you need to be mindful if i pause around here so if you look at this particle separation this usually takes place because of low resolution remember we even haven't touched the voxel size now once you lower the voxel size to increase or enhance the resolution those points get tighter and the volume will get consolidated so that's the part that you always need to think about that right i haven't increased the resolution just yet you just look at the flow and if the flow looks good then you can actually increase the voxel size get a much better result and only then take that to the next step so with that let's close that one up and rewind and if i go to my bifrost liquid properties that's where that i can find the voxel size so master voxel size plays a massive role in how well-defined the liquid is now 0.5 is big is just a default value and there is literally no accuracy with what you're getting the kind of accuracy that you're aiming for is around the value of let's say 0.1 that's where you get accuracy now um if your computer allows and if your system can handle it you can't even go lower you can even reduce this value to a lower number to something like .05 as you can see um but again it really comes down to how much ram what sort of processing you're using or what graphic card you're using and all of those small bits and pieces can contribute to maya crashing not crashing because if you bring this value too low then and if computer cannot handle it then the scene will crash so i experimented with those numbers at least from my case and i noticed that i can actually bring it down to a very low value of .05 and that's ideal it's going to give me a very very uh a clean result now with that now with that before i go through another round of playblast i'm going to cache my simulation the reason i want to cache my simulation is because i don't want maya or bifrost to kind of recompute the simulation every single frame it can actually read it through the cache files each frame and your play blast is going to happen faster as a result of that you won't notice any changes in your simulation as a result of that and everything will be ready to go for you to mesh your liquid simulation because of that so the lot of benefits to caching your simulation now the method i'm going to use is called compute and cache to disk and that type of user cache is usually intended for the final approved simulation as opposed to kind of temporary scratch cache that we we tend to use so um it's going to take a few hours actually and i'm going to select the liquid going to buy frost fluid and then i'm going to go to compute and cache to disk if i go to the option box you can see it specifies the path you can specify a name cache format is bif for bifrost cache element needs to be set to simulation and then compression is set to lossless least compression obviously you need quality and we want to go through the entire frame range so we pick time slider for that and we go create now with this low voxel size rate which gives me a high quality result and a cached simulation i'm pretty sure it makes the job a lot easier for me to turn my simulation into geometry and mesh it so i'm going to spend some time going through caching the entire scene and i'm going to do a play blast right after that and only then we will be back and review the result we going to mesh the simulation export it out and finalize our tutorial so see you in a bit now the caching and playblast is done and look at the result my goodness look how one attribute master voxel size in resolution rollout can make a huge difference and that's one key attribute that you deal with with flip simulation when there are particles involved and by reducing the particle separation you get a much cleaner geometry so with master voxel size to 0.05 that's the result that i'm getting now back to maya if i go into property liquid container and go all the way down you can see now my liquid cash rollout has been enabled giving me the path and cash name but it's always good to check to see if the cash is linked sometimes you scroll and get no results that would be the first rollout to check now i'm going to go to bifrost liquid here and when i want to mesh my bifrost in liquid shape zero one that would be the place to look for it now there's so many attributes in here but because i went for the possible highest master voxel size i can get away with not touching so many of these attributes i can just go ahead and enable it and my mesh appears now you may have trouble looking at the mesh so i usually scroll up and turn off particles now you can see the mesh is visible now to select the mesh you go to bifrost liquid mesh to select it and time to export this as alembic so to export that as alembic i go to cache and then go to alembic cache and export selection to alembic go to the option box now obviously cache time range i set it to time slider i'll leave everything intact and scroll down until i get to this bit i just need to make sure that right color set is enabled because that kind of writes down the velocity that i have in the geometry without that you don't you're not going to get any animation and in the file format i need to make sure that agava is selected hdf5 is an older kind of legacy algorithm to calculate abc or alembic files and with that i'm going to go to export selection and export out my liquid for 250 frames i'm going to press export selection and see you guys in a minute so i exported everything for 250 frames from this point it's up to you you can save as another scene this is something that i've already done or you can continue with the current scene but you will lose your bifrost nodes so what i recommend after this point is if you save as a new scene you go ahead select your bifrost nodes and simply press delete we no longer need any bi-frost fields colliders emitters or guides now we've got a clean scene let's bring in our alembic instead so i'm going to go to cash alembic cash and import alembic now if you export things correctly hopefully with said project already you should have this alembic inside cache alembic folder i'm going to go import and bring it in and there i have my liquid i can even scroll and see the result on the fly how cool is that now all i need to do is to apply material to it and render it out now to apply material i'm using arnold shader for this particular session so it's fairly straightforward i'm just going to right click on it assign new material i'm going to pick ai standard shader so for that particular example i'm just going to use honey and replace simply because you get almost the same index of refraction if you think about syrup and honey the way that they bend the light and the amount of transmission that you're getting is almost identical feel free to add a little bit of anisotropy or increase index of refraction if you want but i thought having that material can be a huge help now if i go ahead and just render a single frame that's very cool look at that so i'm actually quite happy with the amount of specularity i'm getting the amount of reflection refraction what i want to render i might apply a little bit of depth of field and it's just purely an artistic decision so that kind of line fades well with the hdr image that i have but honestly the main focus would be on the liquid and i'm quite happy with the amount of highlight specularity i'm getting with the liquid remember you can always have that as a separate pass transmission pass render it separately and you can have a finer control over it in post well i guess all i need to do is just to render this as a sequence so you go to your render settings set your camera your frame range and your image size you go to your renderer and fine-tune your sampling to reduce noise if you want to have that as aovs you can certainly do that i'm going to go ahead fine-tune the render settings and render this as a sequence and we're gonna have one last final look at the result all right you've already seen this right at the beginning of the tutorial but that's what i came up with when i rendered everything and this is it thank you very much again for tuning in i hope you found this tutorial useful and see you guys in the next tutorial
Info
Channel: SARKAMARI
Views: 10,588
Rating: 4.98773 out of 5
Keywords: Bifröst, Bifrost Liquid tutorial, VFX in Maya, Motion Field, Viscosity in Maya, Creating SYrup in Maya, Liquid simulation tutorial, Autodesk Maya FX tutorial, Reza Sarkamari, Master Voxel Size, Honey in Maya
Id: iyOdhX2nveE
Channel Id: undefined
Length: 35min 0sec (2100 seconds)
Published: Sun Oct 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.