Announcement

Collapse
No announcement yet.

[OPEN-SOURCE] Machinery Modelling Toolkit

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

    Hello @BoredEngineer, I was wondering if I could get you're help. So I'm trying to make an ATV with tracks on them and I've tried many methods even with this system, but I've run into a lot of confusion when trying to integrate the build track and Animation system with what I have. The current system that I have set up is using a wheeled vehicle BP with one rigged mesh and that works well aside from the tracks. So could I get a bit of help with trying to figure out how to integrate this system with my ATV? Much appreciation if you can! https://youtu.be/najd-xwb5ZE

    Comment


      greetings again you upload the plugin for 4.25 but its request visual studio to compile could you upload or just compile the plugin to work with 4.25 as you did in 4.22 version of it would you or you just could hope you response as could you can as by evening and thanks............................................

      Comment



        https://github.com/BoredEngineer/MMT_Content

        Comment


          master content

          Comment


            Hi, truly amazing work with this plugin. But unfortunately i might be too stupid to get the plugin working in another project. Seems like the MMT Tick is never being called.

            I feel Iam missing something important but I am going nuts trying to find it.

            - A reboot changed everything.... sorry for premature post

            I should not have delved into such project as total newbie, but i managed to get all running with a clean build from scratch


            Again thanks alot for this nice plugin
            Last edited by Brandungsfels; 07-03-2020, 11:59 AM.

            Comment


              Hi, I have another question

              Since the physics event tick should be the place where we call the mmt commands like addforce and addtorque, I was wondering if there is a way to call an event to perform in this physics event tick ONLY on call. Atm I have the functions which should be called placed inside the physics tick with one variable set to 0, so whenever I need this function to be called I just change the value to sth unequal to 0. But since this doesnt seem to be a very clean solution, I was wondering if there is an easy way around this "sleeping function".

              Thx in advance

              Comment


                Hi BoredEngineer,
                Been trying to rebuild plugin for source build of UE4-4.25.1.(Chaos enabled). Using the RunUAT and have these errors. My apologies, I'm not that skilled in programming to sort this one out.
                I do have it all working in my UE4 4.23 source build with ChaosDemo. I'm using your latest source MMT plugin from GitHub. To get this far I had to edit the .cpp file's #include "MMT.h" (example) and place them 1st.
                Also this one "Cannot open include file: 'ModuleManager.h': No such file or directory" I just added a path to it's location in the MMT.h. ie; "#include "G:\UE4-4.25.1-S\Engine\Source\Runtime\Core\Public\Modules/ModuleManager.h"
                seems to have fixed that one. But this is where I am now stuck.

                ProcessResult.StdOut: [2/6] Module.MMT.cpp
                ProcessResult.StdOut: G:/UE4_Src_Projects/MMT_Folder/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(125): error C2228: left of '.IsValid' must have class/struct/union
                ProcessResult.StdOut: G:/UE4_Src_Projects/MMT_Folder/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(125): note: type is 'FPhysicsActorHandle'
                ProcessResult.StdOut: G:/UE4_Src_Projects/MMT_Folder/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(125): note: did you intend to use '->' instead?
                ProcessResult.StdOut: [3/6] Module.MMT.gen.cpp

                Any help much appreciated. Thanks BoredEngineer.

                Comment


                  First to have a clean include just change
                  Code:
                  #include "ModuleManager.h"
                  to
                  Code:
                  #include "Modules/ModuleManager.h"
                  For the compile error regarding chaos change the line with the IsValid() check to:
                  Code:
                  #if WITH_CHAOS
                  if (PhysicsActor.IsParticleValid())
                  #else
                  if (PhyiscsActor.IsValid())
                  #endif

                  Comment


                    Hi MaSe87, Thanks for reply. Your code gave me pretty much same error. Your
                    #include "Modules/ModuleManager.h"
                    is a lot neater, thanks for that.

                    G:/MMT_Plugins/MMT_Plugins_rebuild/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(128): error C2228: left of '.IsParticleValid' must have class/struct/union
                    G:/MMT_Plugins/MMT_Plugins_rebuild/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(128): note: type is 'FPhysicsActorHandle'
                    G:/MMT_Plugins/MMT_Plugins_rebuild/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(128): note: did you intend to use '->' instead?


                    //AddTorque to a component using BodyInstance as its valid during physics sub-stepping
                    void UMMTBPFunctionLibrary::MMTSetInertiaTensor(UPrimitiveComponent * Target, const FVector& InertiaTensor)

                    {
                    FBodyInstance* BodyInstance = GetBodyInstance(Target);
                    if (BodyInstance != NULL) {
                    FPhysicsActorHandle PhyiscsActor = BodyInstance->GetPhysicsActorHandle();
                    //if (PhyiscsActor.IsValid())
                    #if WITH_CHAOS
                    if (PhyiscsActor.IsParticleValid())
                    #else
                    if (PhyiscsActor.IsValid())
                    #endif
                    {
                    FPhysicsInterface::SetMassSpaceInertiaTensor_AssumesLocked(PhyiscsActor, InertiaTensor);
                    }
                    }
                    }

                    I have noticed some misspelling of "physics" in the code in several lines ie; it's spelled "phyiscs" in places.,that's in the original MMTBPFunctionLibrary.cpp file. Not sure if that's causing any problems or not. I've tried using correct spelling on those and rebuilding plugin,...did not help either. ( was worth a shot. lol.) Thanks again for your help.

                    Comment


                      Not sure what I'm doing wrong here, but if I try and use Parent Bone Space for my suspension, the road wheel will for some reason move 1.7km away immediately upon simulation. If I use Component Space it works as intended, however.

                      Has there been any changes with 4.25? Cross-referenced my blueprints and rig to that of the LightTankTraceWheelsWithAnimBPPrototype a hundred times but I simply can't figure out what I've done wrong here.

                      Last few hours I've been trying to get the suspension arm to rotate along the Y-axis using LookAt so it looks as if it's attached to the road wheel. But I simply can't get it to work. It'll either look in really weird directions or simply just not inherit any of the wheel's "height".

                      Any ideas? For context it's a rather accurately modeled Tiger 1 torsion bar suspension(torsion bar and suspension arm are modeled).

                      Edit:

                      Well I found part of the issue, if I divide the location calculated in the UpdateAnimationWheels function by 10.0 - it works as intended. For some reason any transform I'm doing to a bone is multiplied by 10.

                      I thought that usually resetting the XForm fix these kind of weird behaviours, but sadly it did not in this case...

                      Edit 2:

                      Solved, System Unit Setup had for some reason decided to change so 1 Unit = 10.0cm. So now I have to re-scale everything...
                      Last edited by Dealman; 07-19-2020, 10:14 AM.

                      Comment


                        Originally posted by FlyingPencil View Post
                        Hi MaSe87, Thanks for reply. Your code gave me pretty much same error. Your
                        #include "Modules/ModuleManager.h"
                        is a lot neater, thanks for that.

                        G:/MMT_Plugins/MMT_Plugins_rebuild/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(128): error C2228: left of '.IsParticleValid' must have class/struct/union
                        G:/MMT_Plugins/MMT_Plugins_rebuild/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(128): note: type is 'FPhysicsActorHandle'
                        G:/MMT_Plugins/MMT_Plugins_rebuild/HostProject/Plugins/MMT/Source/MMT/Private/MMTBPFunctionLibrary.cpp(128): note: did you intend to use '->' instead?


                        //AddTorque to a component using BodyInstance as its valid during physics sub-stepping
                        void UMMTBPFunctionLibrary::MMTSetInertiaTensor(UPrimitiveComponent * Target, const FVector& InertiaTensor)

                        {
                        FBodyInstance* BodyInstance = GetBodyInstance(Target);
                        if (BodyInstance != NULL) {
                        FPhysicsActorHandle PhyiscsActor = BodyInstance->GetPhysicsActorHandle();
                        //if (PhyiscsActor.IsValid())
                        #if WITH_CHAOS
                        if (PhyiscsActor.IsParticleValid())
                        #else
                        if (PhyiscsActor.IsValid())
                        #endif
                        {
                        FPhysicsInterface::SetMassSpaceInertiaTensor_AssumesLocked(PhyiscsActor, InertiaTensor);
                        }
                        }
                        }

                        I have noticed some misspelling of "physics" in the code in several lines ie; it's spelled "phyiscs" in places.,that's in the original MMTBPFunctionLibrary.cpp file. Not sure if that's causing any problems or not. I've tried using correct spelling on those and rebuilding plugin,...did not help either. ( was worth a shot. lol.) Thanks again for your help.
                        I have never tried it with a engine source build. No idea what could be wrong there, perhaps it's just the old "style" for some function calls.
                        Youtube Channel

                        Comment


                          Originally posted by Dealman View Post
                          Not sure what I'm doing wrong here, but if I try and use Parent Bone Space for my suspension, the road wheel will for some reason move 1.7km away immediately upon simulation. If I use Component Space it works as intended, however.

                          Has there been any changes with 4.25? Cross-referenced my blueprints and rig to that of the LightTankTraceWheelsWithAnimBPPrototype a hundred times but I simply can't figure out what I've done wrong here.

                          Last few hours I've been trying to get the suspension arm to rotate along the Y-axis using LookAt so it looks as if it's attached to the road wheel. But I simply can't get it to work. It'll either look in really weird directions or simply just not inherit any of the wheel's "height".

                          Any ideas? For context it's a rather accurately modeled Tiger 1 torsion bar suspension(torsion bar and suspension arm are modeled).

                          Edit:

                          Well I found part of the issue, if I divide the location calculated in the UpdateAnimationWheels function by 10.0 - it works as intended. For some reason any transform I'm doing to a bone is multiplied by 10.

                          I thought that usually resetting the XForm fix these kind of weird behaviours, but sadly it did not in this case...
                          Check that your bones are not scaled. The "LookAt" function works the best when mesh is aligned along the X axis of the bone.
                          Youtube Channel

                          Comment


                            Originally posted by BoredEngineer View Post
                            Check that your bones are not scaled. The "LookAt" function works the best when mesh is aligned along the X axis of the bone.
                            Aye, my units in 3ds Max was messed up. Still struggling with the suspension arm, though. Can't quite get it to rotate the way I want.

                            With a positive X-axis(Look Up Axis is Y):


                            With a negative X-axis(Look Up Axis is Y):


                            In the lower image, the height of the thingymajigg that goes into the wheel is accurate - but the suspension arm gets mirrored. In the upper image, the rotation is correct - but the rotation from LookAt is inverted.

                            I've tried to rotate the bones in various way but that seems to have absolutely no effect whatsoever. This is my current setup(excuse my terrible drawing):


                            I considered simulating the torsion bars with physics constraints as well, but that feels as if it would be horribly inefficient and also probably fairly unstable. Any suggestions as to how I should set this up?

                            SuspArm_R_1_2 is a child of RoadWheel_R_1 so it has the same height when the wheel goes up/down. SuspArm_R_1_1 looks at SuspArm_R_1_2, rotates along Y-axis(assuming this is what look up axis does).

                            Here's a bigger image of the whole setup atm and their alignment.
                            Last edited by Dealman; 07-19-2020, 12:45 PM.

                            Comment


                              Originally posted by BoredEngineer View Post

                              I have never tried it with a engine source build. No idea what could be wrong there, perhaps it's just the old "style" for some function calls.
                              Ah! Ok. No worries. I thought you working with the engine source. I did manage to get plugin compiled by commenting out "if (PhyiscsActor.IsValid())" But vehicle just shoots up into the wild blue yonder. hehe. Just using one of your t-26 tanks for now till i get it sorted. Then ill try migrate my M1A1 tank over. I'l plug away at it. Thanks BoredEngineer.

                              Comment


                                Originally posted by Dealman View Post

                                Aye, my units in 3ds Max was messed up. Still struggling with the suspension arm, though. Can't quite get it to rotate the way I want.

                                With a positive X-axis(Look Up Axis is Y):


                                With a negative X-axis(Look Up Axis is Y):


                                In the lower image, the height of the thingymajigg that goes into the wheel is accurate - but the suspension arm gets mirrored. In the upper image, the rotation is correct - but the rotation from LookAt is inverted.

                                I've tried to rotate the bones in various way but that seems to have absolutely no effect whatsoever. This is my current setup(excuse my terrible drawing):


                                I considered simulating the torsion bars with physics constraints as well, but that feels as if it would be horribly inefficient and also probably fairly unstable. Any suggestions as to how I should set this up?

                                SuspArm_R_1_2 is a child of RoadWheel_R_1 so it has the same height when the wheel goes up/down. SuspArm_R_1_1 looks at SuspArm_R_1_2, rotates along Y-axis(assuming this is what look up axis does).

                                Here's a bigger image of the whole setup atm and their alignment.
                                I would do rotating arms as a separate mesh on each side.
                                Each wheel needs a bone just to move up and down.
                                Then rotating arm piece can do look at target with limited coordinates ( I think there is a setting for that) so you would ignore the offset of the wheel in horizontal plane, alternatively, you can set wheel bone in such a way that it's in the plane of the arm rotation.

                                But all this won't keep your wheels aligned, as they have to move in a curve not straight up and down, which probably can be done with some imported animation. But that would require a lot of animations - separate for each wheel. What is good about this is that you can play them by specifying time instead of regularly playing them. So you can use percentage of the min / max wheel travel as input to your animation.
                                Youtube Channel

                                Comment

                                Working...
                                X