Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis delight #1

Merged
merged 3 commits into from
Sep 25, 2014
Merged

Travis delight #1

merged 3 commits into from
Sep 25, 2014

Conversation

johnhaddon
Copy link
Owner

No description provided.

@johnhaddon johnhaddon force-pushed the travisDelight branch 2 times, most recently from fed14de to 72e905d Compare September 24, 2014 11:16
@johnhaddon johnhaddon merged commit 9fc6785 into master Sep 25, 2014
@johnhaddon johnhaddon deleted the travisDelight branch September 25, 2014 10:18
johnhaddon added a commit that referenced this pull request Dec 19, 2019
This obviously isn't quite right, because the InteractiveRender tests crash with the following stack trace :

```
#0  0x0000000000000000 in ?? ()
#1  0x00007fffe18153a6 in foundation::auto_release_ptr<renderer::ITileCallback>::reset (this=0x7fff8c012148, ptr=0x0)
   at /disk1/john/dev/gafferDependencies/Appleseed/working/appleseed-2.1.0-beta/src/appleseed/foundation/utility/autoreleaseptr.h:187
#2  0x00007fffe181137f in renderer::(anonymous namespace)::ProgressiveFrameRenderer::~ProgressiveFrameRenderer (this=0x7fff8c0120a0, __in_chrg=<optimized out>)
   at /disk1/john/dev/gafferDependencies/Appleseed/working/appleseed-2.1.0-beta/src/appleseed/renderer/kernel/rendering/progressive/progressiveframerenderer.cpp:178
#3  0x00007fffe1811592 in renderer::(anonymous namespace)::ProgressiveFrameRenderer::~ProgressiveFrameRenderer (this=0x7fff8c0120a0, __in_chrg=<optimized out>)
   at /disk1/john/dev/gafferDependencies/Appleseed/working/appleseed-2.1.0-beta/src/appleseed/renderer/kernel/rendering/progressive/progressiveframerenderer.cpp:187
#4  0x00007fffe18115ca in renderer::(anonymous namespace)::ProgressiveFrameRenderer::release (this=0x7fff8c0120a0)
   at /disk1/john/dev/gafferDependencies/Appleseed/working/appleseed-2.1.0-beta/src/appleseed/renderer/kernel/rendering/progressive/progressiveframerenderer.cpp:191
#5  0x00007fffe1712fb7 in foundation::auto_release_ptr<renderer::IFrameRenderer>::~auto_release_ptr (this=0x7fff8c01f928, __in_chrg=<optimized out>)
   at /disk1/john/dev/gafferDependencies/Appleseed/working/appleseed-2.1.0-beta/src/appleseed/foundation/utility/autoreleaseptr.h:124
#6  0x00007fffe17121be in renderer::RendererComponents::~RendererComponents (this=0x7fff8c01f890, __in_chrg=<optimized out>)
   at /disk1/john/dev/gafferDependencies/Appleseed/working/appleseed-2.1.0-beta/src/appleseed/renderer/kernel/rendering/renderercomponents.h:73
#7  0x00007fffe1712288 in std::default_delete<renderer::RendererComponents>::operator() (this=0x7fff8c000ae0, __ptr=0x7fff8c01f890)
   at /opt/rh/devtoolset-6/root/usr/include/c++/6.3.1/bits/unique_ptr.h:76
#8  0x00007fffe1711e0d in std::unique_ptr<renderer::RendererComponents, std::default_delete<renderer::RendererComponents> >::reset (this=0x7fff8c000ae0,
   __p=0x7fff8c01f890) at /opt/rh/devtoolset-6/root/usr/include/c++/6.3.1/bits/unique_ptr.h:347
#9  0x00007fffe1710632 in renderer::CPURenderDevice::~CPURenderDevice (this=0x7fff8c0009b0, __in_chrg=<optimized out>)
   at /disk1/john/dev/gafferDependencies/Appleseed/working/appleseed-2.1.0-beta/src/appleseed/renderer/device/cpu/cpurenderdevice.cpp:112
#10 0x00007fffe1710988 in renderer::CPURenderDevice::~CPURenderDevice (this=0x7fff8c0009b0, __in_chrg=<optimized out>)
   at /disk1/john/dev/gafferDependencies/Appleseed/working/appleseed-2.1.0-beta/src/appleseed/renderer/device/cpu/cpurenderdevice.cpp:129
#11 0x00007fffe181f21c in std::default_delete<renderer::IRenderDevice>::operator() (this=0x3093868, __ptr=0x7fff8c0009b0)
   at /opt/rh/devtoolset-6/root/usr/include/c++/6.3.1/bits/unique_ptr.h:76
#12 0x00007fffe181eafd in std::unique_ptr<renderer::IRenderDevice, std::default_delete<renderer::IRenderDevice> >::~unique_ptr (this=0x3093868,
   __in_chrg=<optimized out>) at /opt/rh/devtoolset-6/root/usr/include/c++/6.3.1/bits/unique_ptr.h:239
#13 0x00007fffe181d545 in renderer::MasterRenderer::Impl::~Impl (this=0x3093820, __in_chrg=<optimized out>)
   at /disk1/john/dev/gafferDependencies/Appleseed/working/appleseed-2.1.0-beta/src/appleseed/renderer/kernel/rendering/masterrenderer.cpp:168
#14 0x00007fffe181cfdb in renderer::MasterRenderer::~MasterRenderer (this=0x3088d70, __in_chrg=<optimized out>)
   at /disk1/john/dev/gafferDependencies/Appleseed/working/appleseed-2.1.0-beta/src/appleseed/renderer/kernel/rendering/masterrenderer.cpp:584
#15 0x00007fffc67d0ae0 in (anonymous namespace)::AppleseedRenderer::~AppleseedRenderer() () from /disk1/john/dev/build/gaffer/lib/libGafferAppleseed.so
#16 0x00007fffd8a734b6 in GafferScene::InteractiveRender::stop() () from /disk1/john/dev/build/gaffer/lib/libGafferScene.so
#17 0x00007fffd8a735bf in GafferScene::InteractiveRender::update() () from /disk1/john/dev/build/gaffer/lib/libGafferScene.so
```
johnhaddon added a commit that referenced this pull request Feb 20, 2024
This could be reproduced in Gaffer as follows :

