Skip to playerSkip to main content
#techology #unrealengine #epicgames

Category

🤖
Tech
Transcript
00:00So it has the same content of the, with the USD that I exported before. It has two cameras,
00:11an entire frame range of the sequencer. If I take, if I look through the camera,
00:16has everything exported properly, so it's good. One difference from the other previous export
00:28is that under the composition, it doesn't have layer information. So it's flat standalone file,
00:35meaning that I can confidently delete all the other USD files and open the flat file,
00:45and it should still show everything in the scene.
00:48Yeah. So that's good. So we have one single USD file that's representing all the scene now.
01:02That's great. And let's go back to our slide.
01:11Delete. Then we are going to generate asset type USD file per shot by parsing only necessary
01:22preems from the exported USD file. The logic is like this. If we open a flattened USD file,
01:30there are everything in the scene, everything in the USD, Unreal Engine scene.
01:36And I'm going to delete asset type preems except for the target asset types. For example,
01:46if we want to make cam.usd file, we delete all the other asset type preems and then leave
01:54only cam.usd file. And in that way, only the cam preem and then its children are remaining in the USD
02:06stage and it becomes cam.usd file. Like same thing goes for all the other assets.
02:17So here's the Python concept of it. I have all the folders which are asset types.
02:23Now I'm looping through all the asset types and we need a given target asset type.
02:29Then if they match, I don't do anything. And then if they don't match, I get rid of it from the USD
02:38stage, remove preem. And I save it as an asset type USDA file and then that becomes asset type USD file.
02:50After that, I have many asset type USD files prepared.
02:55And all I need to do is create empty shot USD file and then layer them, everything under here,
03:02and then set proper frame range for the shot USD file. And I only need to look through,
03:08open the shot USD file to view the representation of the shot with the USD.
03:14So here's the full code. The first thing I'm doing is finding assets per shot. So this is the snippet I
03:35demoed before. It's getting the shot information dictionary part.
03:39And once we get the shot information dictionary, we export the scene with USD.
03:53Then export. This is also, I demoed it before. So export, getting level options, level sequence
04:01options, and then export. And then it generates USD files. And then we open the USD file and then we flatten it.
04:14This one I also went over. And this is the new part. So if you can remember, the dictionary key was
04:24shots, right? So looping through the information dictionary is looping through each shot.
04:30And each shot, and then also I'm looping through all the folders, all the asset types. So I'm running
04:38this function, USD parser, per shot and per asset types. And what I'm, what is USD parser?
04:49In the USD parser, it receives the target asset types, and then camera asset name. And input is the
05:02flattened USD file. And you have a shot name as well, and start and end frame.
05:09So if we open the flattened USD file first, and these are some Unreal Engine junks that we don't want to
05:16deliver. So I just get rid of it. I hard coded it for the demo purpose. These are the folders we
05:23defined in the Unreal Engine. And then we have a target asset type received from these functions as an
05:30argument. And if they match, if it doesn't match, we get rid of it from the USD stage. And then
05:39we export it as an asset type. USD. I need to do some more functions just for the camera. Because if you
05:51can remember, there are all the cameras in the scene was exported into the USD files. So even if we get
06:00rid of all the other asset types, there are all the cameras are remaining in the scene. So we need to
06:06pass the proper shot camera and then get rid of all the other unnecessary cameras as well. And then
06:15remaining camera would be the proper shot camera. So I forgot to do this. Let me quickly
06:27delete my console history because it's very messy. And then go back to run.
06:36Then I need to reopen my project. And then
06:41so we're done with
06:43parsing assets and we just generated asset type USD file. The next thing I'm doing is
06:49creating shot.usd file. What it does is I create empty shot.usd file and then I layer all the asset type
07:02usd file under the shot.usd file and then give proper frame range and that becomes our shot.usd file.
07:11So let's try
07:23running the full code here.
07:30Oh, I need to delete empty my output folder. Let's
07:37execute. And it's generating same usd files that before just like before and flattened it. But
07:47now this time it generates two more folders which are shot names. And inside this shot folder,
07:55there are asset type named usd files in here. And then there's shot.usd file. So
08:02let's use by using usd view, let's open shot.usd file. Let's see how first shot looks like.
08:17Okay, great. Now I have proper frame range just like this one. So I have 0 to 44.
08:24And then I only have one camera for the shot. So that's great too. So if I take a look through
08:32or look through the camera, it has everything from the first shot, including my prop.
08:39And if you take a look at the composition under the shot.usd file, you can see all the
08:46usd, asset type usda files are properly layered under shot.usd file. And if you click any of the
08:54cover and make it look like this, you can see it. So this is the top set. It's highlighting,
08:58temp, lighting, lighting, and character is character. So this is what we wanted for the animation
09:06pipeline, so that's great. So I am so excited. So I am going to take a look at the second shot as well.
09:13and there's only one camera, 0020, and I have 74 frames, which is the proper frame range.
09:31I have set dressing, no props from the first shot, and all the animation, camera animation.
09:36So this is our export, a shot export. That's great.
09:43So this is very satisfying, but there are some more things to do.
09:53So far, we restructured USD files exported from Unreal Engine, but it still only has elements that Unreal Engine native USD exports right out.
10:08So sometimes we need to modify USD output, even if we restructured Unreal native output as we desired.
10:18For example, in the real case situation, we have more custom attributes in the control rig, and Unreal Engine's native exporter doesn't write it out.
10:30So we need to add those attributes in the character USD files.
10:34When we were exporting VDB clouds to the downstream, there are more than 300 clouds in there, so the USD file gets heavy.
10:44So FX department wanted it as a point cloud USD format, so we converted our exported USD file as a point cloud.
10:54So in these kind of cases, we need to further modify USD after we export.
11:02It is pretty straightforward.
11:04We just need to open the exported USD file, and then by using any Python modules, or by using USD native API, and then modify and overwrite it.
11:16So I have a very simple example prepared here.
11:24So before I create a chart.usda file, when I was looping through all the chart and asset types, I was running one of the patch scripts that I wrote.
11:34It says character patch, and what it does is it's opening char.usda file, and then it searches for,
11:45look for the character folder, and then get all the children of it.
11:51And then it prints all the actors under the character folder, and then I overwrite it.
11:57In this case, I didn't modify USD file, so it doesn't change any of the content of the USD file,
12:03but if you modify your content here, it will override and generate a new USD file.
12:09And if you take a look at the output log, there's a patch script, and it printed out our character right here.
12:21So that was the very simple example of my concept, and the patch script concept.
12:27Oops, like this.
12:31The idea I presented is just a prototype.
12:51We used much more complicated logic in our real production.
12:57We ran into many issues and resolved it, and finally we delivered full feature film animation with this pipeline.
13:05We delivered everything, all the Unreal Engine output with USD.
13:09We delivered camera, character, props, and environment to Maya.
13:14We delivered lighting for one sequence to Katana, and we delivered VDB clouds to Houdini with USD.
13:22And this is now our standard pipeline.
13:27So this is the trailer of the first movie that we created with this pipeline.
13:32It will be released in Netflix in June 20th, so please enjoy.
13:37I can destroy the hundreds.
13:40This is YouTube, so you can watch it in YouTube.
13:43For a new strategy.
13:45Then.
13:46Sorry.
13:49In last year's Unreal Fest, we presented some of the challenges you may run into when developing USD pipeline in Unreal Engine.
14:01It's pretty high level talk, but it can be helpful if you're interested.
14:06There's some C++ solutions and issues in this talk.
14:11Very high level, but if you're interested, it may be a good resource.
14:16I'm glad that my brain was not damaged from last night's party.
14:22So, thank you.
14:25Let's go export more USD.
Be the first to comment
Add your comment

Recommended

0:08