Skip to content

Commit 3ea584c

Browse files
authored
Merge pull request #1312 from ImageEngine/tmp-10.3
Merge branch 'RB-10.3' into 'RB-10.4'
2 parents ab584f2 + 55a10fa commit 3ea584c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2370
-61
lines changed

Changes

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
10.4.x.x (relative to 10.4.2.1)
22
========
33

4+
Features
5+
--------
6+
7+
- IECoreNuke : Add LiveScene support for Nuke (#1310).
8+
- LiveSceneKnob : Knob to interface with LiveScene from Python.
9+
- LiveSceneHolder : Node to hold LiveSceneKnob to provide a Python interface with LiveScene.
10+
- IECoreMaya : Add non-drawable `ieSceneShapeProxy` subclassed from `ieSceneShape` (#1311).
11+
412
Improvements
513
------------
614

715
- Added string constructor and static `fromString` function to `IECore.MurmurHash`.
816

17+
Fixes
18+
-----
19+
20+
- IECoreUSD : Fixed error in `pluginfo.json` preventing USD on Windows from loading `IECoreUSD.dll`.
21+
922
Build
1023
-----
1124

@@ -121,6 +134,22 @@ Build
121134

122135
- Updated IE options file to support Nuke 13.x custom dependencies (#1263).
123136

137+
10.3.8.0 (relative to 10.3.7.2)
138+
========
139+
140+
Features
141+
--------
142+
143+
- IECoreNuke : Add LiveScene support for Nuke (#1310).
144+
- LiveSceneKnob : Knob to interface with LiveScene from Python.
145+
- LiveSceneHolder : Node to hold LiveSceneKnob to provide a Python interface with LiveScene.
146+
- IECoreMaya : Add non-drawable `ieSceneShapeProxy` subclassed from `ieSceneShape` (#1311).
147+
148+
Fixes
149+
-----
150+
151+
- IECoreUSD : Fixed error in `pluginfo.json` preventing USD on Windows from loading `IECoreUSD.dll`.
152+
124153
10.3.7.2 (relative to 10.3.7.1)
125154
========
126155

SConstruct

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,7 +2691,7 @@ if doConfigure :
26912691
nukePythonSources = sorted( glob.glob( "src/IECoreNuke/bindings/*.cpp" ) )
26922692
nukePythonScripts = glob.glob( "python/IECoreNuke/*.py" )
26932693
nukePluginSources = sorted( glob.glob( "src/IECoreNuke/plugin/*.cpp" ) )
2694-
nukeNodeNames = [ "ieObject", "ieOp", "ieDrawable", "ieDisplay" ]
2694+
nukeNodeNames = [ "ieObject", "ieOp", "ieDrawable", "ieDisplay", "ieLiveScene", "sccWriter" ]
26952695

26962696
# nuke library
26972697
nukeLibrary = nukeEnv.SharedLibrary( "lib/" + os.path.basename( nukeEnv.subst( "$INSTALL_NUKELIB_NAME" ) ), nukeSources )
@@ -2751,7 +2751,12 @@ if doConfigure :
27512751
for nodeName in nukeNodeNames :
27522752

27532753
nukeStubEnv = nukePluginEnv.Clone( IECORE_NAME=nodeName )
2754-
nukeStubName = "plugins/nuke/" + os.path.basename( nukeStubEnv.subst( "$INSTALL_NUKEPLUGIN_NAME" ) ) + ".tcl"
2754+
# In order to have our custom file format (scc) displayed in the file_type knob of the WriteGeo node, we need to install
2755+
# a dummy library with "[fileExtension]Writer"
2756+
if nodeName == "sccWriter":
2757+
nukeStubName = "plugins/nuke/" + os.path.basename( nukeStubEnv.subst( "$INSTALL_NUKEPLUGIN_NAME$SHLIBSUFFIX" ) )
2758+
else:
2759+
nukeStubName = "plugins/nuke/" + os.path.basename( nukeStubEnv.subst( "$INSTALL_NUKEPLUGIN_NAME" ) ) + ".tcl"
27552760
nukeStub = nukePluginEnv.Command( nukeStubName, nukePlugin, "echo 'load ieCore' > $TARGET" )
27562761
nukeStubInstall = nukeStubEnv.Install( os.path.dirname( nukeStubEnv.subst( "$INSTALL_NUKEPLUGIN_NAME" ) ), nukeStub )
27572762
nukeStubEnv.Alias( "install", nukeStubInstall )
@@ -3130,7 +3135,7 @@ if doConfigure :
31303135
"!IECOREUSD_RELATIVE_LIB_FOLDER!" : os.path.relpath(
31313136
usdLibraryInstall[0].get_path(),
31323137
os.path.dirname( usdEnv.subst( "$INSTALL_USD_RESOURCE_DIR/IECoreUSD/plugInfo.json" ) )
3133-
).format( "\\", "\\\\" ),
3138+
).replace( "\\", "\\\\" ),
31343139
}
31353140
)
31363141
usdEnv.AddPostAction( "$INSTALL_USD_RESOURCE_DIR/IECoreUSD", lambda target, source, env : makeSymLinks( usdEnv, usdEnv["INSTALL_USD_RESOURCE_DIR"] ) )

include/IECoreMaya/MayaTypeIds.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ enum MayaTypeId
6767
GeometryCombinerId = 0x00110DD2,
6868
SceneShapeId = 0x00110DD3,
6969
SceneShapeInterfaceId = 0x00110DD4,
70+
SceneShapeProxyId = 0x00110DD5,
7071
/// Don't forget to update MayaTypeIdsBinding.cpp
7172

7273
LastId = 0x00110E3F,
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
//////////////////////////////////////////////////////////////////////////
2+
//
3+
// Copyright (c) 2022, Image Engine Design Inc. All rights reserved.
4+
//
5+
// Redistribution and use in source and binary forms, with or without
6+
// modification, are permitted provided that the following conditions are
7+
// met:
8+
//
9+
// * Redistributions of source code must retain the above copyright
10+
// notice, this list of conditions and the following disclaimer.
11+
//
12+
// * Redistributions in binary form must reproduce the above copyright
13+
// notice, this list of conditions and the following disclaimer in the
14+
// documentation and/or other materials provided with the distribution.
15+
//
16+
// * Neither the name of Image Engine Design nor the names of any
17+
// other contributors to this software may be used to endorse or
18+
// promote products derived from this software without specific prior
19+
// written permission.
20+
//
21+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22+
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23+
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
//
33+
//////////////////////////////////////////////////////////////////////////
34+
35+
#ifndef IE_COREMAYA_SCENESHAPEPROXY_H
36+
#define IE_COREMAYA_SCENESHAPEPROXY_H
37+
38+
#include "IECoreMaya/SceneShape.h"
39+
40+
namespace IECoreMaya
41+
{
42+
43+
/// A proxy derived from the SceneShape which exposes the same functionality as the base clase
44+
/// with the exception, that we never register it as a maya SubSceneOverride. The reasoning
45+
/// behind this is that the SubSceneOverride does not take into account the visibility state of the shape.
46+
/// During an update loop of the SubSceneOverride, all SceneShapes will be queried for their update state,
47+
/// regardless their visibility in the scene. This query is slow and we get a huge drop in performance
48+
/// when having a huge amount of SceneShapes in the scene.
49+
/// This is considered to be a bug in the ViewPort 2 API. Our attempts to rewrite the code to use
50+
/// "MPxGeometryOverride" or "MPxDrawOverride" prove themselves as unstable or not suitable for our
51+
/// use case, why we decided to use this "hackery" and not register a proxy of the SceneShape for
52+
/// drawing at all
53+
class IECOREMAYA_API SceneShapeProxy : public SceneShape
54+
{
55+
public :
56+
57+
SceneShapeProxy();
58+
virtual ~SceneShapeProxy();
59+
60+
static void *creator();
61+
static MStatus initialize();
62+
static MTypeId id;
63+
};
64+
65+
}
66+
67+
#endif // IE_COREMAYA_SCENESHAPEPROXY_H
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//////////////////////////////////////////////////////////////////////////
2+
//
3+
// Copyright (c) 2022, Image Engine Design Inc. All rights reserved.
4+
//
5+
// Redistribution and use in source and binary forms, with or without
6+
// modification, are permitted provided that the following conditions are
7+
// met:
8+
//
9+
// * Redistributions of source code must retain the above copyright
10+
// notice, this list of conditions and the following disclaimer.
11+
//
12+
// * Redistributions in binary form must reproduce the above copyright
13+
// notice, this list of conditions and the following disclaimer in the
14+
// documentation and/or other materials provided with the distribution.
15+
//
16+
// * Neither the name of Image Engine Design nor the names of any
17+
// other contributors to this software may be used to endorse or
18+
// promote products derived from this software without specific prior
19+
// written permission.
20+
//
21+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22+
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23+
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
//
33+
//////////////////////////////////////////////////////////////////////////
34+
35+
#ifndef IECOREMAYA_SCENESHAPEPROXYUI_H
36+
#define IECOREMAYA_SCENESHAPEPROXYUI_H
37+
38+
#include "maya/MPxSurfaceShapeUI.h"
39+
#include "maya/MTypes.h"
40+
#include "IECoreMaya/Export.h"
41+
42+
namespace IECoreMaya
43+
{
44+
45+
/// The SceneShapeProxyUI is required for the registration of the SceneShapeProxy and we just make it a NoOp
46+
/// TODO: It might be worth to see if the SceneShapeUI has any dependencies on the drawing capabilities of the
47+
/// shape and if that's not the case, register SceneShapeProxy with the original implementation of SceneShapeUI
48+
class IECOREMAYA_API SceneShapeProxyUI : public MPxSurfaceShapeUI
49+
{
50+
51+
public :
52+
53+
SceneShapeProxyUI();
54+
static void *creator();
55+
};
56+
57+
} // namespace IECoreMaya
58+
59+
#endif // IECOREMAYA_SCENESHAPEPROXYUI_H

include/IECoreNuke/Convert.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,21 @@ IECORENUKE_API Imath::M44f convert( const DD::Image::Matrix4 &from );
114114
template<>
115115
IECORENUKE_API Imath::M44d convert( const DD::Image::Matrix4 &from );
116116

117+
template<>
118+
IECORENUKE_API DD::Image::Matrix4 convert( const Imath::M44d &from );
119+
117120
template<>
118121
IECORENUKE_API Imath::Box2i convert( const DD::Image::Box &from );
119122

120123
template<>
121124
IECORENUKE_API DD::Image::Box3 convert( const Imath::Box3f &from );
122125

126+
template<>
127+
IECORENUKE_API Imath::Box3f convert( const DD::Image::Box3 &from );
128+
129+
template<>
130+
IECORENUKE_API Imath::Box3d convert( const DD::Image::Box3 &from );
131+
123132
} // namespace IECore
124133

125134
#endif // IECORENUKE_CONVERT_H

include/IECoreNuke/LiveScene.h

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
//////////////////////////////////////////////////////////////////////////
2+
//
3+
// Copyright (c) 2022, Image Engine Design Inc. All rights reserved.
4+
//
5+
// Redistribution and use in source and binary forms, with or without
6+
// modification, are permitted provided that the following conditions are
7+
// met:
8+
//
9+
// * Redistributions of source code must retain the above copyright
10+
// notice, this list of conditions and the following disclaimer.
11+
//
12+
// * Redistributions in binary form must reproduce the above copyright
13+
// notice, this list of conditions and the following disclaimer in the
14+
// documentation and/or other materials provided with the distribution.
15+
//
16+
// * Neither the name of Image Engine Design nor the names of any
17+
// other contributors to this software may be used to endorse or
18+
// promote products derived from this software without specific prior
19+
// written permission.
20+
//
21+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22+
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23+
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
//
33+
//////////////////////////////////////////////////////////////////////////
34+
35+
#ifndef IECORENUKE_LIVESCENE_H
36+
#define IECORENUKE_LIVESCENE_H
37+
38+
#include "DDImage/GeoOp.h"
39+
#include "DDImage/GeometryList.h"
40+
41+
#include "IECore/PathMatcher.h"
42+
43+
#include "IECoreScene/SceneInterface.h"
44+
45+
#include "IECoreNuke/Export.h"
46+
#include "IECoreNuke/TypeIds.h"
47+
48+
namespace IECoreNuke
49+
{
50+
51+
IE_CORE_FORWARDDECLARE( LiveScene );
52+
53+
/// A read-only class for representing a live Nuke scene as an IECore::SceneInterface
54+
class IECORENUKE_API LiveScene : public IECoreScene::SceneInterface
55+
{
56+
public :
57+
58+
static const std::string& nameAttribute;
59+
60+
IE_CORE_DECLARERUNTIMETYPEDEXTENSION( LiveScene, LiveSceneTypeId, IECoreScene::SceneInterface );
61+
62+
LiveScene();
63+
LiveScene( DD::Image::GeoOp *op, const std::string rootPath="/" );
64+
65+
~LiveScene() override;
66+
67+
std::string fileName() const override;
68+
69+
Name name() const override;
70+
void path( Path &p ) const override;
71+
72+
Imath::Box3d readBound( double time ) const override;
73+
void writeBound( const Imath::Box3d &bound, double time );
74+
75+
IECore::ConstDataPtr readTransform( double time ) const override;
76+
Imath::M44d readTransformAsMatrix( double time ) const override;
77+
IECore::ConstDataPtr readWorldTransform( double time ) const;
78+
Imath::M44d readWorldTransformAsMatrix( double time ) const;
79+
void writeTransform( const IECore::Data *transform, double time ) override;
80+
81+
bool hasAttribute( const Name &name ) const override;
82+
void attributeNames( NameList &attrs ) const override;
83+
IECore::ConstObjectPtr readAttribute( const Name &name, double time ) const override;
84+
void writeAttribute( const Name &name, const IECore::Object *attribute, double time ) override;
85+
86+
bool hasTag( const Name &name, int filter = SceneInterface::LocalTag ) const override;
87+
void readTags( NameList &tags, int filter = SceneInterface::LocalTag ) const override;
88+
void writeTags( const NameList &tags ) override;
89+
90+
NameList setNames( bool includeDescendantSets = true ) const override;
91+
IECore::PathMatcher readSet( const Name &name, bool includeDescendantSets = true, const IECore::Canceller *canceller = nullptr ) const override;
92+
void writeSet( const Name &name, const IECore::PathMatcher &set ) override;
93+
void hashSet( const Name& setName, IECore::MurmurHash &h ) const override;
94+
95+
bool hasObject() const override;
96+
IECore::ConstObjectPtr readObject( double time, const IECore::Canceller *canceller = nullptr ) const override;
97+
IECoreScene::PrimitiveVariableMap readObjectPrimitiveVariables( const std::vector<IECore::InternedString> &primVarNames, double time ) const override;
98+
void writeObject( const IECore::Object *object, double time ) override;
99+
100+
void childNames( NameList &childNames ) const override;
101+
bool hasChild( const Name &name ) const override;
102+
IECoreScene::SceneInterfacePtr child( const Name &name, MissingBehaviour missingBehaviour = SceneInterface::ThrowIfMissing ) override;
103+
IECoreScene::ConstSceneInterfacePtr child( const Name &name, MissingBehaviour missingBehaviour = SceneInterface::ThrowIfMissing ) const override;
104+
IECoreScene::SceneInterfacePtr createChild( const Name &name ) override;
105+
106+
IECoreScene::SceneInterfacePtr scene( const Path &path, MissingBehaviour missingBehaviour = SceneInterface::ThrowIfMissing ) override;
107+
IECoreScene::ConstSceneInterfacePtr scene( const Path &path, MissingBehaviour missingBehaviour = SceneInterface::ThrowIfMissing ) const override;
108+
109+
void hash( HashType hashType, double time, IECore::MurmurHash &h ) const override;
110+
111+
static double timeToFrame( const double& time );
112+
static double frameToTime( const int& frame );
113+
114+
private:
115+
116+
DD::Image::GeoOp *op() const;
117+
DD::Image::GeometryList geometryList( const double* time=nullptr ) const;
118+
119+
std::string geoInfoPath( const int& index ) const;
120+
121+
DD::Image::GeoOp *m_op;
122+
std::string m_rootPath;
123+
IECore::PathMatcher m_pathMatcher;
124+
typedef std::map<unsigned, std::string> objectPathMap;
125+
mutable objectPathMap m_objectPathMap;
126+
};
127+
128+
IE_CORE_DECLAREPTR( LiveScene );
129+
130+
} // namespace IECoreNuke
131+
132+
#endif // IECORENUKE_LIVESCENE_H

0 commit comments

Comments
 (0)