Fix T43090: Cycles + Freestyle + border render = black render.
The reported problem was due to a special case where there are no strokes to be rendered. Since rendering an empty scene is a waste of time, the issue was addressed here by skipping the stroke rendering process entirely.
This commit is contained in:
parent
448d143ad0
commit
c9e5d9226b
Notes:
blender-bot
2023-12-08 16:39:08 +01:00
Referenced by issue #43090, Cycles + Freestyle + border render = black render
|
@ -869,7 +869,7 @@ void Controller::DrawStrokes()
|
|||
real d = _Chrono.stop();
|
||||
if (G.debug & G_DEBUG_FREESTYLE) {
|
||||
cout << "Strokes generation : " << d << endl;
|
||||
cout << "Stroke count : " << _Canvas->stroke_count << endl;
|
||||
cout << "Stroke count : " << _Canvas->getStrokeCount() << endl;
|
||||
}
|
||||
resetModified();
|
||||
DeleteViewMap();
|
||||
|
|
|
@ -654,6 +654,12 @@ int BlenderStrokeRenderer::GenerateScene()
|
|||
{
|
||||
GenerateStrokeMesh(*it, true);
|
||||
}
|
||||
return get_stroke_count();
|
||||
}
|
||||
|
||||
// Return the number of strokes
|
||||
int BlenderStrokeRenderer::get_stroke_count() const
|
||||
{
|
||||
return strokeGroups.size() + texturedStrokeGroups.size();
|
||||
}
|
||||
|
||||
|
@ -956,7 +962,8 @@ Render *BlenderStrokeRenderer::RenderScene(Render *re, bool render)
|
|||
|
||||
Render *freestyle_render = RE_NewRender(freestyle_scene->id.name);
|
||||
|
||||
RE_RenderFreestyleStrokes(freestyle_render, freestyle_bmain, freestyle_scene, render);
|
||||
RE_RenderFreestyleStrokes(freestyle_render, freestyle_bmain, freestyle_scene,
|
||||
render && get_stroke_count() > 0);
|
||||
|
||||
return freestyle_render;
|
||||
}
|
||||
|
|
|
@ -85,6 +85,7 @@ protected:
|
|||
|
||||
static const char *uvNames[];
|
||||
|
||||
int get_stroke_count() const;
|
||||
float get_stroke_vertex_z(void) const;
|
||||
unsigned int get_stroke_mesh_id(void) const;
|
||||
bool test_triangle_visibility(StrokeVertexRep *svRep[3]) const;
|
||||
|
@ -96,7 +97,6 @@ protected:
|
|||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BlenderStrokeRenderer")
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
} /* namespace Freestyle */
|
||||
|
|
|
@ -496,7 +496,7 @@ void FRS_composite_result(Render *re, SceneRenderLayer *srl, Render *freestyle_r
|
|||
rl = render_get_active_layer( freestyle_render, freestyle_render->result );
|
||||
if (!rl || rl->rectf == NULL) {
|
||||
if (G.debug & G_DEBUG_FREESTYLE) {
|
||||
cout << "Cannot find Freestyle result image" << endl;
|
||||
cout << "No Freestyle result image to composite" << endl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ protected:
|
|||
static const char *_MapsPath;
|
||||
SteerableViewMap *_steerableViewMap;
|
||||
bool _basic;
|
||||
int stroke_count;
|
||||
|
||||
public:
|
||||
/* Builds the Canvas */
|
||||
|
@ -213,7 +214,10 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
int stroke_count;
|
||||
inline int getStrokeCount() const
|
||||
{
|
||||
return stroke_count;
|
||||
}
|
||||
|
||||
/*! modifiers */
|
||||
inline void setSelectedFEdge(FEdge *iFEdge)
|
||||
|
|
Loading…
Reference in New Issue