Skip to content

Commit 0e287d7

Browse files
committed
SceneCacheReader: Fix crash when the widget updates and Caribou/Gaffer is computing.
I noticed crashes when the SceneCacheReader property panel was displayed and you would change frame or filter the scene tag. The following traceback indicates that it was related with refresh the SceneView widget. This is likely something fundamentally flawed with the node ( as Nuke often complains we are updating knob inside the _validate). Futhermore, we should be able to use native Nuke node once we start using Nuke 14+ and its USD support ( using our SceneCacheDataFormat AbstractFormat USD plugin ). The trick is to avoid updating the widget when it's already up to date. While testing,I couldnt reproduce the crash I saw when changing the filtering and the "loading" of location in the Nuke 3d system. ``` 0 0x0000000080000017 in ?? () 1 0x00007fa26c59fee2 in QObject::disconnect(QObject const*, char const*, QObject const*, char const*) () from /software/apps/nuke/13.2v8/cent7.x86_64/libQt5Core.so.5 2 0x00007fa26d341e90 in QTreeView::setModel(QAbstractItemModel*) () from /software/apps/nuke/13.2v8/cent7.x86_64/libQt5Widgets.so.5 3 0x00007fa25b1a089c in ?? () from /software/apps/nuke/13.2v8/cent7.x86_64/libnuke-13.2.8.so 4 0x00007fa25aae2656 in ?? () from /software/apps/nuke/13.2v8/cent7.x86_64/libnuke-13.2.8.so 5 0x00007fa25aaec3f9 in ?? () from /software/apps/nuke/13.2v8/cent7.x86_64/libnuke-13.2.8.so 6 0x00007fa175dc56e9 in IECoreNuke::SceneCacheReader::filterScene(std::string const&, std::string const&, bool) () from /software/apps/cortex/10.4.10.0/cent7.x86_64/nuke/13.2/lib/libIECoreNuke-10.4.so 7 0x00007fa175dc6065 in IECoreNuke::SceneCacheReader::_validate(bool) () from /software/apps/cortex/10.4.10.0/cent7.x86_64/nuke/13.2/lib/libIECoreNuke-10.4.so 8 0x00007fa2597faf3b in DD::Image::Op::force_validate(bool) () from /software/apps/nuke/13.2v8/cent7.x86_64/libDDImage.so 9 0x00007fa175da9794 in IECoreNuke::LiveScene::geometryList(DD::Image::Op*, double const&) const () from /software/apps/cortex/10.4.10.0/cent7.x86_64/nuke/13.2/lib/libIECoreNuke-10.4.so 10 0x00007fa175da9dc9 in IECoreNuke::LiveScene::geometryList(double const&) const () from /software/apps/cortex/10.4.10.0/cent7.x86_64/nuke/13.2/lib/libIECoreNuke-10.4.so 11 0x00007fa175daa860 in IECoreNuke::LiveScene::cacheGeometryList(double const&) const () from /software/apps/cortex/10.4.10.0/cent7.x86_64/nuke/13.2/lib/libIECoreNuke-10.4.so 12 0x00007fa175dab8f2 in IECoreNuke::LiveScene::objectNum(double const*) const () from /software/apps/cortex/10.4.10.0/cent7.x86_64/nuke/13.2/lib/libIECoreNuke-10.4.so 13 0x00007fa175dacedb in IECoreNuke::LiveScene::childNames(std::vector<IECore::InternedString, std::allocator<IECore::InternedString> >&) const () from /software/apps/cortex/10.4.10.0/cent7.x86_64/nuke/13.2/lib/libIECoreNuke-10.4.so 14 0x00007fa1298fbca9 in CaribouNuke::CaribouSceneReader::computeChildNames(std::vector<IECore::InternedString, std::allocator<IECore::InternedString> > const&, Gaffer::Context const*, GafferScene::ScenePlug const*) const () from /home/lucienf/apps/caribou/4.2.2dev/gaffer/1.2/tools/nuke/13.2/python/cent7.x86_64/cortex/10.4/CaribouNuke/_CaribouNuke.so 15 0x00007fa13530d444 in GafferScene::SceneNode::compute(Gaffer::ValuePlug*, Gaffer::Context const*) const () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGafferScene.so 16 0x00007fa148ec5340 in Gaffer::ValuePlug::ComputeProcess::ComputeProcess((anonymous namespace)::ComputeProcessKey const&) () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 17 0x00007fa148ece618 in Gaffer::ValuePlug::ComputeProcess::value(Gaffer::ValuePlug const*, IECore::MurmurHash const*) () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 18 0x00007fa148ec7f6a in Gaffer::ValuePlug::getValueInternal(IECore::MurmurHash const*) const () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 19 0x00007fa148eba781 in boost::intrusive_ptr<IECore::TypedData<std::vector<IECore::InternedString, std::allocator<IECore::InternedString> > > const> Gaffer::ValuePlug::getObjectValue<IECore::TypedData<std::vector<IECore::InternedString, std::allocator<IECore::InternedString> > > >(IECore::MurmurHash const*) const () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 20 0x00007fa148ebab7a in Gaffer::TypedObjectPlug<IECore::TypedData<std::vector<IECore::InternedString, std::allocator<IECore::InternedString> > > >::getValue(IECore::MurmurHash const*) const () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 21 0x00007fa148ebabbe in Gaffer::TypedObjectPlug<IECore::TypedData<std::vector<IECore::InternedString, std::allocator<IECore::InternedString> > > >::setFrom(Gaffer::ValuePlug const*) () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 22 0x00007fa148e36256 in Gaffer::NameSwitch::compute(Gaffer::ValuePlug*, Gaffer::Context const*) const () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 23 0x00007fa148ec5340 in Gaffer::ValuePlug::ComputeProcess::ComputeProcess((anonymous namespace)::ComputeProcessKey const&) () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 24 0x00007fa148ece618 in Gaffer::ValuePlug::ComputeProcess::value(Gaffer::ValuePlug const*, IECore::MurmurHash const*) () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 25 0x00007fa148ec7f6a in Gaffer::ValuePlug::getValueInternal(IECore::MurmurHash const*) const () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 26 0x00007fa148eba781 in boost::intrusive_ptr<IECore::TypedData<std::vector<IECore::InternedString, std::allocator<IECore::InternedString> > > const> Gaffer::ValuePlug::getObjectValue<IECore::TypedData<std::vector<IECore::InternedString, std::allocator<IECore::InternedString> > > >(IECore::MurmurHash const*) const () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 27 0x00007fa148ebab7a in Gaffer::TypedObjectPlug<IECore::TypedData<std::vector<IECore::InternedString, std::allocator<IECore::InternedString> > > >::getValue(IECore::MurmurHash const*) const () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 28 0x00007fa1352c50ca in GafferScene::RenderController::SceneGraph::updateChildren(Gaffer::TypedObjectPlug<IECore::TypedData<std::vector<IECore::InternedString, std::allocator<IECore::InternedString> > > > const*) () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGafferScene.so 29 0x00007fa1352d9754 in GafferScene::RenderController::SceneGraph::update(std::vector<IECore::InternedString, std::allocator<IECore::InternedString> > const&, unsigned int, GafferScene::RenderController::SceneGraph::Type, GafferScene::RenderController*) () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGafferScene.so 30 0x00007fa1352d9e1b in GafferScene::RenderController::SceneGraphUpdateTask::execute() () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGafferScene.so 31 0x00007fa2568544ef in ?? () from /software/apps/nuke/13.2v8/cent7.x86_64/libtbb.so.2 ---Type <return> to continue, or q <return> to quit--- 32 0x00007fa256851b00 in ?? () from /software/apps/nuke/13.2v8/cent7.x86_64/libtbb.so.2 33 0x00007fa1352bb36e in GafferScene::RenderController::updateInternal(std::function<void (Gaffer::BackgroundTask::Status)> const&, IECore::PathMatcher const*, bool) () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGafferScene.so 34 0x00007fa148e3b47b in std::_Function_handler<void (IECore::Canceller const&), Gaffer::ParallelAlgo::callOnBackgroundThread(Gaffer::Plug const*, std::function<void ()>)::{lambda(IECore::Canceller const&)#1}>::_M_invoke(std::_Any_data const&, IECore::Canceller const&) () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 35 0x00007fa148d83dd5 in _ZN3tbb8internal13function_taskIZN6Gaffer14BackgroundTaskC4EPKNS2_4PlugERKSt8functionIFvRKN6IECore9CancellerEEEEUlvE_E7executeEv () from /software/apps/gaffer/1.2.9.0/cent7.x86_64/cortex/10.4/nuke/13.2/lib/libGaffer.so 36 0x00007fa2568544ef in ?? () from /software/apps/nuke/13.2v8/cent7.x86_64/libtbb.so.2 37 0x00007fa25684dae4 in ?? () from /software/apps/nuke/13.2v8/cent7.x86_64/libtbb.so.2 38 0x00007fa25684c603 in ?? () from /software/apps/nuke/13.2v8/cent7.x86_64/libtbb.so.2 39 0x00007fa256848846 in ?? () from /software/apps/nuke/13.2v8/cent7.x86_64/libtbb.so.2 40 0x00007fa256848a79 in ?? () from /software/apps/nuke/13.2v8/cent7.x86_64/libtbb.so.2 41 0x00007fa26bed3ea5 in start_thread () from /lib64/libpthread.so.0 42 0x00007fa26b308b0d in clone () from /lib64/libc.so.6 ```
1 parent 6da526c commit 0e287d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/IECoreNuke/SceneCacheReader.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,12 @@ void SceneCacheReader::filterScene( const std::string &filterText, const std::st
818818
m_data->m_itemToFiltered.clear();
819819

820820
// Set the filtered items.
821-
sceneView->setImportedItems( filteredIndices );
821+
std::vector<unsigned int> currentIndices;
822+
sceneView->getImportedItems( currentIndices );
823+
if( currentIndices != filteredIndices )
824+
{
825+
sceneView->setImportedItems( filteredIndices );
826+
}
822827

823828
// Create a mapping of item indices to filtered indices.
824829
for( std::vector<unsigned int>::const_iterator it( filteredIndices.begin() ); it != filteredIndices.end(); ++it )

0 commit comments

Comments
 (0)