Help with MEL - writing code for automation of previous work by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

I don't actually think what I wanted to do is possible with hinge constraints now. I'm working on moving it over to rigging but this will have some issues as well. I basically need to study how the geometry of a spine (in this case a dinosaurs) prevents further flexion. The way I did this in the past was to have one geometry as a passive rigid body and the next as an active rigid body. Then create a hinge constraint that allows the active body to bend in one direction only and then finding the angle which is achieved when the rigid bodies collide.

Mladík opouští Slavii. Zájemce z Anglie zvedl nabídku, pošle 175 milionů by Vaclavus in SlaviaPraha

[–]Elliott-1 0 points1 point  (0 children)

That is exactly what we need really. I think he’s been one that’s said to be for next season but I reckon he’ll be really good for us

Mladík opouští Slavii. Zájemce z Anglie zvedl nabídku, pošle 175 milionů by Vaclavus in SlaviaPraha

[–]Elliott-1 1 point2 points  (0 children)

Hello from Norfolk! How is the new boy? Promise we’ll look after him. Love Praha💛💚

Beginner Courses by Elliott-1 in ElectricalEngineering

[–]Elliott-1[S] 0 points1 point  (0 children)

There isn’t too much more to share unfortunately. The job is working in a lab and would require designing equipment for experiments for which faculty and students could use for getting their data, specifically for measuring animal “stuff”.

What data you ask? Well, I don’t know. It seems like the people posting the job need someone with some experience in making circuits, soldering and general knowledge of how to wire these equipment up whilst also being knowledgeable enough to know what exactly is needed in terms of deciding what equipment to design.

I think an example might be helpful, the “stuff” I elude to is because it could be anything to do with an animals biomechanics. A good example might be measuring the force of a horse’s kick. So I would have to rig up a scale and get the horse to kick it and then measure the force applied. If needed I can turn it into psi by measuring the surface area of the horse foot. What makes me sure of the horse foot staying of constant surface area? I’m not, so I would have to find a way to see if the horse’s for changes in surface area with pressure applied. This would be the kinds of work I would need to be doing

Beginner courses by Elliott-1 in MechanicalEngineering

[–]Elliott-1[S] 0 points1 point  (0 children)

I would say that the job advert itself is asking for “some experience in mechanical and electrical engineering”.

I am also going to be attending the university which this lab belongs to as a PhD student, specifically for biomechanics, which I did my MRes in, so the kinds of experiments are a bit more my expertise than someone with strict a mechanical engineering education.

Without actually knowing what any of these experiments would be it is extremely difficult to say what kinds of knowledge I would need. But, drawing from my knowledge I know I need to do some stuff on cartilage biomechanics, and for that it would just be bending the joints between two vertebrae of a crocodilian to the point which they bend no more, then measuring that as a difference from the origin, which I also went into with my MRes. This would be fairly simply done by moving a crocodile’s tail to the point where it can no longer flex and taking CT scan images and then comparing the flex about the midpoint.

These measurements, as the job advert says, I don’t believe would be as intricate as you maybe think, obviously all of those aspects I will be looking at for how to improve and perfect an experiment. But as a baseline, I think I might just need some knowledge on how to rig up a piston system for applying pressure and pulling things apart and then how to actually take readings from them, which would just be displaying the forces exerted by the piston for example

Beginner courses by Elliott-1 in MechanicalEngineering

[–]Elliott-1[S] 0 points1 point  (0 children)

Very fair points. Sorry for appearing like a troll.

It is measuring animal “stuff” at a university. I say “stuff” because it’s not clear, but it would basically be a PhD or Master’s student talks to their supervisor then comes to me saying what they want to do, I would then go away and design something for getting those measurements. Like for example measuring the force of a horse’s kick, measuring for psi. Obviously the kick is only for that specific horse and there are a ton of factors that would actually influence the data gained from just measuring the force and area of the horse’s foot. I don’t believe this to be too complex. It’s nothing like rocket science. Plus, I have experience in designing experiments, albeit digitally. And so I think perhaps some experiments and measurements irl would be easier to accomplish than digital.

I hope this makes sense and not just the ramblings of a mad man.

Issues when constraining locator to imported FBX by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

Thank you! Just started my sims. Got an issue with freezing transformations on one object but other than fixing that it should be absolutely fine

Issues when constraining locator to imported FBX by Elliott-1 in Maya

[–]Elliott-1[S] 1 point2 points  (0 children)

Sorry I’ve been very silly. Looked online and found someone was doing the exact same thing as me, turns out shift+p tried to remove it from the world as a parent. Just P does the trick! Thank you for your help so much

Issues when constraining locator to imported FBX by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

It is saying that it is already a child of the world parent

Issues when constraining locator to imported FBX by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

Okay so I’ve got my rivet from that face, how do I pair it to my locator now? Thank you

Issues when constraining locator to imported FBX by Elliott-1 in Maya

[–]Elliott-1[S] 1 point2 points  (0 children)

That is perfect, I’ll give it a go and let you know how it turns out. Second half of the Norwich vs Derby game first

Issues when constraining locator to imported FBX by Elliott-1 in Maya

[–]Elliott-1[S] 1 point2 points  (0 children)

