Profile Picture

Python Transition Curve

Posted By videodv 3 Weeks Ago
You don't have permission to rate!
Author
Message
videodv
videodv
Posted 3 Weeks Ago
View Quick Profile
Veteran Member

Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)

Group: Forum Members
Last Active: 1 hour ago
Posts: 139, Visits: 3.6K
Anyone know how to set/change the Transition Curve from Linear to Step for example from Python.
I can see it in the Class list but no idea how to set it?

def RLPy.RKey.SetTransitionType (   self,



eTransitionType 

)



Is it a number a string?

Regards
Chris.
The-any-Key
The-any-Key
Posted 3 Weeks Ago
View Quick Profile
Senior Member

Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)

Group: Forum Members
Last Active: 56 minutes ago
Posts: 80, Visits: 454
Set to one of these I think:

RLPy.ETransitionType_Linear
RLPy.ETransitionType_Step
RLPy.ETransitionType_Ease_Out
RLPy.ETransitionType_Ease_In
RLPy.ETransitionType_Ease_Out_In
RLPy.ETransitionType_Ease_In_Out
RLPy.ETransitionType_Ease_In_Sine
RLPy.ETransitionType_Ease_Out_Sine
RLPy.ETransitionType_Ease_In_Out_Sine
RLPy.ETransitionType_Ease_In_Quad
RLPy.ETransitionType_Ease_Out_Quad
RLPy.ETransitionType_Ease_In_Out_Quad
RLPy.ETransitionType_Ease_In_Cubic
RLPy.ETransitionType_Ease_Out_Cubic
RLPy.ETransitionType_Ease_In_Out_Cubic
RLPy.ETransitionType_Ease_In_Quart
RLPy.ETransitionType_Ease_Out_Quart
RLPy.ETransitionType_Ease_In_Out_Quart
RLPy.ETransitionType_Ease_In_Quint
RLPy.ETransitionType_Ease_Out_Quint
RLPy.ETransitionType_Ease_In_Out_Quint
RLPy.ETransitionType_Ease_In_Expo
RLPy.ETransitionType_Ease_Out_Expo
RLPy.ETransitionType_Ease_In_Out_Expo
RLPy.ETransitionType_Ease_In_Circ
RLPy.ETransitionType_Ease_Out_Circ
RLPy.ETransitionType_Ease_In_Out_Circ
RLPy.ETransitionType_Ease_In_Back
RLPy.ETransitionType_Ease_Out_Back
RLPy.ETransitionType_Ease_In_Out_Back
RLPy.ETransitionType_Ease_In_Elastic
RLPy.ETransitionType_Ease_Out_Elastic
RLPy.ETransitionType_Ease_In_Out_Elastic
RLPy.ETransitionType_Ease_In_Bounce
RLPy.ETransitionType_Ease_Out_Bounce
RLPy.ETransitionType_Ease_In_Out_Bounce

YourKey.SetTransitionType(RLPy.ETransitionType_Step)




iClone 7, 3DXchange 7 Pipeline, CC3 Pipeline, CT8 Pipeline, Iray, Live Face, iPhone Xr
Edited
3 Weeks Ago by The-any-Key
videodv
videodv
Posted 2 Weeks Ago
View Quick Profile
Veteran Member

Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)

Group: Forum Members
Last Active: 1 hour ago
Posts: 139, Visits: 3.6K
Thanks The-any-Key
will check those out shortly.

Chris.
videodv
videodv
Posted 2 Weeks Ago
View Quick Profile
Veteran Member

Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)

Group: Forum Members
Last Active: 1 hour ago
Posts: 139, Visits: 3.6K
I am trying to change the step of a matieral from Linier to Step but having no luck yet, this is a cut down piece of code I am using.

import RLPy

#-- Get Prop --#
prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Ball_000")

#-- Get Material from Prop --#
material_component = prop.GetMaterialComponent()
mesh_list = prop.GetMeshNames()
mesh_name = mesh_list[0]

material_list = material_component.GetMaterialNames(mesh_name)
material_colour = material_list[0]

#-- Add diffuse key --#
material_component.AddDiffuseKey(RLPy.RTime(0), mesh_name, material_colour, RLPy.RRgb.RED) # Turn on Red
material_component.AddDiffuseKey(RLPy.RTime(1000), mesh_name, material_colour, RLPy.RRgb.BLUE) # Turn on Blue

# How to change the material keys from Linier to step ????
# This is not working????
#material_component.SetTransitionType(RLPy.RTime(0), RLPy.ETransitionType_Step, 1.0)

RLPy.RGlobal.Play(RLPy.RTime(0), RLPy.RTime(1000))

This will change a default ball "Ball_000" from red to blue and as you can see it it changes over the one second run (linier) this is what I am trying to change so it will change suddenly "Step".

By the way this is from a "Traffic Light" setup I am working on so really need this change to make it work.

Regards
Chris.
dogged2003
dogged2003
Posted 3 Weeks Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.0K reputation)Distinguished Member (2.0K reputation)Distinguished Member (2.0K reputation)Distinguished Member (2.0K reputation)Distinguished Member (2.0K reputation)Distinguished Member (2.0K reputation)Distinguished Member (2.0K reputation)Distinguished Member (2.0K reputation)Distinguished Member (2.0K reputation)

