Log in or register to post comments

Model Target fail to create Prefab

March 21, 2019 - 8:38am #1

Hi,

I've been working a lot for the last year with model targets (Without any issue) but i've encountered some with the new workflow.

I used the Model Target Generator (v8.1.8) to generate both singles targets and a trained dataset, but none of them are working within Unity. Each time I try to import it in Unity i have a "Failed to create prefab!" error and the supposedly created 3D model is a giant stretched plane.

I looked at some other posts here, thinking it was maybe compatibility issues with the versions, but none of my versions works (2018.3.0/3/5), even when people pointed them as good with the MTG version.

Is there any problem with theses versions or a step i'm missing ?

Thanks for your help.

Model Target fail to create Prefab

April 25, 2019 - 5:16am #12

I figure out it doesn't work with color Model,but work with unpainted Model.

Model Target fail to create Prefab

April 24, 2019 - 1:56pm #11

Hello @cmown,

We did some additional investigation and were able to reproduce. A bug has been filed to resolve the issue in an upcoming release.

Note that despite the warning message we found *no* malicious side effects. In other words, the error does not affect the SDK's ability to detect and track Model Targets. Therefore, I don't believe the reason your 3D object isn't being detect is related to this issue.

A quick way to verify that Vuforia Engine is working for Model Targets is to test your device database with one of the Model Target Generator artifacts:

  1. Load your 3D model into MTG and follow the workflow to create the device database: https://library.vuforia.com/content/vuforia-library/en/articles/Solution/model-target-generator-user-guide.html
  2. Print the PNG file that visualizes the object in its guide view position: ...\Model_Target_Generator-win32-x64\resources\sampledata\<project-name>\<guide-view-name_1.png>
    • This is *not* the default guide view
    • I've attached an example to this post
  3. Integrate the Model Target device database into the Unity project
  4. Run the project in Play Mode
  5. Align the target's guide view with the printed PNG from #2

How does this help? It lets you know that the device database has been activated and that Vuforia Engine is working. However, as it is testing with an artifact generated by the MTG, it *does not* mean that the actual object can be detected.

There are a handful of actions you can take to improve the detection of your 3D model when using the Model Targets Feature:

  1. Correct scale of the model is important for detection and tracking. Confirm that the scale of your CAD model is an accurate representation of your physical model. We also recommend using meters as your unit of measurement.
  2. A more detailed model should provide a better tracking experience. While higher poly counts can work, we recommend keeping the count below 100k for best performance.
  3. Which elements to remove from your 3d model may depend upon the experience you're trying to create. For example, if you want to detect a car from an exterior vantage point, then the interior elements are not going to provide benefit to detection and tracking and as such you can consider removing them.
  4. Connected or fused meshes do not necessarily improve performance.
  5. Remove transparent geometry from you CAD data. For example, if you are trying to detect a car, it is recommended that you do not include any of the windows or lights in the CAD model that will be used for the Model Targets dataset.
  6. Include texture differences in your CAD model. Using the car example again, if the car has a decal painted on it or has a segment, such as the hood, that is a different color from the rest of the model, make sure that is included in your CAD model. This difference in texture will be used in the detection of the target, although it is difficult to quantify how much this can improve performance.
    • The current model targets is not designed to work with realistic-looking textures with many different colors. They work best with single-colored surfaces that contain logos, etc.
    • There are two ways to add these elements to the 3D model:
      • Map a texture onto the model. Probably the simplest solution, since you should already have that from the cylinder targets. The texture image should ideally come directly from your design software and not be from a scan of the can.
      • Use geometry with different colors. Different colors will be considered as different materials. No special material IDs are needed.
        • The “different colors” used *do not* need to match the actual colors that appear on the physical object. The difference in colors will provide the geometry needed by the SDK for detection.
  7. Use different colors on the model when there are different materials or colors on the real object. While Model Targets is designed to detect objects by shape, giving additional information on the materials will often greatly improve detection robustness.
    • There is no need for model colors to match the colors of the real object - the specific color is not relevant, just the differences in colors.
    • Colors can be used to indicate different parts with small gaps in-between that are strongly visible but are difficult to extract from a rendered view. One example is the area between the body and the door of a car.
    • If possible, avoid single-color models and file formats that can’t transport color information such as STL.
  8. Simplification tools, such as Simplygon, are able to process logos and transform them into geometry (edges). However, if you used Blender for simplification, it may destroy this info.
  9. Model targets is designed to be used with CAD-like models that use only a few colors to indicate different materials. Please avoid photorealistic textures from game-like models, or photogrammetry scans. If you need to use photogrammetry scans, please remove the texture before importing into the MTG.
  10. Try a different guideview for your target. If the guideview you are using doesn't contain enough of the geometry of your target, you may encounter issues detecting it. Often times a slightly angled view of the target will provide better results than a direct front view of the target.
    • Recommended to avoid fronto-parallel viewpoints and choose diagonal views for detection, where possible.
  11. There are a few of different approaches to a different guideview you could try that may result in better performance:
    • Try zooming in on the section of the object with the most geometry for your guideview, while keeping the rest of the model out of the view of the guideview. This will allow detection to be based off a smaller portion of the Model Target that is rich in geometry, but also will keep the rest of the model present. While moving back to see the rest of the model you will begin mapping the surroundings and likely end up with a better tracking experience.
    • Another potential guideview would be closer, but at an angle from the front-left or front-right of the object. This will allow you to get the full object in view, but also start closer and allow more tracker mapping as you move around the object.
    • Avoid highly cluttered areas on your object as detection views, such as areas with heavy wiring or highly repeated structures. Choose a view that has sufficient distinctive geometry without too many small details. It is not necessary to see the whole object for detection, but you can zoom in onto a suitable area if that is feasible for your application.

