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

More light handles #5483

Merged
merged 9 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
1.3.x.x (relative to 1.3.5.0)
=======

Features
--------

- LightTool :
- Added manipulator for disk and point light radii.
- Added manipulators for cylinder length and radius.

Improvements
------------

- LightTool : Changed spot light and quad light edge tool tip locations so that they follow the cone and edge during drag.

Fixes
-----

- Windows : Fixed a bug preventing anything except strings from being copied and pasted.


1.3.5.0 (relative to 1.3.4.0)
=======

Expand Down
8 changes: 8 additions & 0 deletions include/GafferSceneUI/Private/Inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ class GAFFERSCENEUI_API Inspector::Result : public IECore::RefCounted

/// The inspected value that should be displayed by the UI.
const IECore::Object *value() const;
/// The inspected value cast to its native type. If the inspected
/// value is not of the requested type, the given default value
/// will be returned.
template<typename T>
const T typedValue( const T &defaultValue ) const;

/// The plug that was used to author the current value, or null if
/// it cannot be determined.
Gaffer::ValuePlug *source() const;
Expand Down Expand Up @@ -346,3 +352,5 @@ class GAFFERSCENEUI_API Inspector::Result : public IECore::RefCounted
} // namespace Private

} // namespace GafferSceneUI

#include "GafferSceneUI/Private/Inspector.inl"
61 changes: 61 additions & 0 deletions include/GafferSceneUI/Private/Inspector.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2023, Cinesite VFX Ltd. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above
// copyright notice, this list of conditions and the following
// disclaimer.
//
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided with
// the distribution.
//
// * Neither the name of John Haddon nor the names of
// any other contributors to this software may be used to endorse or
// promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////

#pragma once

#include "IECore/RunTimeTyped.h"
#include "IECore/SimpleTypedData.h"

namespace GafferSceneUI
{

namespace Private
{

template<typename T>
const T Inspector::Result::typedValue( const T &defaultValue ) const
{
if( auto valueData = IECore::runTimeCast<const IECore::TypedData<T>>( value() ) )
{
return valueData->readable();
}

return defaultValue;
}

} // namespace Private

} // namespace GafferScene
Loading
Loading