1. Create an Arnold spotlight.
2. Connect a ShaderAssignment below it.
3. Focus the ShaderAssignment.
4. Enable the LightTool.
5. Delete the ShaderAssignment.

The stacktrace looked like this :

<details>

```
#0  0x00007fff7e2dba50 in GafferSceneUI::Private::Inspector::Result::value() const () from /home/john/dev/build/gaffer-1.4/lib/libGafferSceneUI.so
#1  0x00007fff7e308a3c in float const GafferSceneUI::Private::Inspector::Result::typedValue<float>(float const&) const () from /home/john/dev/build/gaffer-1.4/lib/libGafferSceneUI.so
#2  0x00007fff7e2f4ec7 in (anonymous namespace)::SpotLightHandle::handleAngles() const () from /home/john/dev/build/gaffer-1.4/lib/libGafferSceneUI.so
#3  0x00007fff7e2fe8d2 in (anonymous namespace)::SpotLightHandle::addHandleVisualisation(IECoreGL::Group*, bool, bool) const () from /home/john/dev/build/gaffer-1.4/lib/libGafferSceneUI.so
#4  0x00007fff7e2fcacd in (anonymous namespace)::LightToolHandle::renderHandle(GafferUI::Style const*, GafferUI::Style::State) const () from /home/john/dev/build/gaffer-1.4/lib/libGafferSceneUI.so
#5  0x00007fffe2b8d7c3 in GafferUI::Handle::renderLayer(GafferUI::Gadget::Layer, GafferUI::Style const*, GafferUI::Gadget::RenderReason) const () from /home/john/dev/build/gaffer-1.4/lib/libGafferUI.so
#6  0x00007fffe2c0e790 in GafferUI::ViewportGadget::renderLayerInternal(GafferUI::Gadget::RenderReason, GafferUI::Gadget::Layer, Imath_3_1::Matrix44<float> const&, Imath_3_1::Box<Imath_3_1::Vec3<float> > const&, IECoreGL::Selector*) const () from /home/john/dev/build/gaffer-1.4/lib/libGafferUI.so
#7  0x00007fffe2c1543c in GafferUI::ViewportGadget::renderInternal(GafferUI::Gadget::RenderReason, GafferUI::Gadget::Layer) const () from /home/john/dev/build/gaffer-1.4/lib/libGafferUI.so
#8  0x00007fffe2c16728 in GafferUI::ViewportGadget::render() const () from /home/john/dev/build/gaffer-1.4/lib/libGafferUI.so
```

</details>

The main cause was that `LightTool::updateHandleInspections()` was skipping the updates when there was no input scene, which meant the handles were left in a visible state when they should have been hidden. This in turn led to them querying inspectors that returned `null` results unexpectedly on the next render, because they were still connected to the now-deleted scene. This is fixed by removing the early out in `updateHandleInspections()` so that we update the inspectors (in this case, clearing them).

But we can also go further. There is no need to pass a separate scene and context to `LightToolHandle::updateHandlePath()`, because those are both accessible already via the `SceneView` it was passed on construction. So we tidy that up so we always get them from the SceneView, make the `scene()` and `handlePath()` accessors protected as per the existing todo, and remove the `context()` accessor because it is barely used.

The general principle here is that it's easier if UI components don't worry about whether or not something is connected to the ScenePlug or ImagePlugs inputs. There's no real difference between the empty scene from an unconnected input or the empty scene from a connected input that happens to output an empty scene. We're not yet consistent about this everywhere, but that's the direction we're moving in.

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Tue Feb 20 11:59:56 2024 +0000
#
# On branch lightToolCrashFix
# Changes to be committed:
#	modified:   python/GafferSceneUITest/LightToolTest.py
#	modified:   src/GafferSceneUI/LightTool.cpp
#
# Changes not staged for commit:
#	modified:   Changes.md
#
# Untracked files:
#	bits/
#	t.py
#

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Tue Feb 20 11:59:56 2024 +0000
#
# On branch lightToolCrashFix
# Changes to be committed:
#	modified:   Changes.md
#	modified:   python/GafferSceneUITest/LightToolTest.py
#	modified:   src/GafferSceneUI/LightTool.cpp
#
# Untracked files:
#	bits/
#	t.py
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant