I've been trying to get anyportrait to be saved within a prefab in the scene like this
as seen here i have the anyportrait object within the prefab baked. However, once i click play
she turns invisible, and once i stop play, shes still invisible and i have to rebake her! Is there any way to fix this?
Thanks in advance.😀
If the Bake-completed character is well saved and appears in the GameView, then it is normal.
In fact, AnyPortrait's characters are visible in the Scene screen, but not in the Prefab edit screen.
This is a characteristic that occurs because AnyPortrait was developed in consideration of the old Prefab.
However, this is not a bug, and we encourage users to work as follows.
A detailed explanation of this is given below.
This is an example we prepared.
We placed an AnyPortrait character which is stored as a Prefab in a scene.
(1) However, when we open the Prefab placed in the scene, nothing appears in the SceneView.
(2) But in GameView, the character renders normally.
(1) Next, let's open the saved Prefab as an Asset.
(2) You can check the AnyPortrait character objects that exist in the Prefab,
(3) but it is invisible in SceneView.
This is a situation due to the characteristics of AnyPortrait.
AnyPortrait does not store meshes and materials as assets.
When the game starts, AnyPortrait's system creates and controls meshes and materials as instanced objects in runtime based on animation data.
However, only "objects saved as assets" are shown in the Prefab edit screen.
Therefore, characters in AnyPortrait, which do not have meshes or materials saved as assets, are not rendered in the Prefab edit screen.
This is because when we developed AnyPortrait, only the old version of Prefab existed.
This is why compatibility with the new Prefab systems currently in use is not perfect.
We are sorry about this.
So, unfortunately, we recommend that users do the following:
The following way is to use a "new empty scene".
Assuming there is no previous process, create one "new empty scene".
(1) Drag & drop the character saved as "Prefab" to place it in the scene.
(2) The character placed in the scene is not yet rendered.
(1) Select a character and click the "Quick Bake" or "Refresh Meshes" button.
(2) This feature allows the character to be rendered by creating "temporary meshes".
(Unlike the prefab edit state, temporary objects can be shown in the scene edit state.)
Edit the character or modify the Prefab while placed in the scene. (Not in the Prefab edit screen)
If all editing is finished, it will be in the "Disconnected" state as above.
Press the "Apply" button and save your Unity project (Ctrl+S).
The changes will be applied to the Prefab.
(1) Run the game, and (2) you can see that the character is running normally.
When you're done, go back to the original scene you were editing and check it out.
This was originally a common way to edit older versions of Prefabs.
We are also developing AnyPortrait according to this, so it will look a little uncomfortable in the current Unity.
In this regard, we ask for your understanding.
If you have more questions about this issue, please leave a comment!
Thank you for the quick reply! I have did what you said and unpacked it before repacking, however a new issue has occured.
no error messages seen.
Unable to Apply prefab
Tried to place prefab onto scene, unpacked prefab.
baked image, placed object with baked anyportrait as prefab
clicked apply prefab to shop_menu
Shop menu prefab upon open, anyportrait invisible
Upon scene start, anyportrait can be seen in scene, but not in game
Any idea on how to solve this is appreciated.
When a character created with AnyPortrait is baked in the Prefab state, it is temporarily disconnected from the Prefab.
So the changes in the Prefab didn't take effect, so the character may not be visible.
Select a character created with AnyPortrait and click the "Apply" button in the "Prefab" options of the Inspector.
And try to save the scene (Ctrl+S).
Then the Prefab will be saved properly.
Detailed manuals related to Prefab can be found at the link below. The "New prefab system introduced in Unity 2018.3" entry in the link below will help you.
In fact, we are not sure if clicking the "Apply" button will work because we have one question.
When we look at the screenshots you've attached, it looks like you're opening Prefab and editing it.
By the way, AnyPortrait is (unfortunately) impossible to bake when opening a Prefab and editing it.
So, you should always temporarily disable Prefab, edit it, and then "Apply".
By the way, from your article, it appears that you ran Bake with Prefab open.
We didn't make it possible, so we suspect this issue may be due to something else than we thought.
So, first of all, try the above method of "press the Apply button and save the scene" first, and if the problem is not resolved, please let us know more information.
In that case, please let us know if you ran the Bake from within a Prefab or from a Scene.
If you have any error logs, please let us know.
The information helps us solve the problem.
Check out the results and leave a comment!