Slate material editor : Create a BezierFloat node to control every UV_Tile on selected nodes
Hey everyone !
I'd like to have a script wich create a Bezier float node in the slate material editor and then connect it to every selected node which have the UV Tile property.
So i can change the tiling easyly on a lot of node.
I don't know how to connect node together and I don't know how to check the property of the selected node...
Please help !
SelView = sme.GetView sme.ActiveView --get active view SelNode = SelView.getSelectedNodes() --get selectednode UVctrl = Bezier_Float() --create a float controller UVctrlNode = SelView.CreateNode UVctrl NodePos --create the node in the active view UVctrlNode.name = "Uv_TileController" --change the name of the bezier node for i = 1 to SelNode.count do ( /* here what i want to do but can't -test if SelNode[i] hasproperty uvtile -if true connect the controller to the property */ )
Comments
Add custAttributes!
Use custAttributes to add a property to a given node . If the property name is "uv_tile" access its value as node.uv_tile.
`
Hi,
So far I've got this way to connect Bezier_Float to U_Tiling and v_Tiling:
It works only for selected Bitmap Textures in SME
You will not see wire connection after running script. But if you change Uv_TileController value it will change bitmap U_Tile and V_Tiling values.
To see the wire connection - click on bitmap and choose "Show All Additional Params"
Hope it will help. It still link controllers by names, so if you have duplicating names... it may cause wrong linking.
Best,
Pixamoon
Thanks a lot for your help
Thanks a lot for your help !
I've tried your script and it does exactly what I wanted!
Except it applies the bezier controller to every node in the active view...I don't know if I use it the wrong way...When you tested it was it working on selected node only ?
All the names are unique by the way.
If you don't know I'll try to find a way ;)
Thanks again
Have a nice day !
`
hmm, It should work for selected BitmapTex nodes only.
I'll check it now
`
Ah, sorry, I deleted one thing on cleaning code before post.
This one should be work for selected BitmapTex Nodes only:
Same code attached as ms script. :)
this would be a life saver if
this would be a life saver if it could work by selected bitmaps instead of by view...as well as link all selected bitmaps to the same bezier controller. is this possible?
what would the code look like. Thanks!
Yeah it's perfect ! thank you
Yeah it's perfect ! thank you !!!
`
You're welcome :) Glad it helped !
Pixamoon
The function
The function SelView.getSelectedNodes() return the selected node in the slate but the listener says it's a mixininterface:node. I can't get the UV_Tile property of the node...apparently there's just the '.name' '.position' and '.selected' that working. How can I get the UV_tile property ?
I tried to use 'trackViewNodes[#sme][sme.ActiveView][1].reference.name' to get the name of all node and then compare the name with SelView.getSelectedNodes[1].name
But I'm lost...I don't understand what I'm doing...I just want to connect the selected texturmap Uv property to a bezier node controller...It should not be so hard to do !