Camera Match in Maya with fSpy and Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Your channel for Maya has helped me so much

👍︎︎ 3 👤︎︎ u/0Luckay0 📅︎︎ Apr 27 2021 🗫︎ replies
Captions
hey everyone today we're going to take a look at camera matching in maya using a tool called f-spy using this technique will help you create camera match scenes from your reference images that you can use for modeling environments vehicles or props currently f-spy is a standalone camera matching tool that has blender integration so we'll cover a workflow that takes us through f spy blender then maya i've made this very straightforward so don't worry if you've never used blender before so with that let's get started all right so let's just get started if we take a look at what f-spy is it's a free open source still image camera matching tool that you can use to you know camera match reference images and then use that for your modeling here's a quick you know 10-15 second uh video on how it's you can use it at a high level and i'd highly recommend taking a look at the website taking a look at the documentation uh because i'll just be covering it from from a very you know high level uh and basically just showing you how i use it all right so you can just go to spy.io download it install it very simple straightforward and then go ahead and open it up so here we have just f-spy which is the standard starting project all right so what we want to do is just grab our reference image in this case i'll be using this image right here and drag that right into f spy and you can see here that we're kind of you know we have these gizmos that we can use to set the perspective based off the axises and orientation you can kind of see that i already had mine initially set up but you know you can work with all the different axes so x y and z and it uses typically the two number of vanishing points right which is just a term used for perspective matching all right and you can see that you can change the different axes or the vanishing points here you can see that x is kind of the bottom here we have y uh that we can use either as our vertical or uh horizontal axes and then same thing with with c all right now the key thing here is you know kind of taking a look at what we have inside of maya maya is y up blender z up but that's not a big deal we can just quickly rotate but i'm going to stick with just having y up since we're going to be primarily using maya to render all right so now that we have this set up we can take a look at using you know x and y so if we look at x as our depth here we can go ahead and kind of set this like so and start putting these lines here based off the the vanishing points all right and basic based off the perspective uh the perspective lines of the image so if i go ahead now and use this for our y we can go ahead and make some adjustments here now what's nice is you can kind of see you know you can have the image the dimmed image here uh then disable dimming there and then you can also hold shift and as you're left click dragging and it'll give you a nice zoomed in version so you can be very precise here so what i'll start with is just kind of using these door frames as our uh as our you know y-axis our vertical axis here so i can go ahead and just kind of set this like so and i'll just you know make sure that it's kind of nice and parallel uh which we'll take a look at pros and cons of keeping things parallel versus you know moving them around the the reference image so you can see i'm just kind of moving and trying to keep it on the outer part of the the crown molding here all right so we get something like this so far and if i actually go ahead and turn on focal length you can kind of see what we have now you can see that the y axis is facing down so if you wanted to you can just simply flip that there and then you have your y axis going in the up orientation then i can go ahead and just you know left click to drag the gizmo around and kind of move that around the scene just to make sure that that things are looking good there's some nice tools in here as well where you can use you know image midpoint which is what we're currently using or you can even use a third vanishing point which in this case you can use maybe the horizontal x-axis excuse me horizontal z axes here so you can see i'm kind of just moving some things around using the lines of the image so again i'm using the door frames i'm using the the wood flooring going all the way down and you can see that they're all vanishing uh towards a single single point here all right so just be careful you know the sometimes it does you know if you don't have the right camera sensor information and if you're using third vanishing point you will get some very very high focal lengths here uh which almost will turn orthographic so for the most part i typically just stick with using image midpoint and so this gives me you know kind of what i expect right now we're looking at about you know 20 a focal length of 20 now if you get things like this where you're moving around and you get this you know image uh rotation error um the configuration rotation determinant it's basically saying that it can't find a vanishing point based on the angles of these uh the axes here so i can just simply you know just make sure to adjust these and try to get these as as close and as best as i can and eventually just make sure that these these are aligned uh properly uh what also helps is to have different you know extremes of the image so if we have the door frame here i can go ahead maybe and grab this this part the y-axis and go towards the back or towards the end of the image to get a nice a nice shot here and there we go we can kind of just continue to to work with that until we get something that looks pretty good all right so we'll just keep moving that making adjustments maybe i might try to use the the roof here or the ceiling part of the ceiling as we're doing this so you can continue to to refine and adjust that okay and the other thing that i like to use is a box right here so if you go to 3d guide you can kind of use this box and it'll let you kind of know how it's kind of fitting into the scene that you have so far and you can make some adjustments there and it's really really nice tool again if you kind of flip the axes you can always uh adjust it and then the last thing i want to do is just kind of use this um use this xyz gizmo and put it you know along the the main parts of the image making sure that things look good and that things look properly aligned and if i might need to make some some adjustments uh throughout the image right so all in all things are looking pretty good i'm liking where everything's at so once i'm done with this i can go ahead and begin exporting great so just find out some final tweaks there and i ended up at about a 26 millimeter focal length which is exactly kind of where i figured it would land somewhere between 25 30 35 millimeter focal length since we're in kind of this confined hallway and you'd need typically a wider lens to capture all this information all right so once we get that we want to simply go to file save as or save this and then you can go ahead and save this wherever wherever you need to so i'll go ahead and just save this as this environment can match demo in my assets folder so i'll go ahead and save that and then once we do that then we can go ahead and take a look at bringing this out of s f spy into blender and then into maya so if you haven't used um blender before it's a very very simple install i'm sure everyone's heard of it go ahead and just download blender from their download page and it's a very small exe i remember when i first downloaded it a year or two ago i was pretty surprised that it's only it's less than a couple hundred mags which makes it very easy to download and install anywhere unlike some other other out of the softwares which which take quite a while and are gigabytes right then once you have blender installed you want to make sure that you also have the f-spy blender zip this is the integration this is the plug-in that we'll be using or what's called the add-on inside of blender so you want to make sure that you also have that so with blender downloaded with the f-spy blender add-on downloaded let's go ahead now and open up blender so if i go ahead and open up blender i have just the default scene which is the good old blender cube here and the first thing i want to do is load in the f-spy add-on so you want to go to edit preferences all right so once you got preferences here you'd want to go to the add-ons tab here and then go to install and then with install we'd want to go ahead and find our folder that has the the download so if i go ahead now bring this over i'd want to go ahead and jump to my environment lightings folder and go to install so you can see there it is this is just the downloaded zip from the link that i just showed and i'll be sure to provide all the links down in the description below so you go ahead and install add-on and once you do that you can now go ahead and search for fsfi and there you go and i already have that loaded so once you're good there you can go ahead and close it then you go to file import and then you see f-spy here all right so go ahead and hit import fs5 and then again we want to go ahead and take a look at finding the folder and i saved it in my assets folder and i just called it a demo so i want to go ahead and grab that and go ahead and import f-spy project all right so there we go so it imports into the project fine and we have the camera positioned uh properly or imported properly and now we're just going to simply take this into maya that's it we're just kind of using blender right now as a middle point since there is no maya plug-in to import f5 files but it just makes sense just to simply use blender to import it and then export it so i'll go ahead and do file export fbx and you'd want to make sure to not have anything selected you can you know delete the lights and uh the other camera so it doesn't confuse anything maybe just leave the cube there for for orientation so then i go ahead and do the export with nothing else selected and i'll go ahead and export this out into the folder i'll just go ahead and call this blender f-spy demo and go ahead and just overwrite that and export that out great so now that we've done that we're all done with f-spy we're all done with blender and then now we can just jump back into maya so if i go ahead and pull up maya here we're in a blank scene ready to go all right so here we are in maya and now we're ready to bring in that fbx that we just imported or exported from blender so if i go ahead now and grab the blender f spy demo fbx and then import that right into the file and there we go so now we have our cube we have our camera and what i want to do here is go ahead and just group these all right now i want to group these and then simply rotate these 90 degrees in the x so i can just go ahead and type in x 90 degrees in the x and there we go now the next thing i want to do is you know i have this group here environment camera match here and i'll simply go ahead and set this up i want to create a new um panel here so i'll just do the environment camera match here and then i want to make this just my perspective can right so i can kind of move around and do what i need to do now the first thing or the next thing that i want to do is go ahead and adjust the resolution all right of the image so if you can go ahead and take a look i can go to this image here do a quick details on this and we can see that it's 3701 by 4626 so i'll go ahead and adjust that and make sure that the image or the render settings is matching the aspect ratio now i'm also using v-ray for the demo but you can follow along using any render engine and we can go ahead down here and disable maintain width and height ratio and i'll go ahead and type in you know 3701 by 4626 re-enable maintain height and width ratio and then set this to something much lower as long as the aspect ratio um is the same between the two images i can lower this to something much more reasonable when we render all right so that's good because now watch what happens if i didn't do that then i'm going to enable resolution gate and then watch without that and if this was set to a standard hd here you'll kind of see that it would not be aligned with the cropping and the aspect ratio of the image so again you just want to make sure to just update that in your image here so again i'll set that to 37.1 4626 and then set this back to 1200. all right great so that's all i need to do in the render settings right now and then the next thing that i want to do is go ahead and add the image plane so i'll go ahead and import an image point i'll just use this icon here and then you can see that i have the image right here environment ref in my source images folder so go ahead and grab that go ahead and hit open and then it goes ahead and adds it in there now the key thing i need to do here is uh start making some adjustments so i'll hide the cube here i don't need that anymore and what i want to do now is select the image plane here by simply selecting in the viewport hit control a and then you'll see that i have some options here i want to make sure that it doesn't show up in the other viewport so i'll disable uh or set this to looking through camera then if i scroll down i want to also do fit to resolution gate all right so there now this is a one-to-one aspect ratio it's filling up in the scene now i can start modeling based off of this but there's one last thing i need to do which is make sure i have a scale of reference all right now the scale of reference that i'm going to use is basically these doors a lot of times you you have to just make assumptions to get pretty close in scale but if i go ahead and generate or create a simple cube i'm going to go ahead and just create you know a standard eight foot door here all right and if i go ahead in the channel box here and i can go ahead and height and type in 203 centimeters which is 8 feet and then i'll use a depth of 91 which is the width of a door and then i'll just give this a little bit of width here and then i can move this in position right because i want to make sure that i put this in position here near this door because that's basically what i'm going to be using as my scalar reference this just helps to do this now so i don't go through the process of modeling an entire environment and it turning out to be all in the incorrect scale right so i'm just going to go ahead and position that you can see my camera here and then i'm just going to bring that and just make some adjustments until i get this about right all right i went ahead and just put that in position there and that's pretty good it gives me a good sense of you know the the size of this environment we can see that it's pretty close might be just slightly ever so slightly off but uh we're good for now so now that i have that you can just begin modeling right and i and now modeling with the confidence that i'm pretty close to this original scale of this environment so i'll go ahead and really scale this ground plane up here and move it in position and just start you know getting it all set up with my environment so i'll go ahead and hit one here and now that i got that i will go ahead maximize this view and just begin you know moving things properly so i'll move this further out in the x like so and then now that i got that i can you know make sure i get the size proper and where we want to make sure to also bring that up right so you can see that it was it was way way down below which is why again you want a good scale of reference right so perspective is a little bit tricky if you're not careful and i want to bring this up here ooh just about the bottom of the door something like this and then i can bring this back here right so it's not so much that it's you know being uh the length of it right it's the perspective that makes it looks like it's a lot further than it actually is so then i start bringing everything in and there we go we got the nice ground floor properly aligned you know we can make some a couple more minor adjustments here then once i do that i can go ahead and you know hit ctrl e extrude and start to get the rest of the environment here so i'll go ahead and kind of extrude this main part here for the back part and then i'll hold shift right click and multi-cut and just kind of add in this edge here right so i'm going ahead and just initially doing this rough rough block out here and you can see i'm just moving this up like so and then you can see things are looking pretty good things are pretty close and i can go ahead and move some vertices you know getting this all nicely aligned and make some adjustments here and move these out but yeah we got this and then now what i can do you know is go ahead and start to do this cut out here so i can do a you know ctrl e again just a nice extrude we do kind of this scale in and the couple different axes and we're going to just do this cut out here and then i can do again g for repeat last and just move this back right now this isn't entirely modeling tutorial on this environment but i'm just showing you how i initially roughed this in and then i can extrude this up because this is going to be the next floor and then i can do a quick quick extrusion here and do a little bit of an offset so these planes don't don't overlap too much there we go so then i extrude that out and get something like this then what i want to do of course is go to mesh display reverse so flip those faces then to remove some of these normal artifacts or smoothing artifacts i'll shift right click go to harden there we go and then now you can see our window we have our window here you know i can select these edges here simply you know maybe move these up or maybe i'll grab these pieces here and move these up like so and then now i can punch out that window boom all right so we're starting to look pretty good here we're starting to get everything kind of roughly adjusted and positioned and then now i can go ahead you know and do a quick test here add a v-ray sun and sky so i can go to the v-ray overrides environments create sun create sky and then i can go ahead and you know add or position the sun something like this and we can do a quick test render to kind of see how everything's turning out now you need to make sure of course that if i stop this i need to disable the image plane so just simply hit the image plane icon here in the viewport so now that that's gone we're good right and if i actually bring that back yep we're good there and i can go ahead and do a quick render and of course i need to turn on gi so go ahead and turn on gi and then set your irradiance map just low settings just so it renders out really quick and go ahead and do another render and there we go so now we can start to see everything kind of coming together with this rough block out with the kind of deep default settings here and one side note is that you always want to make sure with your render camera is to lock the camera and then also just to be safe is to go to view bookmarks edit bookmarks and then create a bookmark this is just in case you may move your camera and things are off and then you can always come back to your bookmark and reset it and then you're back to where you need to and this is just helpful if you accidentally shift and move your camera and then you accidentally unlock it right so just something to help you later down the road just in case you bump and move your camera alright so what i want to do now is i will go ahead and jump to that more refined scene where i was able to get a lot further on the modeling and lighting so let's go ahead and open that up and take a look at what we got so you can see here same thing i have my camera set up here you can see that it's right there and i also have you know the more refined modeling of the environment a little bit cleaner i was able to add in the windows up top i was able to add in the stairwells extrusions for the doors and everything's lining up really well really close you know even add the kind of molding here on the the bottom of the stairs here and then just adding in some lights just to get a nicer looking render so what i'll do is i'll go ahead and bring this over here so we can take a look at the renders and here's where we started with the reference image and then here's where we ended up with the the render with the camera match render so if i set this to b and we go ahead and kind of scrub across and we kind of take a look at what's going on we can see that things are starting to align really really well i obviously i don't have the archway on the doors done yet but at least i have the main extrusions and i have the main cutout and there's just more refinement that needs to happen everything's just a proxy right now so all in all i'm really happy with how things are looking and you know hopefully you guys found some some benefit and taking a look at this workflow and then the last thing i wanted to just add was uh when i started setting up the camera for this i did have to recreate the camera here and then reapply all of the camera positioning and settings from the import that i brought in from blender and f spy for whatever reason my did not like me putting the v-ray physical camera properties on the imported camera so all i simply did was just copied over all the transforms copied over the settings for the focal length and then uh we were good to go so just a little bit of a uh hiccup there but after that we were all set so again hopefully you guys found um some benefit in this and enjoyed the workflow so if you guys have any comments feedback critiques um drop them down below um you know that that always helps out the channel like and subscribe is always appreciated so with that take care everyone i'll see you around
Info
Channel: On Mars 3D
Views: 5,382
Rating: undefined out of 5
Keywords: maya, 3d art, autodesk, tutorial, how to, camera, match, matching, reference, image, fspy, blam, blender, perspective
Id: OvsDfgMkljA
Channel Id: undefined
Length: 23min 47sec (1427 seconds)
Published: Sun Apr 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.