Forum Replies Created
-
Santi AgustÃ
January 3, 2019 at 4:23 am in reply to: scripting: fill color same as layer label color?wow! thanks for the sharing! it will be for sure super useful in a near future!
regarding the original question of the thread, I think I totally misexplained myself
I’m with a script to create a shape layer on each selected null, and I wanted to make its fill color be the same as the null label color, this way it will mimic the null color, so the question was more about if there was a way to get the actual 16 label colors stored on the preferences.
I’d use the default colors, but some people may have customized the original colors, so I was wondering if there is an easy way to get these colors from the label number without having to deal with the reading of the prefs file text stored and diving too deep.
So if you have a null layer with the lavender label color, the fill color of the new shape associated to that null would be the lavender hex #A9A9CA.
The user is always having the option of changing that initial shape layer color. I just thought that would be nice to mimic the null’s color when the shape is created via the script.
But maybe I will end just having an array of the default label colors plus some other palettes and launch a base color from that, instead of the original idea .
anyway, thanks again!
-
I think you will love this splendid piece of code by Tomas Sinkunas.
You need to save your pseudo as .ffx , then convert it to binary and follow this approach:
https://bitbucket.org/snippets/rendertom/qj5M4/apply-pseudo-effect-as-animation-preset -
thanks!
I was so focused on guessing how to achieve the math stuff, that I totally lost the non-so-automatic but super handy approach, thanks for pointing at it! 🙂 -
Santi AgustÃ
September 2, 2018 at 2:49 am in reply to: if blah 100 else fade out instead of 100 else 0uhm, yes, it’s getting more complicated than I thought
I found a temporary workaround, until I guess how to to that.
It’s not perfect, but it gives some fading to the thing, instead of going from 100 to 0
k = "__";
n =effect("ch_0_pitch")("Slider");
k = ["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"][n % 12];
escala=Math.round(n/12);
toto = k + escala;
myIndex=thisProperty.propertyGroup(2).propertyIndex;
este=thisProperty.propertyGroup(1).propertyGroup(myIndex).name;
if (toto==este)
{100}
else
{
amp = 70;
freq = 0.7;
decay = 0.5;
amp * Math.cos(freq * time * 2 * Math.PI) * Math.exp(- decay * time);
}
Super thanks anyway for the suggestions!
-
Santi AgustÃ
September 1, 2018 at 3:05 am in reply to: if blah 100 else fade out instead of 100 else 0Aye!!
I wanted to reply to the post, but clicked report post instead, so I think Dan’s reply got lost! so sorry! ????????So I was struggling with Dan’s suggestion about calculating and comparing the 2 the previous keyframes (driven by the pitch slider) etc, but I had not exactly the best of the lucks dealing with the nearestKey(time).index (I managed to get the first fade out done, because it was on the first frame, but not again anymore when the note should show up and fade away later on the timeline)
this is one of my attempts:
k = "__";
p =effect("ch_0_pitch")("Slider");
k = ["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"][p % 12];
escala=Math.round(p/12);
toto = k + escala;
myIndex=thisProperty.propertyGroup(2).propertyIndex;
este=thisProperty.propertyGroup(1).propertyGroup(myIndex).name;//
t = 0;
if (p.numKeys > 1){
n = p.nearestKey(time).index;
if (p.key(n).time > time) n--;
if (n > 0){
if (toto==este){
100
}else{
fade=framesToTime(8);
t= p.key(n+framesToTime(1)).time - p.key(n).time;
linear(time,t,t + fade,100,0)
}
}
}
any rough idea of how it could be?
thanks! !
(And promise to click back on the correct reply button! )????
-
Santi AgustÃ
August 29, 2018 at 1:06 pm in reply to: if blah 100 else fade out instead of 100 else 0yess, the pitch slider has a keyframe on every frame, so that approach is perfect! thanks!
-
Santi AgustÃ
April 25, 2018 at 5:10 am in reply to: Paint effect stroke shape to Shape layer shape via scriptmmm
this post recalls me to an old quick adaptation I made of the exquisite Redefinery Script that converted masks to shapes, to make it work with paint brushes and shape layers. As I was in an animation project rush and I needed a quick tool for converting brushes paths to shape layers, I only could scratch the surface of the script, and I ended up copy-pasting the paths by hand.
The thing is, having this adapted script as a basis, maybe you can do the copypaste via scripting, copying from the brush path property array to the newly shape paths generated.
Im totally lost on that, so I can help more than that, I don’t know how to go from the original paths, store their values, and paste on the duplicated paths in the shape layer ☹Making that work would be a really handy tool I think! Any advice?
here is the quick script you can start from. Now it goes thru all the brushes of a solid, and makes a duplicated of them on a newly created shape layer, buuuuuuut they are empty (is handy to recreate the hierarchy btw)
// quick and awufully adapted code from the original rd_MasksToShapes from the great https://www.redefinery.com/ae/rd_scripts/app.beginUndoGroup("duplicate paintGroups to shape layer groups");
var activeComp = app.project.activeItem;
var myLayers = activeComp.selectedLayers[0];// Get PropertyGroup containing the strokes
var paintGroup = myLayers.property("ADBE Effect Parade").property("ADBE Paint").property("ADBE Paint Group");// Create an empty shape layer
var suffix = " the Shape";
var shapeLayer = activeComp.layers.addShape();
shapeLayer.name = myLayers.name.substr(0,31-suffix.length) + suffix;
shapeLayer.moveBefore(myLayers);var shapeLayerContents = shapeLayer.property("ADBE Root Vectors Group");
var shapeGroup = shapeLayerContents; //.addProperty("ADBE Vector Group");// Iterate over the paints layer's paints, converting their paths to shape paths
for (var m=1; m<=paintGroup.numProperties; m++)
// for (var m=1; m<=paintGroup.numProperties; m++){
// Get paint info
paint = paintGroup.property(m);
paintShape = paintGroup.property("ADBE Paint Shape");// Create new shape path using paint info
shapePathGroup = shapeGroup.addProperty("ADBE Vector Shape - Group");
shapePathGroup.name = paint.name;
shapePath = shapePathGroup.property("ADBE Vector Shape");app.endUndoGroup();
}Sorry I can’t help more, but as your question was something similar to what I did, maybe is useful as a start until some real scripting expert can drive you onto a better direction ????
-
Santi AgustÃ
March 23, 2018 at 7:55 am in reply to: Adding Inertia or Bounce on a Shape Layers Path?totally awesome, thanks!
-
Santi AgustÃ
March 22, 2018 at 11:50 pm in reply to: Adding Inertia or Bounce on a Shape Layers Path?Hi!
sorry for bringing back this old post,
do you think it’s now possible to add bounciness to a shape layer path animation with the new cc 2018 features? -
hiya!
did you take a look at this post?
maybe is what you need?
https://forums.creativecow.net/thread/227/29736#29737