PDA

View Full Version : Zero extrude Script


MrBraun
05-15-2007, 12:00 PM
Hello to all,
i have a little request: somehone can help me to create a zero extrude script?

Tnx in advance!

mrB

tcastudios
05-15-2007, 03:19 PM
This should work, zero extrudes selected polys.


if(!op) return;
if(!op->IsInstanceOf(Opolygon)) return;
var bc = new(BaseContainer);
bc->SetData(MDATA_EXTRUDE_OFFSET, 0);

SendModelingCommand(1011183, doc, op, bc, MODIFY_POLYGONSELECTION);


Cheers
Lennart

MrBraun
05-15-2007, 04:41 PM
Tnx Lennart !!! :)

For the edge i use the same script??

Tnx again! ;)

xfon5168
05-15-2007, 06:41 PM
Tnx Lennart !!! :)

For the edge i use the same script??

Tnx again! ;)

Zero Extruding a single Edge won't work. It never has and it shouldn't. If you have 2 or more edges selected, it will work fine, but for one edge no it shouldnt work I don't think (just based on using the extrude tool). With a single edge if you extrude it like .01 or something then itll show up fine.

tcastudios
05-15-2007, 08:32 PM
The script will extrude polys and not edges.
AFAIK there is no direct access to edges with COFFEE, maybe someone else can shed some light on that or have a snippet of code to "get it".

There are some benefits of having a "one button" zeroextrude for edges while modelling.
There -is- a free plugin extruding polys, edges and even points that I used up till version 9.6 PPC but it stopped working with UB, called EasyClone. I suppose it would still work on the Windows side.
The downside is that it have problems starting with R9 regarding edges.

You can check here:
http://iangorse.co.uk/blogs/index.php?cat=22

Cheers
Lennart

MrBraun
05-15-2007, 08:58 PM
Tnx both for the answers! ;)

bobtronic
05-15-2007, 09:25 PM
actually it is possible to use edge selections for SendModelingCommand. use the MODIFY_EDGESELECTION id. here the script with automatic checking for the selected mode (polygon, edge or point) so it will do a zero extrude for polygons, edges or points depending on the selected mode.


var op = doc->GetActiveObject();
if(!op) return;
if(op->GetType()==Opolygon)
{
if(IsCommandChecked(12187))
{
var bc = new(BaseContainer);
bc->SetData(MDATA_EXTRUDE_OFFSET, 0);
SendModelingCommand(ID_MODELING_EXTRUDE_TOOL, doc, op, bc, MODIFY_POLYGONSELECTION);
return;
}
if(IsCommandChecked(16351))
{
var bc = new(BaseContainer);
bc->SetData(MDATA_EXTRUDE_OFFSET, 0);
SendModelingCommand(ID_MODELING_EXTRUDE_TOOL, doc, op, bc, MODIFY_EDGESELECTION);
return;
}
if(IsCommandChecked(12139))
{
var bc = new(BaseContainer);
bc->SetData(MDATA_EXTRUDE_OFFSET, 0);
SendModelingCommand(ID_MODELING_EXTRUDE_TOOL, doc, op, bc, MODIFY_POINTSELECTION);
return;
}
}


cheers,
Bob

tcastudios
05-15-2007, 09:56 PM
Great Bob!
It looks thou as a very small offset of i.e 0.01, seems to be needed for the edge extrude part not to get a wacky scale of the new edge.

Cheers
Lennart

MrBraun
05-15-2007, 10:29 PM
Really great Bob!! Tnx to all !! :)

3dj
05-16-2007, 01:10 AM
So what is a "zero extrude" anyway?

I haven't heard of this one before?

Thanks.
-Jim

tcastudios
05-16-2007, 01:22 AM
Basically you speed up the workflow somewhat by selecting your poly/edge, run the script by clicking its icon and then drag the new part where you want it.
This way you don't have to switch tools while adding geometry.
And since the extrusion is placed at its starting point you don't need to reposition it before
doing your move.
It's a small but often a handy thing.

Cheers
Lennart

3dj
05-16-2007, 01:35 AM
Basically you speed up the workflow somewhat by selecting your poly/edge, run the script by clicking its icon and then drag the new part where you want it.
This way you don't have to switch tools while adding geometry.
And since the extrusion is placed at its starting point you don't need to reposition it before
doing your move.
It's a small but often a handy thing.

Cheers
Lennart
OOOOHHHH Sweet! thanks. I suppose it can be added to a hotkey as well.

thank you.

-Jim

Rantin Al
05-16-2007, 08:55 AM
Thanks Bob.

I missed the functionality of EasyClone. This will be a useful replacement.

Cheers, Alan.

CGTalk Moderation
05-16-2007, 08:55 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.