Jump to content

WusikiJeroni

How to lock rotation?

Recommended Posts

Hey everyone. I have a problem with xpresso. I have a box (controller) and a mesh with bend modifier. I wanna when I rotate a box that hasn't to be rotated, but the strength in bend has to be changed. I've tried to make a variable, but when I return box rotation to zero a variable also gets value 0. I need anything like that:

int x, y, output;

x = box.rotation;

y = x;

output = y;

x = new x == 0;

Share this post


Link to post
Share on other sites

Must admit that I have trouble following what you need. Is there any way to simplify your request? Maybe add a scene file depicting what should happen. Could be that you are looking for something related to interaction tag?


Free C4D trainings from MAXON professional on our youtube channel

 

https://www.youtube.com/c4dcafe

Share this post


Link to post
Share on other sites
1 hour ago, HSrdelic said:

Must admit that I have trouble following what you need. Is there any way to simplify your request? Maybe add a scene file depicting what should happen. Could be that you are looking for something related to interaction tag? 

I need something like that, but when I rotate a cube, cube mustn't be rotated. I also tried to make what I want without scripting. I used user data, but I have an issue. (last screen) Why I have an empty value?

 

screen04.jpg

screen05.jpg

screen06.jpg

Share this post


Link to post
Share on other sites

Did you try interaction tag? It seems as you just need values from cursor drag?

 

EDIT: Here is what I mean. You simply rotate as usual and use object delta to calculate degrees (didn't do that part, object delta is in radians) via Xpresso if that is what you are looking for. The object with tag stays unaffected. Interaction tag is a real hidden gem...

Interaction_tag.c4d


Free C4D trainings from MAXON professional on our youtube channel

 

https://www.youtube.com/c4dcafe

Share this post


Link to post
Share on other sites
16 minutes ago, HSrdelic said:

Did you try interaction tag? It seems as you just need values from cursor drag? 

Interaction is for moving. I need only rotation.

Share this post


Link to post
Share on other sites
1 hour ago, HSrdelic said:

EDIT: Here is what I mean. You simply rotate as usual and use object delta to calculate degrees (didn't do that part, object delta is in radians) via Xpresso if that is what you are looking for. The object with tag stays unaffected. Interaction tag is a real hidden gem... 

Interaction_tag.c4d

What's wrong? I get an empty value again. In delta z is set also empty value.

Share this post


Link to post
Share on other sites

Maybe you misunderstood? If you start rotating on any axis object delta is calculated in radians. Simply output that in Xpresso from interaction tag and convert to degrees. Effectively you get the rotation values but object stay "locked"


Free C4D trainings from MAXON professional on our youtube channel

 

https://www.youtube.com/c4dcafe

Share this post


Link to post
Share on other sites
24 minutes ago, HSrdelic said:

Maybe you misunderstood? If you start rotating on any axis object delta is calculated in radians. Simply output that in Xpresso from interaction tag and convert to degrees. Effectively you get the rotation values but object stay "locked" 

Seems I actually misunderstand. I get values, but then the value will become empty. How to save the value?

screen08.jpg

Interaction_tag_edited.c4d

Share this post


Link to post
Share on other sites

You will need to use a bit of python there. So you want to store the value? What happens when you start new rotation? Do values keep adding up or you reset and show the new absolute value?


Free C4D trainings from MAXON professional on our youtube channel

 

https://www.youtube.com/c4dcafe

Share this post


Link to post
Share on other sites
6 minutes ago, HSrdelic said:

What happens when you start new rotation? Do values keep adding up or you reset and show the new absolute value? 

When I finish rotate the value appears for 1 second. Then getting value (data in my screen) get the new value = 0.

Share this post


Link to post
Share on other sites

Yes, I understand, but what would you like to happen. So, let's say you rotate and then store the value once mouse is released. What should happen after new rotation starts? Do you want to overwrite the value? Add to stored one?


Free C4D trainings from MAXON professional on our youtube channel

 

https://www.youtube.com/c4dcafe

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

YOUTUBE CHANNEL:

ABOUT US:

C4D Cafe is the largest CINEMA 4D community. We provide facilities for discussion, showcasing and learning our favorite software :) Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, get your own private messenger, post status updates, manage your profile and much more. If you need to find solution to your problem or otherwise ask for help, Cafe is the right place.
×
×
  • Create New...