Aktives Mitglied
AW: COFFEE / Xpresso / COF - Scripts Sammlung
Sandi Dol?ak hat ein praktisches Script (und andere) für R11.5 und R12 Veröffentlicht. Was das Script und die anderen macht sieht man .
Für R10.x und höher hat Harry Bee das Script anpassen müssen.
C4D-Network :: Die Cinema 4D Community - Forum - Einzelnen Beitrag anzeigen - News DPIT PFX v1.5 Demo Released
Sandi Dol?ak hat ein praktisches Script (und andere) für R11.5 und R12 Veröffentlicht. Was das Script und die anderen macht sieht man .
Für R10.x und höher hat Harry Bee das Script anpassen müssen.
C4D-Network :: Die Cinema 4D Community - Forum - Einzelnen Beitrag anzeigen - News DPIT PFX v1.5 Demo Released
Code:
DoTheMagic(sel, doc) {
if(sel->GetType() == OBJECT_EXTRUDE || sel->GetType() == OBJECT_LOFT || sel->GetType() == OBJECT_SWEEP || sel->GetType() == OBJECT_LATHE) { // NURBs
CallCommand(12236); // Make Editable
[COLOR=Blue]var old = doc->GetActiveObject();[/COLOR]
CallCommand(100004768); // Select Children
CallCommand(12144); // Connect
[COLOR=Blue]sel = doc->GetActiveObject();
old->ToggleBit(BIT_AOBJ);
sel->ToggleBit(BIT_AOBJ);
CallCommand(100004787); // Delete
sel->ToggleBit(BIT_AOBJ);[/COLOR]
[COLOR=Red]// CallCommand(16768); // Connect+Delete[/COLOR]
} else if(sel->GetType() == OBJECT_SYMMETRY) { // Symmetry
CallCommand(12236); // Make Editable
[COLOR=Blue]var old = doc->GetActiveObject();[/COLOR]
sel = doc->GetActiveObject();
var name = sel->GetDown()->GetName();
CallCommand(100004768); // Select Children
CallCommand(12144); // Connect
[COLOR=Blue]sel = doc->GetActiveObject();
old->ToggleBit(BIT_AOBJ);
sel->ToggleBit(BIT_AOBJ);
CallCommand(100004787); // Delete
sel->ToggleBit(BIT_AOBJ);[/COLOR]
[COLOR=Red]// CallCommand(16768); // Connect+Delete[/COLOR]
sel = doc->GetActiveObject();
sel->SetName(name); // Sets the name. Remove if you like to keep the name of Symetry object
} else CallCommand(12236); // Make Editable
sel = doc->GetActiveObject();
var bc = new(BaseContainer);
if(!bc) return;
bc->SetData(MDATA_OPTIMIZE_TOLERANCE, 0.1);
bc->SetData(MDATA_OPTIMIZE_POINTS, TRUE);
bc->SetData(MDATA_OPTIMIZE_POLYGONS, TRUE);
bc->SetData(MDATA_OPTIMIZE_UNUSEDPOINTS, TRUE);
SendModelingCommand(MCOMMAND_OPTIMIZE, doc, sel, bc, MODIFY_ALL); // Optimize call
}
DeselectAll() {
var obj = object();
while(obj->SearchNext(BIT_AOBJ)) {
obj->ToggleBit(BIT_AOBJ);
obj = obj->SearchNext(BIT_AOBJ);
}
obj->ToggleBit(BIT_AOBJ);
}
main(doc, op) {
var i = 0;
var k = 0;
var selected = new(array, 333); // Increase this number if you will ever select more then 333 objects at once
var selSave = new(array, 333); // -||-
var obj = object();
if(!obj) return;
while(obj->SearchNext(BIT_AOBJ)) {
selected[i] = obj;
i++;
obj = obj->SearchNext(BIT_AOBJ);
}
selected[i++] = obj;
DeselectAll();
var j;
for(j = 0; j < i; j++) {
selected[j]->ToggleBit(BIT_AOBJ);
DoTheMagic(selected[j], doc);
selSave[k] = doc->GetActiveObject();
k++;
doc->GetActiveObject()->ToggleBit(BIT_AOBJ);
}
for(j = 0; j <k; j++){
selSave[j]->ToggleBit(BIT_AOBJ);
}
}