Skip to content

Commit 896b644

Browse files
committed
IECoreHoudini : Remove SOP_ProceduralHolder
1 parent 010ab09 commit 896b644

32 files changed

+3
-2606
lines changed

Diff for: SConstruct

-1
Original file line numberDiff line numberDiff line change
@@ -2445,7 +2445,6 @@ if doConfigure :
24452445
houdiniTestEnv["ENV"]["HOUDINI_OTLSCAN_PATH"] = "./plugins/houdini:&"
24462446

24472447
houdiniTestEnv["ENV"]["IECORE_OP_PATHS"] = "./test/IECoreHoudini/ops"
2448-
houdiniTestEnv["ENV"]["IECORE_PROCEDURAL_PATHS"] = "./test/IECoreHoudini/procedurals"
24492448

24502449
houdiniPythonExecutable = "hython"
24512450

Diff for: include/IECoreHoudini/GEO_CortexPrimitive.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ class GEO_CortexPrimitive : public GEO_Primitive
143143
virtual int intersectRay( const UT_Vector3 &o, const UT_Vector3 &d, float tmax=1E17F, float tol=1E-12F, float *distance=0, UT_Vector3 *pos=0, UT_Vector3 *nml=0, int accurate=0, float *u=0, float *v=0, int ignoretrim=1 ) const;
144144

145145
/// Set the IECore::Object contained by this GEO_Primitive. Note that in most situations
146-
/// this method takes a copy of the object. However, for ParameterisedProcedurals it does
147-
/// not, and it is the users responsibility to treat the contained object as const.
146+
/// this method takes a copy of the object.
148147
void setObject( const IECore::Object *object );
149148
/// Get the IECore::Object contained by this GEO_Primitive
150149
const IECore::Object *getObject() const;

Diff for: include/IECoreHoudini/SOP_ProceduralHolder.h

-87
This file was deleted.

Diff for: menus/IECoreHoudini/cortex.shelf

-10
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@
1111
soptoolutils.genericTool(kwargs, 'ieOpHolder')]]></script>
1212
</tool>
1313

14-
<!-- Cortex Procedural Holder -->
15-
<tool name="cortex_procedural_holder" label="Cortex Procedural" icon="SOP_ieProceduralHolder">
16-
<toolMenuContext name="network">
17-
<contextNetType>SOP</contextNetType>
18-
</toolMenuContext>
19-
<toolSubmenu>Cortex</toolSubmenu>
20-
<script scriptType="python"><![CDATA[import soptoolutils
21-
soptoolutils.genericTool(kwargs, 'ieProceduralHolder')]]></script>
22-
</tool>
23-
2414
<!-- Cortex To Houdini Converter -->
2515
<tool name="cortex_converter" label="Cortex Convert" icon="SOP_ieToHoudiniConverter">
2616
<toolMenuContext name="network">

Diff for: python/IECoreHoudini/FnProceduralHolder.py

-61
This file was deleted.

Diff for: python/IECoreHoudini/Utils.py

