# What are Packages and their relationship to Assets

**URL:** <https://forums.unrealengine.com/t/what-are-packages-and-their-relationship-to-assets/1389008>\
**Category:** C++\
**Tags:** unreal-engine, CPP, question\
**Created:** [November 14, 2023, 3:26am UTC](https://forums.unrealengine.com/t/what-are-packages-and-their-relationship-to-assets/1389008 "2023-11-14T03:26:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![huntsfromshadow](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@huntsfromshadow](https://forums.unrealengine.com/u/huntsfromshadow)\
**Post date:** [November 14, 2023, 3:26am UTC](https://forums.unrealengine.com/t/what-are-packages-and-their-relationship-to-assets/1389008/1 "2023-11-14T03:26:01Z")

</div>

So I’m working on building code that will make DataTable from CSV automatically.  
I got some to code to work that creates a blueprint but it has to create a package first.

Working with code I have a very high-level fundamental question.  
What is a Package and what is its relationship to Assets?

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [November 14, 2023, 10:10am UTC](https://forums.unrealengine.com/t/what-are-packages-and-their-relationship-to-assets/1389008/2 "2023-11-14T10:10:37Z")

</div>

Packages are just containers for assets. In code, package is the Outer of an asset.

In UE4/5 most packages types contain only one asset, which has the same name as the package. For example a Texture2D uasset package contains just one Texture2D object with the same name.  
package path : /Game/Textures/T\_Foo.uasset  
asset name : T\_Foo  
fully qualified asset path : /Game/Textures/T\_Foo.T\_Foo

One exception is blueprint packages, where the “main” asset is the Blueprint itself (the thing you edit in editor), but its package also contains the generated class and CDO with slightly different names.

In case of datatables I think they are single-asset packages, so it should be pretty easy to handle. Create a package with `CreatePackage`, and use that as the Outer of the new asset you create. Then call SavePackage and it should do.

See this for more extensive info

> [@Knowledge Base: How To: Create New Assets in C++](https://forums.unrealengine.com/t/how-to-create-new-assets-in-c/264944):
>
> Article written by Cody A. When writing editor scripts or plugins, it may be useful to be able to programmatically create a new asset that appears in the content browser. There are a few helper functions available to he… [https://dev.epicgames.com/community/learning/knowledge-base/wzdm/unreal-engine-how-to-create-new-assets-in-c](https://dev.epicgames.com/community/learning/knowledge-base/wzdm/unreal-engine-how-to-create-new-assets-in-c)

---

<div class="post-metadata">

**Author:** ![huntsfromshadow](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@huntsfromshadow](https://forums.unrealengine.com/u/huntsfromshadow)\
**Post date:** [November 14, 2023, 2:54pm UTC](https://forums.unrealengine.com/t/what-are-packages-and-their-relationship-to-assets/1389008/3 "2023-11-14T14:54:05Z")

</div>

Thank you.  
This very much helps to clear things up.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [December 14, 2023, 2:54pm UTC](https://forums.unrealengine.com/t/what-are-packages-and-their-relationship-to-assets/1389008/4 "2023-12-14T14:54:22Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
