C4D打孔脚本(MakeHole.CSC) 

2015-01-22 01:37 发布 | 作品版权归原作者所有,仅供参考学习,禁止商业使用!

插件脚本 /[建模辅助]
443 0 0
C4D打孔脚本(MakeHole.CSC)
C4D打孔脚本(MakeHole.CSC) - C4D之家 - cinema4d_-2015-01-22-01.09.47.jpg

非常好的打洞脚本,可惜C4D R16用不了,国外C4D网站(c4dnetwork)上有讲支持R12,放出来如有还在用12的同学可以去用。
脚本代码放出来,有能力的朋友,改一下吧,改成R16的也好。
  1. if(!IsCommandChecked(12187)) return;

  2. var op = doc->GetActiveObject();
  3. if(!op) return;

  4. if(op->GetType()==Opolygon)
  5. {
  6.     var bc = new(BaseContainer);

  7.     bc->SetData(MDATA_EXTRUDE_OFFSET, 0);
  8.     bc->SetData(MDATA_EXTRUDE_PRESERVEGROUPS, TRUE);
  9.     SendModelingCommand(ID_MODELING_EXTRUDE_TOOL, NULL, op, bc, MODIFY_POLYGONSELECTION);

  10.   bc->SetData(MDATA_CONVERTSELECTION_LEFT, 2);
  11.   bc->SetData(MDATA_CONVERTSELECTION_RIGHT ,0);
  12.     SendModelingCommand(MCOMMAND_CONVERTSELECTION, NULL, op, bc, MODIFY_POINTSELECTION);
  13.    
  14.     CallCommand(1015924); // Collapse ID_MODELING_COLLAPSE_COMMAND
  15.     SendModelingCommand( MCOMMAND_SELECTALL, NULL, op, bc, MODIFY_POLYGONSELECTION);
  16.    
  17.     var saveselection = op->GetPointSelection();
  18.     var i, collapsedpoint;
  19.     var select = op -> GetPointSelection();

  20.     for (i = 0; i < op->GetPointCount(); i++) {
  21.         if (select->IsSelected(i)){
  22.             collapsedpoint = i;
  23.         }
  24.     }

  25.     SendModelingCommand(MCOMMAND_SELECTGROW, NULL, op, bc, MODIFY_POINTSELECTION);
  26.    
  27.     var found = 0;
  28.     var selectedpoint = new(array,op->GetPointCount());
  29.     var select = op -> GetPointSelection();

  30.     for (i = 0; i < op->GetPointCount(); i++) {
  31.         if (found >= select->GetCount()) break;
  32.         if (select->IsSelected(i)){
  33.             selectedpoint[found] = i;
  34.             found++;
  35.         }
  36.     }

  37.     var beveldistance = 0;
  38.     for(i = 0; i < found; i++) {
  39.         beveldistance += vlen(op->GetPoint(selectedpoint[i]) - op->GetPoint(collapsedpoint));
  40.     }

  41.     op->SetPointSelection(saveselection);

  42.     bc->SetData(MDATA_BEVEL_OFFSET2 , (beveldistance / (found-1) ) /3);
  43.     SendModelingCommand(ID_MODELING_BEVEL_TOOL, NULL, op, bc, MODIFY_POINTSELECTION);
  44.     SendModelingCommand(MCOMMAND_SELECTINVERSE, NULL, op, bc, MODIFY_POLYGONSELECTION);
  45.     SendModelingCommand(MCOMMAND_DELETE, NULL, op, bc, MODIFY_POLYGONSELECTION);
复制代码


点击下载图标
下载等级
C8D
登录后下载

插件脚本
软件性质:  
适用版本: C4D R15 - C4D R16 - C4D R17 - C4D R18 - C4D R19 - C4D R20 - C4D R21 - C4D S22 - C4D R23 - C4D S24 - C4D R25 - C4D S26 - C4D 2023 - C4D 2024 - C4D 2025
软件版本: C4D R12
系统平台: Win MAC 
软件语言: 英文 
插件来源: https://www.c4d.cn/c4dsoft.html

相关推荐

百套精美Kitbash3D模型专题合集下载
时尚卡通办公室人物C4D立体图标工程下载Cinema 4D Fashion Cartoon Office Character 3D Icon Project Download
C4D科技新闻片头电视栏目频道包装动画工程下载Cinema 4D Technology News Headline TV Program Channel Packaging Animation Project Download
关闭

C4D精选推荐 上一条 /10 下一条

智能
客服
快速回复 返回顶部 返回列表