Community
VRED Forum
Welcome to Autodesk’s VRED Forums. Share your knowledge, ask questions, and explore popular VRED topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vred Python position constraint on only one axis

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
792 Views, 6 Replies

Vred Python position constraint on only one axis

Good morning everyone.

I have a problem with Vred's Python constraints. I'm trying to make a slider crank mechanism (in figure), and to do that I'd have to make the blue slider follow only the position along the x-axis of the white skid, but maintaining the same position along the y-axis (in order to remain in the red slider housing).
I haven't seen any option to be able to constrain only one axis in the python commands for the position constraint. Is there a way I'm missing?

Labels (4)
6 REPLIES 6
Message 2 of 7
Christian_Garimberti
in reply to: Anonymous

Hi Gianmarco,

could you share also the model?

I don't think there is an option, but maybe playing with more then one constraint it could be possible.

This could be a good challenge to try!

 

Best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

Message 3 of 7
Christian_Garimberti
in reply to: Anonymous

Hi, i'm trying but until now i have not found a combination of two or more constraints to solve the problem.

Just a question...

You want to use constraints because you have to interactively move the mechanism? Or just to have an animation of it?

 

Bets

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

Message 4 of 7
Christian_Garimberti
in reply to: Anonymous

Hi Gianmarco,

i give up... 😅

thinking about this behavior i remembered to ask in this form something similar.

https://forums.autodesk.com/t5/vred-forum/block-rotations-or-translations-on-some-axis/m-p/8953019#M...

I think the only way is to have that functionality.

Unless you want, or can, create a complex animation with keyframes to keep the mechanism in the correct position.

But being not linear movements i think could be very difficult.

 

Best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

Message 5 of 7
Anonymous
in reply to: Christian_Garimberti

Hi Chris,
Sorry I couldn't answer earlier. I'm attaching the model in case you would like to have a look at it. In any case yes, I would like to impose the constraints in order to have an interactive response from the mechanism, because a "simple" animation is not enough for what I want to do, unfortunately.
In any case I thank you for your availability and kindness.
I also had a look at the post on the forum you indicated, hopefully they will soon add this new feature for rotations and translations.
Thanks again,

Gian Marco

Message 6 of 7
Christian_Garimberti
in reply to: Anonymous

Hi Gian Marco

Thank you for sharing the model.

I will give another try in my spare time, maybe using some constraints and some other python scripts

 

Best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

Message 7 of 7
Christian_Garimberti
in reply to: Anonymous

Hi Gian Marco,

working on your model finally i found a workaround... it is not perfect, and maybe it could be better. maybe some other peoples on the forum could give some advice.

Attached the scene.

After opened, press S to start the animation. The animation is just to show and test the mechanism. atret that, if you rotate the "connecting rod", everything should works as expected.

E to stop everything.

It is not perfect because of the refresh. I used the world transformation of the Blue Slider (the Z translation) to keep it at the correct position. i tried wit a vrTimer or a dedicated Class to update the position every frame. It is not perfect because, depending on the speed of the movement, you could see a little bit of shaking or translation.

The slower is, the better is.

 

Waiting for an official API, this could helps.

 

Best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report