Profile Picture

How do I get the current rotation of a prop?

Posted By Data Juggler 4 Years Ago
You don't have permission to rate!
Author
Message
Data Juggler
Data Juggler
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)

Group: Forum Members
Last Active: 9 Months Ago
Posts: 1.8K, Visits: 5.6K
This script will provide the prop's position:

# -- Get Prop --#
prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, propName)
# -- Get Transform Control and Data --#
ts_control = prop.GetControl("Transform")
time = RLPy.RTime()
transform_for_ref = RLPy.RTransform()
ts_control.GetValue(time, transform_for_ref)
propX = transform_for_ref.T().x # Get Prop X position
propY = transform_for_ref.T().y # Get Prop Y position
propZ = transform_for_ref.T().z # Get Prop Z position

Is there a similar value for rotation and / or move?

I know that .T() is position, so I have 25 other letters to try while I wait for an answer here if anyone knows.

I will post if my 25 letters attempts works or not.





Creator of the free website:
PixelDatabase.Net
A Free Online Text Based Image Editor
https://forum.reallusion.com/uploads/images/6e6663e2-0ecf-447a-ab3d-d49d.png

Data Juggler
Data Juggler
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)

Group: Forum Members
Last Active: 9 Months Ago
Posts: 1.8K, Visits: 5.6K
My first guess would have been 'R', if Position was 'P', but since it wasn't I tried A - Q before I got to R.

R works for rotation.

Since I only have about 7 to go, I am going to finish and see if anything other values are in there.

Where is the documentation for this, because it sure is hidden?

# test
propName = "Spider"
# -- Get Prop --#
prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, propName)
# -- Get Transform Control and Data --#
ts_control = prop.GetControl("Transform")
time = RLPy.RTime()
transform_for_ref = RLPy.RTransform()
ts_control.GetValue(time, transform_for_ref)
propX = transform_for_ref.R().x # Get Prop X rotation
propY = transform_for_ref.R().y # Get Prop Y rotation
propZ = transform_for_ref.R().z # Get Prop Z rotation

print ("X: ")
print (propX)
print ("Y: ")
print (propY)
print ("Z: ")
print (propZ)


Creator of the free website:
PixelDatabase.Net
A Free Online Text Based Image Editor
https://forum.reallusion.com/uploads/images/6e6663e2-0ecf-447a-ab3d-d49d.png

Data Juggler
Data Juggler
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)

Group: Forum Members
Last Active: 9 Months Ago
Posts: 1.8K, Visits: 5.6K
(Sorry this double posted, this was supposed to be an Edit, not a repost).

My first guess would have been 'R', if Position was 'P', but since it wasn't I tried A - Q before I got to R.

R works for rotation.

Since I only have about 7 to go, I am going to finish and see if anything other values are in there.

Where is the documentation for this, because it sure is hidden?

# test
propName = "Spider"
# -- Get Prop --#
prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, propName)
# -- Get Transform Control and Data --#
ts_control = prop.GetControl("Transform")
time = RLPy.RTime()
transform_for_ref = RLPy.RTransform()
ts_control.GetValue(time, transform_for_ref)
propX = transform_for_ref.R().x # Get Prop X rotation
propY = transform_for_ref.R().y # Get Prop Y rotation
propZ = transform_for_ref.R().z # Get Prop Z rotation

print ("X: ")
print (propX)
print ("Y: ")
print (propY)
print ("Z: ")
print (propZ)

Only seconds after R, I discovered S is Scale (so why T for position?).

Hopefully this post stays up here for when I forget this.




Creator of the free website:
PixelDatabase.Net
A Free Online Text Based Image Editor
https://forum.reallusion.com/uploads/images/6e6663e2-0ecf-447a-ab3d-d49d.png

Kelleytoons
Kelleytoons
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)Distinguished Member (37.8K reputation)

Group: Forum Members
Last Active: Last Year
Posts: 9.2K, Visits: 22.1K
There's actually some pretty good docs, with examples, and if you have been just a *touch* slower I would have pointed you towards them (because I have to realign props all the time -- I have a script which resets object's pivot points because bringing them in from Daz screws them up).



Alienware Aurora R16, Win 11, i9-149000KF, 3.20GHz CPU, 64GB RAM, RTX 4090 (24GB), Samsung 870 Pro 8TB, Gen3 MVNe M-2 SSD, 4TBx2, 39" Alienware Widescreen Monitor
Mike "ex-genius" Kelley
Data Juggler
Data Juggler
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)Distinguished Member (13.9K reputation)

Group: Forum Members
Last Active: 9 Months Ago
Posts: 1.8K, Visits: 5.6K
I had to let my breakfast digest before I go for my run, so I didn't really have anything else to do.

Thanks

I don't think the algorithm is too hard, but now what I need to figure out is if a spider is rotated x degrees, walks forward for y seconds, at z speed, where will the spider be? 

I have all the information except possibly the brain power to figure this out.

Going jogging while I think about this.

https://forum.reallusion.com/uploads/images/3db8496c-686d-4235-971d-a55c.png




Creator of the free website:
PixelDatabase.Net
A Free Online Text Based Image Editor
https://forum.reallusion.com/uploads/images/6e6663e2-0ecf-447a-ab3d-d49d.png




Reading This Topic