Last edited by bazsa73; 03-26-2017 at 11:39 AM.
I try it with a different object with a simpler name. Must exist a some solution to it.
looky, on page 537 the note with small typo, the author explains smg about "" charactert, but is it still valid in python?
Thank you for confusing me further with LScript I think you found what's causing the error. Spaces!!!! You are not using spaces in your GE_Create, but you do use spaces in your GE_Attach. which surely is the source.
What I can see is that strExp (book example) is a string variable with spaces in it. And the autor does say if expressions, names and channelnames have spaces use double quote characters. How this translates to Python i don't really know.
What your actually doing i think is this (GE_AttachExpression schannelname badvariable badvariable sexpressionname) if i compare Your "PalaceWindowsOnly:Layer2.Curve (1).Alpha.Key (1).Pos" it has 2 spaces in Curve (1) and Key (1). Could that be the problem?
Sorry for confusing but actually a commandinput command is a short Lscript and there is scarce references on this topic throughout the interweb.
I dont know what is the problem but it works with an ordinary channel like Camera.Position.X. I tested it, I can even display a channel in the graph editor but these
cumbersome subchannels do not want to cooperate. Strange thing. Maybe I should report this to the developers.
Example: This script works. It takes your selected item and makes the Y channel affect the bank channel (move the object up or down after running this script to see the effect).
Code:import lwsdk # LW ID as seen by python script UserSelection = lwsdk.LWInterfaceInfo().selected_items() # LW Hexadecimal identifier, used in commands UserSelectionID = lwsdk.itemid_to_str(UserSelection) # Name of the item as seen by the user. UserSelectionName = lwsdk.LWItemInfo().name(UserSelection) # CreateExpression format: # GE_CreateExpression NameOfExpression Expression # GE_AttachExpression "ChannelYouWantToAffect" NameOfExpression lwsdk.command("GE_CreateExpression z" + UserSelectionID + " Value + [" + UserSelectionName + ".Position.Y]*100") lwsdk.command("GE_AttachExpression \"" + UserSelectionName + ".Rotation.B\" " + "z" + UserSelectionID) # These print statement shows the syntax of the create/attach expression commands without variable placeholders. # It is very strict, any errors will result in either crashing or nothing happening. # Also, notice I put the letter "Z" in front of the ID name, as expression names cannot consist entirely of numbers. print "GE_CreateExpression z" + UserSelectionID + " Value + [" + UserSelectionName + ".Position.Y]*100" print "GE_AttachExpression \"" + UserSelectionName + ".Rotation.B\" " + "z" + UserSelectionID
Hello Ryan, thanks for stopping by. I just wonder how to attach script to a channel with this name: [Unweldbox.Curve (1).Alpha.Key (2).Pos]
Ordinary transform channels are working for me too. I can attach a script to a Position channel without problem but not to the this Curve node Key.