Skip to content

Commit

Permalink
Merge pull request #1381 from ImageEngine/tmpRB10.4toRB10.5
Browse files Browse the repository at this point in the history
RB-10.4 to RB-10.5
  • Loading branch information
ivanimanishi authored Jul 21, 2023
2 parents d49d7a5 + 02f4a19 commit 4629329
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 7 deletions.
13 changes: 12 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
10.5.0.0 (relative to 10.4.10.1)
10.5.0.0 (relative to 10.4.10.2)
========

Features
Expand Down Expand Up @@ -40,6 +40,17 @@ Breaking Changes
- Changed function signature.
- Bug fixes mean subtle changes to the resulting points.

10.4.10.2 (relative to 10.4.10.1)
=========

Fixes
-----

- LinkedScene : Fixed bug where `linkLocations` attribute was baked incorrectly if the link target location wasn't the ROOT
- This in turn caused LinkedScene::setNames() and LinkedScene::readSet() to error
- IECoreNuke::FromNukePointsConverter : Use `Color3f` instead of `Color4f` to be compatible with `Gaffer`
- IECoreNuke::SceneCacheReader : Fixed crash with `SceneCacheReader` when widget updates while Caribou updates

10.4.10.1 (relative to 10.4.10.0)
========

Expand Down
4 changes: 2 additions & 2 deletions src/IECoreNuke/FromNukePointsConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ IECore::ObjectPtr FromNukePointsConverter::doConversion( IECore::ConstCompoundOb
const DD::Image::Attribute *colorAttr = m_geo->get_typed_attribute( "Cf", DD::Image::VECTOR4_ATTRIB );
if( colorAttr && colorAttr->size() == result->getNumPoints() )
{
Color4fVectorDataPtr colorData = new Color4fVectorData();
Color3fVectorDataPtr colorData = new Color3fVectorData();
colorData->writable().resize( result->getNumPoints() );
std::transform( colorAttr->vector4_list->begin(), colorAttr->vector4_list->end(), colorData->writable().begin(), IECore::convert<Imath::Color4f, DD::Image::Vector4> );
std::transform( colorAttr->vector4_list->begin(), colorAttr->vector4_list->end(), colorData->writable().begin(), IECore::convert<Imath::Color3f, DD::Image::Vector4> );
result->variables["Cs"] = PrimitiveVariable( PrimitiveVariable::Vertex, colorData );

// Adding a separate alpha primvar as according to my test
Expand Down
7 changes: 6 additions & 1 deletion src/IECoreNuke/SceneCacheReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,12 @@ void SceneCacheReader::filterScene( const std::string &filterText, const std::st
m_data->m_itemToFiltered.clear();

// Set the filtered items.
sceneView->setImportedItems( filteredIndices );
std::vector<unsigned int> currentIndices;
sceneView->getImportedItems( currentIndices );
if( currentIndices != filteredIndices )
{
sceneView->setImportedItems( filteredIndices );
}

// Create a mapping of item indices to filtered indices.
for( std::vector<unsigned int>::const_iterator it( filteredIndices.begin() ); it != filteredIndices.end(); ++it )
Expand Down
1 change: 1 addition & 0 deletions src/IECoreScene/LinkedScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ void LinkedScene::writeAttribute( const Name &name, const Object *attribute, dou
{
throw Exception( "Trying to store a broken link!" );
}
m_rootLinkDepth = linkDepth;

// check for child name clashes:
NameList mainSceneChildren;
Expand Down
21 changes: 18 additions & 3 deletions test/IECoreScene/LinkedSceneTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,26 +1094,41 @@ def testCanReadSetNamesAndMembersOfLinkedScene( self ) :

r = IECoreScene.SceneCache( sceneFile, IECore.IndexedIO.OpenMode.Read )
A = r.child( "A" )
B = A.child( "B" )

# Master scene which contains link to above scene
# C
# D -> [target.scc, /]
# E
# A -> [target.scc, /A]
# F
# A
# B -> [target.scc, /A/B]

sceneFile = os.path.join( self.tempDir, "scene.lscc" )
w = IECoreScene.LinkedScene( sceneFile, IECore.IndexedIO.OpenMode.Write )
C = w.createChild( "C" )
D = C.createChild( "D" )

E = w.createChild( "E" )
A1 = E.createChild( "A" )

F = w.createChild( "F" )
A2 = F.createChild( "A" )
B1 = A2.createChild( "B" )

A1.writeLink( A )
D.writeLink( r )
B1.writeLink( B )

del w, C, D
del w, C, D, E, F, A1, A2, B1

# ok lets read back in our linked scene and try and read the set names
r = IECoreScene.LinkedScene( sceneFile, IECore.IndexedIO.OpenMode.Read )
self.assertEqualUnordered( r.setNames(), ['don', 'stew'] )

self.assertEqual( r.readSet( "don" ), IECore.PathMatcher(['/C/D/A'] ) )
self.assertEqual( r.readSet( "stew" ), IECore.PathMatcher(['/C/D/A/B'] ) )
self.assertEqual( r.readSet( "don" ), IECore.PathMatcher( ['/C/D/A', '/E/A' ] ) )
self.assertEqual( r.readSet( "stew" ), IECore.PathMatcher( ['/C/D/A/B', '/E/A/B', '/F/A/B' ] ) )

self.assertEqualUnordered( r.setNames( includeDescendantSets = False ), [] )

Expand Down

0 comments on commit 4629329

Please sign in to comment.