Group: Forum Members
Last Active: 2 hours ago
Posts: 354, Visits: 3.6K
Try

material_component.SetTransitionType(RLPy.RTime(1000), RLPy.ETransitionType_Step, 1.0)

My YouTube channel.
The-any-Key
The-any-Key
Posted 3 Weeks Ago
View Quick Profile
Senior Member

Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)Senior Member (391 reputation)

Group: Forum Members
Last Active: 56 minutes ago
Posts: 80, Visits: 454
You need to get the key object you want to change.
Ex:

# Grab transform control from prop
transform = prop.GetControl("Transform")
# Create empty key
key = RLPy.RTransformKey()
# Fill empty key with data at time 0 from prop
transform.GetTransformKey(RLPy.RTime(0), key)
# Set transition for key to step
key.SetTransitionType(RLPy.ETransitionType_Step)

I am however unsure if the key object is referencing back to the original key data. Or if you need to add the key to the prop. But we hope it use referencing.



iClone 7, 3DXchange 7 Pipeline, CC3 Pipeline, CT8 Pipeline, Iray, Live Face, iPhone Xr
Edited
3 Weeks Ago by The-any-Key
videodv
videodv
Posted 3 Weeks Ago
View Quick Profile
Veteran Member

Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)

Group: Forum Members
Last Active: 1 hour ago
Posts: 139, Visits: 3.6K
Thanks dogged2003 but that will not work
Edited
3 Weeks Ago by videodv
videodv
videodv
Posted 3 Weeks Ago
View Quick Profile
Veteran Member

Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)Veteran Member (563 reputation)

Group: Forum Members
Last Active: 1 hour ago
Posts: 139, Visits: 3.6K
The-any-Key (1/5/2019)
You need to get the key object you want to change.
Ex:

# Grab transform control from prop
transform = prop.GetControl("Transform")
# Create empty key
key = RLPy.RTransformKey()
# Fill empty key with data at time 0 from prop
transform.GetTransformKey(RLPy.RTime(0), key)
# Set transition for key to step
key.SetTransitionType(RLPy.ETransitionType_Step)

I am however unsure if the key object is referencing back to the original key data. Or if you need to add the key to the prop. But we hope it use referencing.


Thanks The-any-Key

That will run without error but it will not change the material settings?
I will look more closley at the documention tonight and try to see why I cannot seem to access the Material Settings to change (unless these are not avaliable yet)

I have of course tried many different ways to try and get this to work but so far without success, keep getting an "Atribute Error"

Many Thanks
Chris.
Kelleytoons
Kelleytoons
Posted 3 Weeks Ago
View Quick Profile
Distinguished Member

Distinguished Member (15.5K reputation)Distinguished Member (15.5K reputation)Distinguished Member (15.5K reputation)Distinguished Member (15.5K reputation)Distinguished Member (15.5K reputation)Distinguished Member (15.5K reputation)Distinguished Member (15.5K reputation)Distinguished Member (15.5K reputation)Distinguished Member (15.5K reputation)

Group: Forum Members
Last Active: 2 hours ago
Posts: 5.3K, Visits: 10.3K
Chris,

There's a confirmed bug (confirmed by the devs) in GetMeshNames so that GetMaterialNames will not work properly (fails).  If that's your problem don't worry about it -- should be fixed soon.



Alienware Aurora R7, Win 10, i7-8700k, 4.7GHz CPU, 32GB RAM, GTX Titan XP (12GB), Samsung 960 Pro 2TB M-2 SSD, TB+ Disk space
Mike "ex-genius" Kelley
RobertoColombo
RobertoColombo
Posted 2 Weeks Ago
View Quick Profile
Distinguished Member

Distinguished Member (6.1K reputation)Distinguished Member (6.1K reputation)Distinguished Member (6.1K reputation)Distinguished Member (6.1K reputation)Distinguished Member (6.1K reputation)Distinguished Member (6.1K reputation)Distinguished Member (6.1K reputation)Distinguished Member (6.1K reputation)Distinguished Member (6.1K reputation)

Group: Forum Members
Last Active: 5 hours ago
Posts: 1.5K, Visits: 2.9K
The-any-Key (1/4/2019)
Set to one of these I think:

RLPy.ETransitionType_Linear
RLPy.ETransitionType_Step
YourKey.SetTransitionType(RLPy.ETransitionType_Step)
etc. etc.


Hi,
pls, where did you find these definitions in the doc ?
I might have missed, but I could not find any of the values in the API doc.

Thanks

  Roberto



My PC:
OS: Windows 10 Pro English 64-bit / CPU: Intel i7-9700 3.6GHz / MB: ASUS ROG Strix Z390  RAM: 16GB DDR4 2.6GHz / HD: 2TB+3TB  /  
SSD: 2x512GB Samsung 860 EVO / 
VB: Palit GTX2080 TI GamingPro 11GB / AB: embedded in the MB and VB (audio from the VB with an HDMI splitter) / DirectX: 12




Reading This Topic