PDA

View Full Version : Create Null/Slider button for each texture attribute



raw-m
10-20-2014, 10:27 AM
It would be super handy if each texture parameter had a little button next to it that gives use the ability to create a null -or slider- in Layout and automatically have attributes from the texture applied to it (via script... whatever). Not just Pos, Rot and Scale, but any of the other parameters within the texture i.e., Bump Amp, Opacity...

It'd speed up workflow considerably and could also take some of the misery out of editing the Motion Options Nodal Motion/displacements when you duplicate up an item a number of times.

ernpchan
10-20-2014, 10:12 PM
So for a surface you want to tie all the major envelopes to a null?

jeric_synergy
10-20-2014, 11:35 PM
That would make for a very crowded scene quite quickly.

And I'm not sure how your 2nd para follows.

raw-m
10-21-2014, 03:52 AM
What I'm basically after is a quick way to generate a null or slider, have it labeled, create an item info node, select the relevant channel and have it piped into my chosen parameter (it doesn't have to work like that but thats one way to set it up currently - expressions could be better). You're not obliged to create a null for every single parameter.

It would be nice if you could do something like RBM on a parameter and have options for Control by Null/Control by Slider and everything is nicely generated straight away, allowing me to quickly get on with the creative bit, not the rigging bit (apologies to anyone who finds rigging creative!).

jeric_synergy
10-21-2014, 06:34 PM
I think your best bet would be to use the Graph Editor as the launch pad for such a routine: I suspect there's limited UI<>plugin interaction (currently), but the GE gives the program more of a clue where you're heading.

That's for a truly general solution, but if you find you're wanting the same ten things over and over a simpler solution might be possible, because the script/plugin doesn't have to do a lot of querying either the app or the user.

ernpchan
10-21-2014, 06:51 PM
I was thinking of trying this through the GE as well but very little of the GE is exposed to the SDK.

jeric_synergy
10-21-2014, 07:22 PM
Channel modifiers can be scripts, even if they don't actually perform as a modifier, to my (HA!) understanding.

So, I'm thinking it could at least detect the channel in question and set up a null.

Kryslin
10-21-2014, 11:41 PM
For a decent starting point, see the discussion down here: http://forums.newtek.com/showthread.php?143989-Help-to-create-script-plugin

morphlink basically does what you want - it ties a driving item to a channel via an expression. Likewise, all the code to create a control, assign it a shape and caption are all there in another script snippet I posted.

I don't know if it's possible to pick up a channel as a selection, though.

What I see as a workflow:
1) Desired parameter is enveloped (so a channel now exists for it).
2a) Using a script, the parameter is chosen from a list as the target. (Script makes a list of channels - a search filter might help tremendously here...)
2b) The controller to do the controlling is set up, and the channel doing the driving is selected. Allow user the option to use an existing controller/channel if desired.
2c) The ranges for input and output are set, and the OK button is pushed.
2d) Script attaches a clamped map range expression to the target channel (or whatever expression you want)
3) User is happy (or, at least, satisfied)!

jeric_synergy
10-22-2014, 01:51 AM
Kryslin, if a script is intended as a Channel Modifier, isn't the ...uhhhhhh.... "Channel designation acquisition process" eased?

Kryslin
10-22-2014, 09:19 AM
It probably would be, yes. Limit the creation of your control to a UDF called from the options() section, along with the code to link the expression to the driving item, and have the prcoess() UDF empty (it does nothing, since an expression does all the work. You would have to add the extra step of removing the modifier afterwords, though. Since it's a run once and onde type of script, a generic script would be a better choice.

But yes, Add your envelope, add channel modifier script, check to see if expression is there, remove channel modifier, happy user.

jeric_synergy
10-22-2014, 09:52 AM
Once I learned a Channel Modifier can be a script, it occured to me that as a script, it doesn't really have to do anything with the channel it is purportedly "attached" to.

It doesn't even need to be removed, if it can detect that it has executed once.

Kryslin
10-22-2014, 12:29 PM
That would be a variable that would be stored in the scene file. So long as it isn't something that references something in the scene, it works... (my experience is that you have to wait until the first process() call, which happens right after everything loads, to set any object references).

Hmm, I think there's enough information here to start coding...