Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Converting GameObject to Entity 90degrees Off

Discussion in 'Entity Component System' started by ldc3, Aug 14, 2020.

  1. ldc3

    ldc3

    Joined:
    Jul 26, 2018
    Posts:
    9
    The off is a little more complicated than the title, but not much more. It's actually 90 degrees off on one axis and 180 off on another. It's very weird. So my character is dynamic so

    * ConvertAndDestroy converts, but does not render. Tried assigning Mesh and Material, but nothing.

    * ConvertAndInjectGameObject converts only the Top Level. No child objects are converted. That's a problem! I need to have the hand Entity and can't convert it separately due to hierarchy. Add it's parent values is far too complicated and doesn't seem to work either. BUT, character is lined up properly. One problem fixed, but is useless due to the needing of the hand entity.

    * ConvertGameObjectHeirarchy in code converts entire hierarchy but character is 90x180 off in rotations.

    * I changed ConvertAndInjectGameObject to convert children and I get the correct hierarchy, but again, converted model is 90x180 off in rotations.

    I'm not getting any errors and attempts to correct are futile. Now, I have an animator controller and the character moves through idle animation (GameObject version). If ONLY ConvertAndInject is used and I do not convert entire hierarchy, it seems to sync movements. However, with either way I get entire hierarchy, the Entity version does not animate. This makes me think something is not finishing during the conversion process. Again I get no errors, however I do notice that with ECS, we don't always get errors, something just stops and acts very weird. Any thoughts on this and how to fix?
     

    Attached Files:

  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
    This might have been fixed for you in todays hybrid renderer update

    Changed
    • Changed SkinnedMeshRendererConversion to take the RootBone into account. The render entities are now parented to the RootBone entity instead of the SkinnedMeshRenderer GameObject entity. As a result the RenderBounds will update correctly when the root bone is transformed.
     
  3. ldc3

    ldc3

    Joined:
    Jul 26, 2018
    Posts:
    9
    Thanks

    I updated packages and it does seem to make progress lol. So, NOW it's standing up but still 180degrees off on y rotation, no animation, and size is different. At least that 90deg was different. Any idea what might be causing this? I wish documentation was better and there were more tutorials out there on ECS. I love Penny's but once you start getting more complex like this or off the beginner path, we need more in-depth info. At least output errors. Again, I don't need to keep the GameObject if I can get it to work with ConvertAndDestroy.
     

    Attached Files:

    Last edited: Aug 14, 2020
  4. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    I'm struggling with the (most likely) exact same issue. My workaround is to just set the "Root Bone" Attribute of the Mesh to
    None
    , to get the "at least not rotated" behaviour prior to whatever exact version broke this, when I upgraded from hybrid package
    0.5.2-preview.4
    to
    0.8.0-preview.18
    . This workaround is for sure going to cause problems once the animation package is ready in year ≈2029 ;)

    Before that happens I'd assume it will eventually work "just like non Dots" :(:rolleyes:

     
  5. ldc3

    ldc3

    Joined:
    Jul 26, 2018
    Posts:
    9
    The way it's going, 2029 is probably a bit optimistic lol. The way things are going with Unity, seriously considering Unreal. I like Unity but...

    Anyways, I did file a bug report here, let's see where that goes...
     
    nicolasgramlich likes this.
  6. paddan

    paddan

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    13
    Hey, I've been taking a look at the project, and the shaders don't seem to support DOTS skinning.

    To make sure that the skinning data gets applied to the mesh correctly you need to set it up through a Shader Graph node. You can use either Linear Blend Skinning or Compute Deformation.

    I also notice that you're using Hybrid V1. Please note that it is no longer in active development, and the supported feature set for all render pipelines is limited. A better option would be Hybrid V2, which is designed to work well with both Universal and High Definition Render Pipelines.

    Animation Samples use Hybrid V1 and the Linear Blend Skinning node for example:
    https://github.com/Unity-Technologies/Unity.Animation.Samples

    Some relevant docs:
    https://docs.unity3d.com/Packages/com.unity.rendering.hybrid@0.8/manual/index.html
    https://docs.unity3d.com/Packages/com.unity.shadergraph@9.0/manual/Linear-Blend-Skinning-Node.html
    https://docs.unity3d.com/Packages/com.unity.shadergraph@9.0/manual/Compute-Deformation-Node.html
     
  7. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Thanks for the reply.

    Hybrid v2 is currently pretty much unusable due to several bugs in itself or in packages that it requires.

    It would be quite useful if the unity.animation package could be updated - the last update was ≈7 months ago.
     
  8. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
    Hmm? There's been 10 updates, 4 being major, in the last 7 months. The last being 5 weeks ago.

    https://docs.unity3d.com/Packages/com.unity.animation@0.6/changelog/CHANGELOG.html
     
    Last edited: Sep 2, 2020
    nicolasgramlich likes this.
  9. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    825
  10. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Sorry yes, I was talking about the samples.