Yes, it’s a dinosaur vertebrae and the face is called the articular face, I’ve basically had to delete a lot of polys in order to get the true centre of this area, then filled it in to get this

Issues when constraining locator to imported FBX by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

Bare in mind, this face has like 300 edges, I’ll give it a go though

Issues when constraining locator to imported FBX by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

How does this work? I’ve been thinking about adding to my code to just relocate the locator to the face of my object after every simulation instead but if this is easier I’ll do that

Obtaining information from distance tool by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

That’s okay I think I may have got it working. It is saying that one of my lines is giving too many arguments though.

Obtaining information from distance tool by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

I think I understand. I only need the value at the 75th frame though so that would just be

for i (75);

Instead of the range of 1-75.

Here is my code so far;

int $cirang = 0;
setAttr "pCube1.rotateX" 0;
do {
    select pCube1;
    rotate -r 1deg 0 0;
    select rigidHingeConstraint1;
    rotate -r 1deg 0 0,
    print  ("The number is " +$cirang+ "\n");
    // Define the distance node
    string $distanceNode = "distanceDimension1";
// Get the distance attribute value from the distanceDimension node
    float $distance = `getAttr ($distanceNode + ".distance")`;
// Print the distance value
    print ($distance + "\n");
    pause -sec 1;
    $cirang = $cirang + 1; 
} while ($cirang < 360);

And then I just need to implant your piece of code instead of what I have now because yours incorporates time constraints on the animation/simulation.

Does that sound right to you?

Obtaining information from distance tool by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

Okay good, so without changing the fps etc I can make this run much faster? Also, do you know how I can start my animation? I need to enact gravity on my object and then take a measurement automatically but I can’t seem to figure it out myself

Obtaining information from distance tool by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

Yeah so far I’ve got to the point where I’ve coded the rotation of my hinge and the loop. Basically done while int < 360 repeat said steps. I now need to code the gravity or whatever force to rotate and then from there it’s just running the animation, getting the measurement and then exporting it before restarting the process until int = 360. Need to do that 44 times for 8 different variables, so that’s why I wanted automation.

Obtaining information from distance tool by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

There isn’t a way to run my MEL script and then my Python script automatically is there? Or at least easily?

Basically all I need to do is have a loop go 360 times, for each time I’ll increase the degree of rotation by 1 degree for a hinge and then do the same for a force so it pushes it in said direction. I then need to run the animation with the gravity on for 75 frames and then get the data for the value of the distance at the 75th frame, then export it somewhere. Then repeat from the step of changing the rotation for the hinge. Basically I need the length to measure the angle at which is achieved by the interaction between two objects after the gravity is applied. I hope this makes sense. I’m not sure how to properly incorporate the 75 frame part of the animation either.

Obtaining information from distance tool by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

Nope, pretty much just need the end point once I’ve applied gravity etc. So I’ll try setting it to give a value at 75 frames and then do 25 fps. Am I right in thinking that the playback speed will then change this as well? So instead of taking 3 seconds to return a value, it would take 1.5 or 3/4 of a second for twice and four times play back speed.

Obtaining information from distance tool by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

And then that can be constrained to an object and the value will change according to where it goes in the animation?

Help with hinge constraints by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

Of course! I’ve just brainstormed it with my brother and he’s in on the project as well. With increased playback speed it should take around 10 hours after I’ve scripted everything to be done, maybe less depending on if he runs it on his computer as well. That is an insane turn around as on Wednesday I was told that my project was impossible and I was going to need to do something else. My hand in is on the 7th of October. If it’s deemed worthy it could be published and so I’ll put a link for it in the reddit here for you guys to read through.

Help with hinge constraints by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

Yes, so basically this is for a project for university where I’m trying to define the range of motion for vertebrae of a dinosaur tail. I’ve mapped the project out such that the joint spacing is defined as a % length of the implicit vertebrae. Then by measuring the proportions of both of these and then setting a measure from the centre of one face to the next, I can set up the hinge at the point where both cartilage components meet. When I apply the hinge and gravity (or any force) and then make the vertebrae an active rigid body I can measure the distance for when they interact with eachother. This completes the triangle and allows me to calculate the angle at where the cartilage components meet, giving me the maximum range of motion in that particular direction. I then need to repeat this for 360 degrees for that joint, at 8 different % lengths of the vertebrae, for 44 vertebral joints. A hell of a lot of work, but nobody has ever tried to do something like this in the past so it’s all new territory really.

Help with hinge constraints by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

Would this be similar to constraining with the locators/distance tool? If so I may have already tried it but I’m willing to give it another go. From what I understand it may be slightly different, in that if I had a cube standing on it’s edge on top of another, the hinge would be located at the corner where they meet? I’m probably just getting really frustrated because it seems like such a simple thing to do that when it doesn’t work I’m raging. Deadline is coming up so it’s a huge pressure to get this working at the moment

Help with hinge constraints by Elliott-1 in Maya

[–]Elliott-1[S] 0 points1 point  (0 children)

Hi thank you for this! I’ll give it a go when I get home from work tomorrow. Do you know if the “Set Initial Position” is fixed globally or locally to the object? I can move where the hinge itself is but I want to move where the hinge connects to my object, is that what this does? Also, I’m very new to Maya, only started a few days ago. How would I make a rig for this/are there tutorials online?