-41
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
python module.
4141
'''
4242

43-
# returns an instance of a procedural loaded using the defaultProceduralLoader
44-
def proc(type, ver):
45-
return IECore.ClassLoader.defaultProceduralLoader().load(type,ver)()
46-
4743
# returns an instance of an op loaded using the defaultOpLoader
4844
def op(type, ver):
4945
return IECore.ClassLoader.defaultOpLoader().load(type,ver)()
@@ -126,51 +122,14 @@ def setHoudiniParm( node, p ):
126122
if p.typeId()==IECore.TypeId.Box3dParameter:
127123
node.parmTuple( "parm_%s" % p.name ).set( list(value) )
128124

129-
# updates all the houdini parameters based on an Op/Procedural's parameter values
130-
def syncSopParametersWithProcedural(n):
131-
fn = IECoreHoudini.FnProceduralHolder( n )
132-
parms = fn.getParameterised().parameters().values()
133-
for p in parms:
134-
if n.parm("parm_%s"%p.name):
135-
setHoudiniParm( n, p )
136-
137125
def syncSopParametersWithOp(n):
138126
fn = IECoreHoudini.FnOpHolder( n )
139127
parms = fn.getParameterised().parameters().values()
140128
for p in parms:
141129
if n.parm("parm_%s"%p.name):
142130
setHoudiniParm( n, p )
143131

144-
# reloads a procedural based on the values of the type/version parameters
145-
# \todo: this can be combined with the reloadOp code
146-
def reloadProcedural():
147-
n = hou.node(".")
148-
type = n.evalParm("__opType")
149-
ver = n.evalParm("__opVersion")
150-
if type=="" or ver=="":
151-
return
152-
ver = int(ver)
153-
fn = IECoreHoudini.FnProceduralHolder(n)
154-
IECore.ClassLoader.defaultProceduralLoader().refresh()
155-
cl = IECoreHoudini.proc( type, ver )
156-
157-
# cache our existing parameters
158-
parms = fn.getParameterised().parameters().values()
159-
saved_parms = {}
160-
for p in parms:
161-
saved_parms[p.name] = p.getValue().value
162-
163-
# reload parameter interface
164-
fn.setParameterised(cl)
165-
166-
# restore parameter values
167-
for p in saved_parms.keys():
168-
hparm = n.parm("parm_%s" % p)
169-
if hparm:
170-
hparm.set( saved_parms[p] )
171-
172132
# reloads an op based on the values of the type/version parameters
173-
# \todo: this can be combined with the reloadProc code
174133
def reloadOp():
175134
n = hou.node(".")
176135
type = n.evalParm("__opType")

Diff for: python/IECoreHoudini/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
# function sets
4848
from FnParameterisedHolder import FnParameterisedHolder
4949
from FnOpHolder import FnOpHolder
50-
from FnProceduralHolder import FnProceduralHolder
5150

5251
# misc utility methods
5352
from TestCase import TestCase

Diff for: src/IECoreHoudini/FromHoudiniCortexObjectConverter.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include "boost/python.hpp"
3636

3737
#include "IECore/CompoundObject.h"
38-
#include "IECoreScene/ParameterisedProcedural.h"
3938

4039
#include "IECoreHoudini/FromHoudiniCortexObjectConverter.h"
4140
#include "IECoreHoudini/GEO_CortexPrimitive.h"
@@ -111,11 +110,6 @@ ObjectPtr FromHoudiniCortexObjectConverter::doDetailConversion( const GU_Detail
111110

112111
if ( object )
113112
{
114-
if ( object->isInstanceOf( IECoreScene::ParameterisedProcedural::staticTypeId() ) )
115-
{
116-
return boost::const_pointer_cast<IECore::Object>( object );
117-
}
118-
119113
return object->copy();
120114
}
121115

Diff for: src/IECoreHoudini/GEO_CortexPrimitive.cpp

+2-10
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
#include "IECoreScene/CoordinateSystem.h"
5252
#include "IECoreScene/Group.h"
5353
#include "IECoreScene/MatrixTransform.h"
54-
#include "IECoreScene/ParameterisedProcedural.h"
5554
#include "IECoreScene/Primitive.h"
5655
#include "IECoreScene/TransformOp.h"
5756
#include "IECoreScene/VisibleRenderable.h"
@@ -400,15 +399,8 @@ const IECore::Object *GEO_CortexPrimitive::getObject() const
400399

401400
void GEO_CortexPrimitive::setObject( const IECore::Object *object )
402401
{
403-
if ( object->isInstanceOf( IECoreScene::ParameterisedProcedural::staticTypeId() ) )
404-
{
405-
m_object = const_cast<IECore::Object *>( object );
406-
}
407-
else
408-
{
409-
/// \todo: should this be a deep copy?
410-
m_object = object->copy();
411-
}
402+
/// \todo: should this be a deep copy?
403+
m_object = object->copy();
412404
}
413405

414406
const char *GEO_CortexPrimitive::typeName = "CortexObject";

Diff for: src/IECoreHoudini/SOP_CortexConverter.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343

4444
#include "IECoreScene/CapturingRenderer.h"
4545
#include "IECoreScene/Group.h"
46-
#include "IECoreScene/ParameterisedProcedural.h"
4746
#include "IECoreScene/WorldBlock.h"
4847
#include "IECorePython/ScopedGILLock.h"
4948
#include "IECorePython/ScopedGILRelease.h"
@@ -189,25 +188,6 @@ void SOP_CortexConverter::doConvert( const GU_DetailHandle &handle, const std::s
189188
return;
190189
}
191190

192-
if ( IECoreScene::ParameterisedProcedural *procedural = IECore::runTimeCast<IECoreScene::ParameterisedProcedural>( result.get() ) )
193-
{
194-
IECoreScene::CapturingRendererPtr renderer = new IECoreScene::CapturingRenderer();
195-
// We are acquiring and releasing the GIL here to ensure that it is released when we render. This has
196-
// to be done because a procedural might jump between c++ and python a few times (i.e. if it spawns
197-
// subprocedurals that are implemented in python). In a normal call to cookMySop, this wouldn't be an
198-
// issue, but if cookMySop was called from HOM, hou.Node.cook appears to be holding onto the GIL.
199-
IECorePython::ScopedGILLock gilLock;
200-
{
201-
IECorePython::ScopedGILRelease gilRelease;
202-
{
203-
IECoreScene::WorldBlock worldBlock( renderer );
204-
procedural->render( renderer.get() );
205-
}
206-
}
207-
208-
result = boost::const_pointer_cast<IECore::Object>( IECore::runTimeCast<const IECore::Object>( renderer->world() ) );
209-
}
210-
211191
ToHoudiniGeometryConverterPtr converter = ( type == Cortex ) ? new ToHoudiniCortexObjectConverter( result.get() ) : ToHoudiniGeometryConverter::create( result.get() );
212192
converter->nameParameter()->setTypedValue( name );
213193
converter->attributeFilterParameter()->setTypedValue( attributeFilter );

Diff for: src/IECoreHoudini/SOP_ParameterisedHolder.cpp

-21
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include "IECore/Op.h"
4444
#include "IECoreScene/CapturingRenderer.h"
4545
#include "IECoreScene/Group.h"
46-
#include "IECoreScene/ParameterisedProcedural.h"
4746
#include "IECoreScene/WorldBlock.h"
4847

4948
#include "IECorePython/ScopedGILLock.h"
@@ -184,26 +183,6 @@ void SOP_ParameterisedHolder::setInputParameterValue( IECore::Parameter *paramet
184183
{
185184
return;
186185
}
187-
188-
if ( IECoreScene::ParameterisedProcedural *procedural = IECore::runTimeCast<IECoreScene::ParameterisedProcedural>( result.get() ) )
189-
{
190-
IECoreScene::CapturingRendererPtr renderer = new IECoreScene::CapturingRenderer();
191-
// We are acquiring and releasing the GIL here to ensure that it is released when we render. This has
192-
// to be done because a procedural might jump between c++ and python a few times (i.e. if it spawns
193-
// subprocedurals that are implemented in python). In a normal call to cookMySop, this wouldn't be an
194-
// issue, but if cookMySop was called from HOM, hou.Node.cook appears to be holding onto the GIL.
195-
IECorePython::ScopedGILLock gilLock;
196-
{
197-
IECorePython::ScopedGILRelease gilRelease;
198-
{
199-
IECoreScene::WorldBlock worldBlock( renderer );
200-
procedural->render( renderer.get() );
201-
}
202-
}
203-
204-
result = boost::const_pointer_cast<IECore::Object>( IECore::runTimeCast<const IECore::Object>( renderer->world() ) );
205-
}
206-
207186
parameter->setValidatedValue( result );
208187
}
209188
catch ( const IECore::Exception &e )

0 commit comments

Comments
 (0)