When creating a new group, use the color of last requested solid.
parent
29296447a9
commit
55e3162a05
|
@ -222,6 +222,15 @@ void Group::MenuGroup(int id) {
|
|||
|
||||
default: oops();
|
||||
}
|
||||
|
||||
// Copy color from the previous mesh-contributing group.
|
||||
if(g.IsMeshGroup() && SK.groupOrder.n > 0) {
|
||||
Group *running = SK.GetRunningMeshGroup();
|
||||
if(running != NULL) {
|
||||
g.color = running->color;
|
||||
}
|
||||
}
|
||||
|
||||
SS.GW.ClearSelection();
|
||||
SS.UndoRemember();
|
||||
|
||||
|
|
|
@ -430,6 +430,17 @@ Group *Group::RunningMeshGroup(void) {
|
|||
}
|
||||
}
|
||||
|
||||
bool Group::IsMeshGroup() {
|
||||
switch(type) {
|
||||
case Group::EXTRUDE:
|
||||
case Group::LATHE:
|
||||
case Group::ROTATE:
|
||||
case Group::TRANSLATE:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Group::DrawDisplayItems(int t) {
|
||||
RgbaColor specColor;
|
||||
bool useSpecColor;
|
||||
|
|
|
@ -243,6 +243,7 @@ public:
|
|||
// And the mesh stuff
|
||||
Group *PreviousGroup(void);
|
||||
Group *RunningMeshGroup(void);
|
||||
bool IsMeshGroup();
|
||||
void GenerateShellAndMesh(void);
|
||||
template<class T> void GenerateForStepAndRepeat(T *steps, T *outs);
|
||||
template<class T> void GenerateForBoolean(T *a, T *b, T *o, int how);
|
||||
|
|
|
@ -852,3 +852,15 @@ BBox Sketch::CalculateEntityBBox(bool includingInvisible) {
|
|||
}
|
||||
return box;
|
||||
}
|
||||
|
||||
Group *Sketch::GetRunningMeshGroup() {
|
||||
if(groupOrder.n < 1) return NULL;
|
||||
Group *g = GetGroup(groupOrder.elem[groupOrder.n - 1]);
|
||||
while(g != NULL) {
|
||||
if(g->IsMeshGroup()) {
|
||||
return g;
|
||||
}
|
||||
g = g->PreviousGroup();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -672,6 +672,7 @@ public:
|
|||
void Clear(void);
|
||||
|
||||
BBox CalculateEntityBBox(bool includingInvisible);
|
||||
Group *GetRunningMeshGroup();
|
||||
};
|
||||
#undef ENTITY
|
||||
#undef CONSTRAINT
|
||||
|
|
Loading…
Reference in New Issue