Announcement

Collapse
No announcement yet.

Exploding a CAD assembly and picking up individual parts in VR

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Exploding a CAD assembly and picking up individual parts in VR

    Hello! I'd like to create a custom Engineering environment and I am wondering what the best way is to approach this. Here is what I would like to do:
    • View a CAD assembly in VR.
    • Smoothly animate the assembly exploding in midair and un-exploding (Ideally in steps - meaning certain parts come apart first, then other parts, etc.)
    • Grab individual parts in VR, when they are either exploded floating in the air or un-exploded.
    • Activate gravity on the individual parts when you release them after grabbing them, so they can fall on the floor or on a table.
    • Have the individual parts snap back to their original exploded position (by means of a button press or some other trigger).
    I know for a fact that all of this is entirely possible, but I am not sure how to approach it. I realize this will take some custom work. Could someone please give me some pointers? Ideally I would like to keep this in Blueprint rather than C++.

    For software outside of UE4, I primarily use Fusion 360 for CAD, and Blender for gamedev related modeling/animation. I am also open to using Maya if it works better for this application.

    I would greatly appreciate any help getting started on this!
    Last edited by Matt2468rv; 09-11-2018, 10:43 PM.

    #2
    My two cents:

    - Perfectly doable, but you need to consider how many parts you have in your assembly, siunce the mantra is "the more parts you have the more draw calls you have", so FPS could take a hit because of that
    - If you have the possibility to save the exploded view and use it as a CAD model, I would suggest to use that in order to store the world transform for each part in UE4, so that you can use those values ( into an excel sheet or array ) and do an interpolation between the unexploded view and the exploded view. Since each assembly is its own beast, this method might not work properly, so an alternative would be to use a timeline with a float value ( 0 to 100/200mm ), that would drive the original part position to the "exploded" position, then use the float value for the next component, multiply that by 2, and explode that sequentially, so that each part will be exploded from the other part by 100-200mm....but this is very time consuming.
    - Doable in different ways: Modify the Interactive cube from the VR Template by replacing the cube with your part, repeat for each single CAD part; assign a tag to every CAD part ( select all the cad part in the scene, go to tag and add one ), and have the interactivity setup in your Motion Controller BP to enable the grabbing when the motion controller is overlapping a part with that tag.
    - You can either set Simulate physics on each part, or you can do that one by one in a BP by adding a Physic constraint actor
    - The best way to unexplode the parts would be to have your CAD file separated into sub-assy, so that, by using a UMG menu, you can choose to unexplode just that sub-assy, rather then the entire assembly.

    BR,

    Nicolas
    ENTER REALITY

    VR Solutions

    Contact us for more informations

    Comment


      #3
      I'm not too worried about FPS, UE4 should be able to handle many parts if paired with decent hardware.

      I have gotten an assembly to smoothly explode and un-explode but this was done by using morph targets that I created in Blender and the assembly was exported to FBX as one model. This means there's no possibility of grabbing an individual part in VR (only the whole thing) so it's not feasible.

      I think for it to work properly, there needs to be some way to store the individual position of each part in both the exploded and un-exploded state and animate between the two positions. I am not sure what the best way is to approach this. I don't know of any way to export offset positions from any CAD software, and if it's possible to do this in Blender or Maya then I'm not sure where to start.

      It would sure be nice if there was a tool within Unreal Studio that allows you to create an "exploded view" in steps similar to any CAD software. Basically you'd select the first set of parts that should explode and move them, select the next set of parts and move them, and so on until everything is exploded and then those positions would be stored. Then it could animate the explode going through step 1, 2, etc. All this really comes down to is several sets of offsets for all of the parts, right? I wonder if it's possible to make something like this?

      The grabbing and gravity won't be too hard I think. I have done that before with individual models. I think the tricky part is getting everything to explode and un-explode properly and also grab and manipulate individual parts.

      Comment


        #4
        Originally posted by Matt2468rv View Post
        I'm not too worried about FPS, UE4 should be able to handle many parts if paired with decent hardware.

        I have gotten an assembly to smoothly explode and un-explode but this was done by using morph targets that I created in Blender and the assembly was exported to FBX as one model. This means there's no possibility of grabbing an individual part in VR (only the whole thing) so it's not feasible.

        I think for it to work properly, there needs to be some way to store the individual position of each part in both the exploded and un-exploded state and animate between the two positions. I am not sure what the best way is to approach this. I don't know of any way to export offset positions from any CAD software, and if it's possible to do this in Blender or Maya then I'm not sure where to start.

        It would sure be nice if there was a tool within Unreal Studio that allows you to create an "exploded view" in steps similar to any CAD software. Basically you'd select the first set of parts that should explode and move them, select the next set of parts and move them, and so on until everything is exploded and then those positions would be stored. Then it could animate the explode going through step 1, 2, etc. All this really comes down to is several sets of offsets for all of the parts, right? I wonder if it's possible to make something like this?

        The grabbing and gravity won't be too hard I think. I have done that before with individual models. I think the tricky part is getting everything to explode and un-explode properly and also grab and manipulate individual parts.
        Honestly, you should be worried about FPS.
        CAD assemblies often have thousands of parts, so if you're not in VR that is not a big issue, but in VR the amount of draw calls is one of the biggest issue, so if exceed with the amount of parts in the scene, you'll begin to have a performance hit.

        Informations from the CAD files are usually stored into the .cfg file, so I guess that the best way would be to get all the data from there, store it into UE4 into an array, then use it automatically.

        Regarding the "auto explode view", you can build it right now, possibly using the method mentioned in my previous post, additionally storing all the selected parts into an array, then use only those and explode them by a certain amount between each other.

        I think that you need to take into account if you really want to be every single part to be interactive, so if you really want that small washer to be interactive, or to be a part of the model itself, since that would ne something not 100% necessary.
        ENTER REALITY

        VR Solutions

        Contact us for more informations

        Comment


          #5
          Some of the asked functionality will make its way in future versions of the product viewer template that ship with studio. Do you have examples in mind of other softwares that work well with regards to exploding parts that we should look at?
          Pierre-Felix Breton

          Sr Technical Product Manager AEC, Unreal Engine Enterprise
          Epic Games - LinkedIn


          Unreal Studio Documentation
          Unreal Studio Technical Support
          Report Unreal Studio Bugs

          Comment


            #6
            Originally posted by pf_breton View Post
            Some of the asked functionality will make its way in future versions of the product viewer template that ship with studio. Do you have examples in mind of other softwares that work well with regards to exploding parts that we should look at?
            That's great to hear! Yes, here are some examples of exploded view functionality:

            Solidworks: https://help.solidworks.com/2018/Eng...oded_Views.htm
            Fusion 360: http://help.autodesk.com/view/fusion...9-1122A612A006
            Creo: http://support.ptc.com/help/creo/cre...ded_Views.html

            I think the most user friendly example is Solidworks. For every explode "step" you can select a group of parts that should move to an exploded position. Then for the next step, you move another set of parts (that can also include the first set of parts you moved). Once you're done, Solidworks smoothly animates everything coming apart and going back together. It works very well. I'd assume it basically stores several sets of offsets and moves the parts accordingly.

            Explode in Fusion 360 and Creo also works pretty well. Fusion 360 uses an animation workspace/timeline for everything coming apart so you can fine tune things. Creo is a different beast but it's very powerful.

            If you'd like, I'd be willing to help test and improve aspects of the product viewer template that ships with studio, especially in regard to exploding assemblies. I have a lot I could throw at it!

            Comment


              #7
              Originally posted by Enter Reality View Post

              Honestly, you should be worried about FPS.
              CAD assemblies often have thousands of parts, so if you're not in VR that is not a big issue, but in VR the amount of draw calls is one of the biggest issue, so if exceed with the amount of parts in the scene, you'll begin to have a performance hit.

              Informations from the CAD files are usually stored into the .cfg file, so I guess that the best way would be to get all the data from there, store it into UE4 into an array, then use it automatically.

              Regarding the "auto explode view", you can build it right now, possibly using the method mentioned in my previous post, additionally storing all the selected parts into an array, then use only those and explode them by a certain amount between each other.

              I think that you need to take into account if you really want to be every single part to be interactive, so if you really want that small washer to be interactive, or to be a part of the model itself, since that would ne something not 100% necessary.
              If FPS is ever an issue, all that really comes down to is proper LOD for all of the models. UE4's built in tools certainly help with that.

              Do you mean there is a .cfg file generated from CAD software such as Solidworks or Fusion 360?

              The auto explode view idea is pretty cool. I don't think it could be used practically since it would work in unexpected ways (parts need to move in different directions and come apart correctly) but it might be a quick and dirty way to get an initial idea of all of the parts in an assembly. A proper exploded view needs to be hand placed in steps, like Solidworks for example.

              I do want every single part to be interactive. I have personally seen everything I described accomplished in Unity engine, and I know UE4 can handle it as well.

              Comment


                #8
                pf_breton I see in the product viewer template there's a blueprint titled "Explode_BP". What is the correct way to use this blueprint?

                EDIT: I was able to get the Explode_BP working by following your instructions in this post. Awesome! Now while I can explode and rebuild, this does break the interactability of the parts. Would I run into any roadblocks trying to re-implement the interactability? What's the best way to do so?

                I do already have one suggestion for improving the Explode_BP with interactivity in mind. The timeline to move the parts to explode/rebuild lerps between the exploded and un-exploded transforms. It should instead get the current transform for each part and lerp between the current transform and the desired exploded/un-exploded transform because if the parts are interactable, they could be positioned wherever by the player.
                Last edited by Matt2468rv; 09-16-2018, 12:14 AM.

                Comment


                  #9
                  hey Matt2468rv, this is what P-F was alluding to above, when he mentioned that the Product Viewer would get some improvements in this area. In the upcoming 4.21 release, you should see that the behavior is pretty much as you describe. The parts are still interactable, and just lerp between their current position and the positions you set for them in the explode blueprint.

                  Comment


                    #10
                    Originally posted by Robb Surridge View Post
                    hey Matt2468rv, this is what P-F was alluding to above, when he mentioned that the Product Viewer would get some improvements in this area. In the upcoming 4.21 release, you should see that the behavior is pretty much as you describe. The parts are still interactable, and just lerp between their current position and the positions you set for them in the explode blueprint.
                    although we haven’t fully designed it yet . We want to consider hierarchy at some point and that bp isn’t entirely what we need

                    Pierre-Felix Breton

                    Sr Technical Product Manager AEC, Unreal Engine Enterprise
                    Epic Games - LinkedIn


                    Unreal Studio Documentation
                    Unreal Studio Technical Support
                    Report Unreal Studio Bugs

                    Comment


                      #11
                      Robb Surridge Awesome! That's the exact functionality I need. On top of that I want to be able to enable gravity and collision after you grab a part and release it, so that parts can be set down on a table or thrown aside. Then when exploding/rebuilding, the parts would disable gravity and lerp back to their original exploded/unexploded position. This seems like the most realistic and natural way to manipulate CAD assemblies in VR. I also eventually want to get Leap Motion working with it for an even more natural experience.

                      pf_breton What do you have in mind as far as considering hierarchy? The functionality previously described will still be possible, right?
                      Last edited by Matt2468rv; 09-18-2018, 10:46 AM.

                      Comment


                        #12
                        what is with the possibilities Marc Bouchard showing in this video? Is this available somewhere and the Engine as well?

                        https://academy.unrealengine.com/Lea...wer%20Template

                        Comment


                          #13
                          Originally posted by cgArchitekt View Post
                          what is with the possibilities Marc Bouchard showing in this video? Is this available somewhere and the Engine as well?

                          https://academy.unrealengine.com/Lea...wer%20Template
                          What Marc shows in that video is already in the 4.20 version of the Product Viewer template. He's reworked and improved it in 4.21 to make it simpler to set up.

                          Comment


                            #14
                            Originally posted by robb surridge View Post
                            what marc shows in that video is already in the 4.20 version of the product viewer template. He's reworked and improved it in 4.21 to make it simpler to set up.
                            ETA? .

                            Comment


                              #15
                              4.21
                              No official date yet, but look for it probably in early November.

                              Comment

                              Working...
                              X