Allen Joaquin
Forum Replies Created
-
yes but how would i do this for 50 layers? i need some sort of script. : X
-
ok i actually wanted a point light, so i´ve added the lines
var newNull = myComp.layers.addLight("",[centerW,centerH]);
newNull.lightType = LightType.POINT;This is how it looks like now.
// Add Parented Null to Each Selected Layer.jsx//
// USER VARIABLES:
//
var nullSuffix = "-Light";
var addLayerNameBeforeSuffix = 1; // 1 for yes, 0 for no
//
//
//////////////////////////////////////////////////////////////////////var proj = app.project;
var undoStr = "Add Parented Null to Selected Layers";if (proj){
var myComp = app.project.activeItem;
if (myComp != null && (myComp instanceof CompItem)){
app.beginUndoGroup(undoStr);var myLayers = myComp.selectedLayers;
var saveIn = 0;
var saveOut = 0;
for (i=0; i <= myLayers.length-1; i++){ currentLayer = myLayers[i]; saveIn = (currentLayer.stretch < 0) ? currentLayer.outPoint : currentLayer.inPoint; saveOut = (currentLayer.stretch < 0) ? currentLayer.inPoint : currentLayer.outPoint; saveIndex = currentLayer.index; saveName = (addLayerNameBeforeSuffix) ? currentLayer.name+nullSuffix : nullSuffix; var myName = (parseFloat(app.version) < 8.0) ? saveName.substring(0, 31) : saveName; var centerW = currentLayer.width/2; var centerH = currentLayer.height/2; var newNull = myComp.layers.addLight("",[centerW,centerH]); newNull.lightType = LightType.POINT; if (currentLayer.threeDLayer) newNull.threeDLayer = true; var tempParent = null; if (currentLayer.parent != null) { tempParent = currentLayer.parent; var tempLayer = currentLayer.duplicate(); tempLayer.parent = null; newNull.transform.position.setValue(tempLayer.transform.position.value); //newNull.transform.scale.setValue(tempLayer.transform.scale.value); if (tempLayer.threeDLayer) { newNull.transform.xRotation.setValue(tempLayer.transform.xRotation.value); newNull.transform.yRotation.setValue(tempLayer.transform.yRotation.value); newNull.transform.zRotation.setValue(tempLayer.transform.zRotation.value); } else { newNull.transform.rotation.setValue(tempLayer.transform.rotation.value); } tempLayer.remove(); } else { newNull.transform.position.setValue(currentLayer.transform.position.value); //newNull.transform.scale.setValue(currentLayer.transform.scale.value); if (currentLayer.threeDLayer) { newNull.transform.orientation.setValue(currentLayer.transform.orientation.value); newNull.transform.xRotation.setValue(currentLayer.transform.xRotation.value); newNull.transform.yRotation.setValue(currentLayer.transform.yRotation.value); newNull.transform.zRotation.setValue(currentLayer.transform.zRotation.value); } else { newNull.rotation.setValue(currentLayer.transform.rotation.value); } } if (tempParent != null) newNull.parent = tempParent; newNull.moveBefore(myLayers[i]); newNull.inPoint = saveIn newNull.outPoint = saveOut; currentLayer.parent = newNull; newNull.name = myName; } app.endUndoGroup(); } else { alert("Please select an active comp to use this script"); } } else { alert("Please open a project first to use this script."); }But now i come acrros the error on line 77 ¨Can not ¨Set value¨ with this property, because the property of a parent property is ¨Hidden¨
If i make the layer 3D: Error line 72 ¨can not set value with this property because the property or a parent property is hidden.
What could i do? i add the notepad of the code since ive had some troubles copying and pasting the code from the website.
Also mention that before the script stops it creates 1 light correctly even tho i have 3 layers selected.
Thank you
-
Could you explain the expression used here? id like to know what it is exactly doing in case i´d like to modify it!
Thanks a lot.
-
[Adam Trachtenberg] “Matterwaves”
Could you explain a bit more in depth the steps i’d have to follow?
Basicly i want my person which is rendered in alpha channel to emit sort of a smoke out of the body. Could i do that using thinking particles?
-
Yes Exactly! I have my person in a clip and i masked it out now i’d like to add him the effect of smoking coming out of him as he moves.
-
Double post Error soz.
-
Just what i needed Thnx! : )
-
Sweet will check it out definetly
-
great they helped greatly! Thanks a lot!