Anyone here can merge these 2 scripts? mcjClosestVertex + Set Focal Distance
![rogersohandsome](https://secure.gravatar.com/avatar/cd34f5dd905c31aa032bafe014c1f5c0?&r=pg&s=100&d=https%3A%2F%2Fvanillicon.com%2Fcd34f5dd905c31aa032bafe014c1f5c0_100.png)
in The Commons
The two scripts are from here:
https://www.daz3d.com/forums/discussion/43694/mcjclosestvertex-get-a-marker-at-the-position-of-the-closest-vertex-of-something-to-your-camera-fo
https://www.daz3d.com/forums/discussion/43636/set-focal-distance-script
The first script creates a null on the closest vertex on what's selected.
The second script sets focal distance to the selected null node.
Hoping someone who knows how to script can merge these two functions so that with one click it'll just create null node on the closest vertex + sets focus distance on it.
It'll save me on a click or two and having to always look for null node after each render.
Comments
If the combined script contains the original scripts, only the original creators can legally provide it. Since there are two different creators permission to use the scripts would be required from both.
@rogersohandsome :
Charlie Judge is not wrong, but mCasual's mcjClosestVertex script already has permissive license allowing modifications/derivatives -- You would need to secure cwichura's permission for the combination script.
I just studied both scripts, and it is doable.
Neither one is encompassed by a main function, so a main one can be created with calls to both as separate functions with a do step 1, then do step 2, while respecting cwichura's error coding, adding non-existent error coding for mCasual's function, and further overall error coding for main function.
Not exactly sure how they both fit together, as cwichura's script seems to involve a couple of steps before script is fired.
Does mCasual's script automate cwichura's creation/selection states?
If so, then it would be a simple one script execution call. If not, I would suggest a modal dialog with combobox selections for camera, and possibly the null(s) if more than one is available for use, with execute/cancel buttons.
@mCasual already licenses the mcj scripts allowing for modification and redistribution, but yes, permission would need to be obtained from @cwichura to merge these.
Attached is a sample script to call these two scripts in sequence without merging them. You may need to edit the script locations at the top of this script to match the location you saved the others to.
@Omniflux Script does exactly what I wanted, thanks!