Note: Material differences are used for Model Target detection, but they do not appear in the guide view. Thus, the guide view is not the final indicator for object geometry

Model Target fail to create Prefab

April 23, 2019 - 8:08pm #10

After Generate from MTG, import into Unity. See Vuforia Configuration,Pic.1 attached.

 

Then Add Model Target into Unity Scene,Pic.2,I got Erro:

Disconnecting is no longer implemented

UnityEditor.PrefabUtility:DisconnectPrefabInstance(Object)

Vuforia.EditorClasses.ModelTargetEditor:GetTargetModel(String, String, String)

Vuforia.EditorClasses.ModelTargetEditor:UpdatePreviewMesh(GameObject, String, String)

Vuforia.EditorClasses.ModelTargetEditor:AddModelPreviewInScene(SerializedModelTarget, String)

Vuforia.EditorClasses.ModelTargetEditor:UpdateModelPreviewAndGuideViewControls(SerializedModelTarget, String)

Vuforia.EditorClasses.ModelTargetEditor:SetDataset(SerializedModelTarget, String, String)

Vuforia.EditorClasses.ModelTargetEditor:SetDefaultDataset(SerializedModelTarget)

Vuforia.EditorClasses.ModelTargetEditor:EditorConfigureTarget(ModelTargetBehaviour, SerializedModelTarget)

Vuforia.EditorClasses.ModelTargetEditor:OnEnable()

 

And Model Target Inspector seems right,Pic.3:

 

BUT CANT recognize Dog Model.

Model Target fail to create Prefab

April 23, 2019 - 12:42pm #9

Hello @cmown,

Thanks for the additional details. We've been able to replicate the message and are investigating further.

Can you please explain the impact to your project? Can the Model Target device database not be loaded? Does detection and tracking not work?

Thanks,

Vuforia Engine Support

Model Target fail to create Prefab

April 22, 2019 - 10:45pm #8

Using Vuforia Engine 8.2 Early Access for Model Targets 360:

After generate Target Database(both trained and untrained),Import *.unitypackage into Unity2018.3.*.

The error is here:

Reading 3D model scene...

UnityEngine.Debug:Log(Object)

Vuforia.EditorClasses.GLTFLoader:LoadGLTFFile(String, String, Dictionary`2)

Vuforia.EditorClasses.CADModelExtractor:ReadModels(String, Dictionary`2)

Vuforia.EditorClasses.CADModelExtractor:ReadModels()

Vuforia.EditorClasses.ExtractModelsTask:Execute()

Vuforia.EditorClasses.<>c:<OnPostprocessAllAssets>b__1_0(VuforiaLifeCycleTask)

System.Collections.Generic.List`1:ForEach(Action`1)

Vuforia.EditorClasses.AssetPostProcessTaskRunner:OnPostprocessAllAssets(String[], String[], String[], String[])

UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])

 

Failed to create prefab!

UnityEngine.Debug:Log(Object)

Vuforia.EditorClasses.CADModelExtractor:ReadModels(String, Dictionary`2)

Vuforia.EditorClasses.CADModelExtractor:ReadModels()

Vuforia.EditorClasses.ExtractModelsTask:Execute()

Vuforia.EditorClasses.<>c:<OnPostprocessAllAssets>b__1_0(VuforiaLifeCycleTask)

System.Collections.Generic.List`1:ForEach(Action`1)

Vuforia.EditorClasses.AssetPostProcessTaskRunner:OnPostprocessAllAssets(String[], String[], String[], String[])

UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])

Model Target fail to create Prefab

April 22, 2019 - 1:40pm #7

Hello @cmown,

Sorry, but I don't know what you mean by "I got the same issue". Please provide an explanation of the Vuforia Engine error you're observing, and how it is impacting your project. Include any steps required to reproduce.

With your provided 3D model, I was able to:

  1. Create a Model Target dataset with the Model Target Generator (single guide view, untrained)
  2. Import into the Vuforia Engine Core samples for Unity
  3. Detect and track a printout of the object (using artifacts created by the MTG)

Thanks,

Vuforia Engine Support

Model Target fail to create Prefab

April 20, 2019 - 7:58pm #6

I got the same issue. here is my obj model. 

AttachmentSize
Package icon Model_Origin.zip7.62 MB

Model Target fail to create Prefab

April 2, 2019 - 12:01pm #5

Hello,

I can only further evaluate if I have the 3D model that you're importing into the MTG. Please attach to this thread, or DM me a link.

Thanks,

Vuforia Engine Support

Model Target fail to create Prefab

April 2, 2019 - 2:46am #4

Hi,

With exactly the same configuration as yours it's still not working properly. I'm having the generated 3D model with unusual scale values (6e+14) and if put to 1, I get a correct model in shape but not in scale (capture of the model attached to the message) so I can't correctly position content around it.

The 3D model is exactly as in the attached image, and worked well with the older versions of model target (Haven't modified it since).

AttachmentSize
Image icon model.png39.99 KB

Model Target fail to create Prefab

March 26, 2019 - 11:58am #3

Hello,

I just tried a simple test to create an untrained Model Target with 8.1.8 Model Target Generator, and import it into Unity 2018.3.0f2 (Engine SDK 8.1.7). I didn't have any issues.

What version of Vuforia Engine SDK are you using? Can you provide an example of a 3D model that generates this error so I can try and reproduce?

Thanks,

Vuforia Engine Support

Model Target fail to create Prefab

March 25, 2019 - 2:51pm #2

I am also getting error "Failed to create prefab" when importing custom package generated using Model Target Generator (v8.1.8).

let me know if any one has work around or ways to resolve this issue.

Log in or register to post comments