Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Manipulated on the local axis within the controller script?

dg3duy
Collaborator

Manipulated on the local axis within the controller script?

dg3duy
Collaborator
Collaborator

Sample scene 

I wonder how it can be manipulated on the local axis within the controller script?


script controllers.gif

0 Likes
Reply
Accepted solutions (2)
805 Views
6 Replies
Replies (6)

denisT.MaxDoctor
Advisor
Advisor

use the position script controller as second controller of Position List controller.

0 Likes

dg3duy
Collaborator
Collaborator

The result in this case is the same if I place the script in the second place in the list of controllers, I hope I understood the answer.script controllers 2.gif

0 Likes

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

Oh. I didn't read your question carefully ... so maybe this will work for you:

 

delete objects

target = circle name:#target radius:10 wirecolor:red isselected:on
source = point name:#source size:10 box:on axistripod:on cross:on wirecolor:green

p = source.pos.controller = position_list()
p.setname 1 "Main Pos"
c = p.available.controller = position_script()
p.setname 2 "Driven Pos"
c.addobject #rot source.rotation.controller
c.addnode #pos target
c.setexpression "[pos.pos.z, 0, 0] * rot.value"

 

 

denisT.MaxDoctor
Advisor
Advisor

the solution may be different. it depends on what exactly you want to do ... it is more likely that it is better to move in the parent coordinate system rather than in the local

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

@denisT.MaxDoctor wrote:

the solution may be different. it depends on what exactly you want to do ... it is more likely that it is better to move in the parent coordinate system rather than in the local


 

delete objects

target = circle name:#target radius:10 wirecolor:red isselected:on
parent = dummy name:#parent
source = point name:#source size:10 box:on axistripod:on cross:on parent:parent wirecolor:green

c = source.pos.controller = position_script()
c.addnode #pos target
c.setexpression "[pos.pos.z, 0, 0]"

move parent [0,20,0]
rotate parent (eulerangles 0 0 45)

 

0 Likes

dg3duy
Collaborator
Collaborator

Very good examples, now I have to see which of the 2 I am going to use.
Excellent contribution as always! thank you very much

0 Likes