Help with Instancer in 0.56

201 views
Skip to first unread message

Des

unread,
Mar 26, 2020, 1:42:55 AM3/26/20
to gaffer-dev
Hi!
finaly had some time to dive in gaffer and its awsome :)

Im working out a scatter setup, and have trouble understanding what to do in which order.
in 0.55 i have managed to get points from Seeds and have a grass patch working from examples in help you have provided.
Is there a working example for 0.56? I am also intersted how to work with imported point clouds, coming from clarisse or houdini?

Also a side question: when will the docs be updated for 0.56?

Thanks for any hints! :)



Andrew Kaufman

unread,
Mar 26, 2020, 8:23:33 PM3/26/20
to gaffe...@googlegroups.com
Hi Des

I don't think we have any specific doc/tutorials for the 0.56 Instancer updates yet, but hopefully it should be a fairly smooth transition from your 0.55 setup. We've just renamed the "instances" plugs to "prototypes" and added a few more modes, but the defaults should be backwards compatible.

The new modes are for specifying individual prototypes relative to particular paths within the `prototypes` scene (the right-hand input). We allow 3 different ways to setup these root paths:

- via an explicit list in the NodeEditor
- via a Constant PrimitiveVariable (StringVectorData) on the points
- via a Vertex PrimitiveVariable (StringVectorData) on the points

Note the latter is tricky to setup purely in Gaffer currently, and is better suited to loading points from another DCC (eg Houdini) via Alembic/USD/SCC files.

I've attached an example script with 3 different Instancer setups. My "assets" are quite trivial, but you could have complex hierarchies for each of those.

Cheers,
Andrew

PS. I'm not sure why the hosted docs are lagging right now, but if you have 0.56 installed it comes with a local version of the docs in $GAFFER_ROOT/doc/gaffer/html/index.html


--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gaffer-dev/608e672c-ee82-4de9-a506-f23c7c5b76e2%40googlegroups.com.


--
Andrew Kaufman - R&D Lead
Image Engine
studio: +1-604-874-5634 | and...@image-engine.com | www.image-engine.com



15 West 5th Avenue, Vancouver, BC, V5Y 1H4, Canada

If you are not the intended recipient, disclosure, copying, distribution and use of this email is prohibited. Please notify us immediately and delete this email from your systems. You may contact us at in...@image-engine.com if you do not wish to receive further commercial electronic messages. We may still send you messages for which we do not require consent.

instancerDemo.gfr

Des

unread,
Mar 27, 2020, 2:09:15 AM3/27/20
to gaffer-dev
Thank you, gona dive into in right now! i love gaffer!


On Friday, March 27, 2020 at 1:23:33 AM UTC+1, andrewk wrote:
Hi Des

I don't think we have any specific doc/tutorials for the 0.56 Instancer updates yet, but hopefully it should be a fairly smooth transition from your 0.55 setup. We've just renamed the "instances" plugs to "prototypes" and added a few more modes, but the defaults should be backwards compatible.

The new modes are for specifying individual prototypes relative to particular paths within the `prototypes` scene (the right-hand input). We allow 3 different ways to setup these root paths:

- via an explicit list in the NodeEditor
- via a Constant PrimitiveVariable (StringVectorData) on the points
- via a Vertex PrimitiveVariable (StringVectorData) on the points

Note the latter is tricky to setup purely in Gaffer currently, and is better suited to loading points from another DCC (eg Houdini) via Alembic/USD/SCC files.

I've attached an example script with 3 different Instancer setups. My "assets" are quite trivial, but you could have complex hierarchies for each of those.
Cheers,
Andrew

PS. I'm not sure why the hosted docs are lagging right now, but if you have 0.56 installed it comes with a local version of the docs in $GAFFER_ROOT/doc/gaffer/html/index.html


Ok, this is a great tip, lots to learn!
New questions incoming! :)

John Haddon

unread,
Mar 27, 2020, 4:36:55 AM3/27/20
to gaffe...@googlegroups.com
On Thu, 26 Mar 2020 at 05:42, Des <crni...@gmail.com> wrote:
Also a side question: when will the docs be updated for 0.56?

I've just updated https://www.gafferhq.org/documentation/ with the docs for 0.56.1.0.
Cheers...
John 

William Eguienta

unread,
Apr 13, 2020, 5:59:18 AM4/13/20
to gaffer-dev
Hi,
I try to instance objects after a collectScene node but this make gaffer 0.57.0 crashing immediatly,
do I miss something ?
here is a scene to reproduce the crash


import Gaffer
import GafferDispatch
import GafferScene
import IECore
import imath

Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 57, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 0, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False )

__children
= {}

__children
["Char_reader"] = GafferScene.SceneReader( "Char_reader" )
parent
.addChild( __children["Char_reader"] )
__children
["Char_reader"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["CollectScenes3"] = GafferScene.CollectScenes( "CollectScenes3" )
parent
.addChild( __children["CollectScenes3"] )
__children
["CollectScenes3"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["asset_Variables"] = Gaffer.ContextVariables( "asset_Variables" )
parent
.addChild( __children["asset_Variables"] )
__children
["asset_Variables"].setup( GafferScene.ScenePlug( "in", ) )
__children
["asset_Variables"]["variables"].addChild( Gaffer.NameValuePlug( "", Gaffer.StringPlug( "value", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), True, "member2", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
__children
["asset_Variables"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["Instancer"] = GafferScene.Instancer( "Instancer" )
parent
.addChild( __children["Instancer"] )
__children
["Instancer"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["PathFilter7"] = GafferScene.PathFilter( "PathFilter7" )
parent
.addChild( __children["PathFilter7"] )
__children
["PathFilter7"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["FreezeTransform"] = GafferScene.FreezeTransform( "FreezeTransform" )
parent
.addChild( __children["FreezeTransform"] )
__children
["FreezeTransform"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["PrimitiveVariables1"] = GafferScene.PrimitiveVariables( "PrimitiveVariables1" )
parent
.addChild( __children["PrimitiveVariables1"] )
__children
["PrimitiveVariables1"]["primitiveVariables"].addChild( Gaffer.NameValuePlug( "", Gaffer.StringVectorDataPlug( "value", defaultValue = IECore.StringVectorData( [  ] ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), True, "member1", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
__children
["PrimitiveVariables1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["MeshToPoints"] = GafferScene.MeshToPoints( "MeshToPoints" )
parent
.addChild( __children["MeshToPoints"] )
__children
["MeshToPoints"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["Prune"] = GafferScene.Prune( "Prune" )
parent
.addChild( __children["Prune"] )
__children
["Prune"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["Parent1"] = GafferScene.Parent( "Parent1" )
parent
.addChild( __children["Parent1"] )
__children
["Parent1"]["children"].addChild( GafferScene.ScenePlug( "child1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["Parent1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["SubTree"] = GafferScene.SubTree( "SubTree" )
parent
.addChild( __children["SubTree"] )
__children
["SubTree"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["Prune1"] = GafferScene.Prune( "Prune1" )
parent
.addChild( __children["Prune1"] )
__children
["Prune1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["PathFilter9"] = GafferScene.PathFilter( "PathFilter9" )
parent
.addChild( __children["PathFilter9"] )
__children
["PathFilter9"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["Dot"] = Gaffer.Dot( "Dot" )
parent
.addChild( __children["Dot"] )
__children
["Dot"].setup( GafferScene.FilterPlug( "in", defaultValue = 0, minValue = 0, maxValue = 7, ) )
__children
["Dot"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["char002"] = GafferScene.Sphere( "char002" )
parent
.addChild( __children["char002"] )
__children
["char002"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["char001"] = GafferScene.Cube( "char001" )
parent
.addChild( __children["char001"] )
__children
["char001"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["Backdrop"] = Gaffer.Backdrop( "Backdrop" )
parent
.addChild( __children["Backdrop"] )
__children
["Backdrop"].addChild( Gaffer.Box2fPlug( "__uiBound", defaultValue = imath.Box2f( imath.V2f( -10, -10 ), imath.V2f( 10, 10 ) ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["Backdrop"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["SceneWriter"] = GafferScene.SceneWriter( "SceneWriter" )
parent
.addChild( __children["SceneWriter"] )
__children
["SceneWriter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["SceneWriter1"] = GafferScene.SceneWriter( "SceneWriter1" )
parent
.addChild( __children["SceneWriter1"] )
__children
["SceneWriter1"]["preTasks"].addChild( GafferDispatch.TaskNode.TaskPlug( "preTask1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["SceneWriter1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children
["Char_reader"]["fileName"].setValue( '${ASSET_FILE}' )
__children
["Char_reader"]["refreshCount"].setValue( 3 )
__children
["Char_reader"]["transform"]["translate"].setValue( imath.V3f( 0, 0, -2.47317123 ) )
__children
["Char_reader"]["transform"]["rotate"].setValue( imath.V3f( 0, 111.221497, 8.65142192e-06 ) )
__children
["Char_reader"]["__uiPosition"].setValue( imath.V2f( 32.7617111, 45.9470444 ) )
__children
["CollectScenes3"]["in"].setInput( __children["asset_Variables"]["out"] )
__children
["CollectScenes3"]["rootNames"].setValue( IECore.StringVectorData( [ 'char001', 'char002' ] ) )
__children
["CollectScenes3"]["rootNameVariable"].setValue( 'collect:asset' )
__children
["CollectScenes3"]["__uiPosition"].setValue( imath.V2f( 32.7617111, 32.1188889 ) )
__children
["asset_Variables"]["variables"]["member2"]["name"].setValue( 'ASSET_FILE' )
__children
["asset_Variables"]["variables"]["member2"]["value"].setValue( '/mnt/test/${collect:asset}/${collect:asset}.abc' )
__children
["asset_Variables"]["in"].setInput( __children["Char_reader"]["out"] )
__children
["asset_Variables"]["__uiPosition"].setValue( imath.V2f( 32.7617111, 40.2829514 ) )
__children
["Instancer"]["in"].setInput( __children["PrimitiveVariables1"]["out"] )
__children
["Instancer"]["filter"].setInput( __children["PathFilter7"]["out"] )
__children
["Instancer"]["name"].setValue( 'Forest' )
__children
["Instancer"]["prototypes"].setInput( __children["Prune"]["out"] )
__children
["Instancer"]["prototypeMode"].setValue( 1 )
__children
["Instancer"]["prototypeIndex"].setValue( 'prototypeIndex' )
__children
["Instancer"]["orientation"].setValue( 'orientation' )
__children
["Instancer"]["scale"].setValue( 'scale' )
__children
["Instancer"]["attributePrefix"].setValue( 'user:' )
__children
["Instancer"]["__uiPosition"].setValue( imath.V2f( -22.3054638, -20.6581974 ) )
__children
["PathFilter7"]["paths"].setValue( IECore.StringVectorData( [ '/char002' ] ) )
__children
["PathFilter7"]["__uiPosition"].setValue( imath.V2f( 11.585803, 15.5728445 ) )
__children
["FreezeTransform"]["in"].setInput( __children["Prune1"]["out"] )
__children
["FreezeTransform"]["filter"].setInput( __children["PathFilter7"]["out"] )
__children
["FreezeTransform"]["__uiPosition"].setValue( imath.V2f( -23.8054638, 10.4319992 ) )
__children
["PrimitiveVariables1"]["in"].setInput( __children["MeshToPoints"]["out"] )
__children
["PrimitiveVariables1"]["filter"].setInput( __children["PathFilter7"]["out"] )
__children
["PrimitiveVariables1"]["primitiveVariables"]["member1"]["name"].setValue( 'prototypeRoots' )
__children
["PrimitiveVariables1"]["primitiveVariables"]["member1"]["value"].setValue( IECore.StringVectorData( [ 'char001' ] ) )
__children
["PrimitiveVariables1"]["__uiPosition"].setValue( imath.V2f( -23.8054638, -5.38184357 ) )
__children
["MeshToPoints"]["in"].setInput( __children["FreezeTransform"]["out"] )
__children
["MeshToPoints"]["filter"].setInput( __children["PathFilter7"]["out"] )
__children
["MeshToPoints"]["adjustBounds"].setValue( False )
__children
["MeshToPoints"]["__uiPosition"].setValue( imath.V2f( -23.8054638, 2.78221893 ) )
__children
["Prune"]["in"].setInput( __children["CollectScenes3"]["out"] )
__children
["Prune"]["filter"].setInput( __children["Dot"]["out"] )
__children
["Prune"]["__uiPosition"].setValue( imath.V2f( 32.92556, -12.4941349 ) )
__children
["Parent1"]["in"].setInput( __children["SubTree"]["out"] )
__children
["Parent1"]["parent"].setValue( '/' )
__children
["Parent1"]["children"][0].setInput( __children["Prune"]["out"] )
__children
["Parent1"]["__uiPosition"].setValue( imath.V2f( 32.17556, -36.9863243 ) )
__children
["SubTree"]["in"].setInput( __children["Instancer"]["out"] )
__children
["SubTree"]["root"].setValue( '/plane' )
__children
["SubTree"]["__uiPosition"].setValue( imath.V2f( -22.3054638, -28.8222599 ) )
__children
["Prune1"]["in"].setInput( __children["CollectScenes3"]["out"] )
__children
["Prune1"]["filter"].setInput( __children["PathFilter9"]["out"] )
__children
["Prune1"]["__uiPosition"].setValue( imath.V2f( -23.8054638, 23.9548244 ) )
__children
["PathFilter9"]["paths"].setValue( IECore.StringVectorData( [ '/char001' ] ) )
__children
["PathFilter9"]["__uiPosition"].setValue( imath.V2f( -16.1084042, 33.0830994 ) )
__children
["Dot"]["in"].setInput( __children["PathFilter7"]["out"] )
__children
["Dot"]["__uiPosition"].setValue( imath.V2f( 40.140213, 8.24081326 ) )
__children
["char002"]["name"].setValue( 'char002' )
__children
["char002"]["__uiPosition"].setValue( imath.V2f( 32.8084335, 76.7085495 ) )
__children
["char001"]["name"].setValue( 'char001' )
__children
["char001"]["__uiPosition"].setValue( imath.V2f( 16.2000465, 76.9924545 ) )
__children
["Backdrop"]["title"].setValue( 'Source geos' )
__children
["Backdrop"]["__uiBound"].setValue( imath.Box2f( imath.V2f( -15.4556446, -24.2406311 ), imath.V2f( 21.4556446, 9.09179688 ) ) )
__children
["Backdrop"]["__uiPosition"].setValue( imath.V2f( 24.0074043, 78.6958771 ) )
__children
["SceneWriter"]["dispatcher"]["deadline"]["pool"].setValue( 'none' )
__children
["SceneWriter"]["dispatcher"]["deadline"]["secondaryPool"].setValue( 'none' )
__children
["SceneWriter"]["dispatcher"]["deadline"]["group"].setValue( 'none' )
__children
["SceneWriter"]["dispatcher"]["deadline"]["onJobComplete"].setValue( 'Nothing' )
__children
["SceneWriter"]["dispatcher"]["deadline"]["dependencyMode"].setValue( 'Auto' )
__children
["SceneWriter"]["in"].setInput( __children["char001"]["out"] )
__children
["SceneWriter"]["fileName"].setValue( '/mnt/test/char001/char001.abc' )
__children
["SceneWriter"]["__uiPosition"].setValue( imath.V2f( 14.7000465, 68.828392 ) )
__children
["SceneWriter1"]["preTasks"][0].setInput( __children["SceneWriter"]["task"] )
__children
["SceneWriter1"]["dispatcher"]["deadline"]["pool"].setValue( 'none' )
__children
["SceneWriter1"]["dispatcher"]["deadline"]["secondaryPool"].setValue( 'none' )
__children
["SceneWriter1"]["dispatcher"]["deadline"]["group"].setValue( 'none' )
__children
["SceneWriter1"]["dispatcher"]["deadline"]["onJobComplete"].setValue( 'Nothing' )
__children
["SceneWriter1"]["dispatcher"]["deadline"]["dependencyMode"].setValue( 'Auto' )
__children
["SceneWriter1"]["in"].setInput( __children["char002"]["out"] )
__children
["SceneWriter1"]["fileName"].setValue( '/mnt/test/char002/char002.abc' )
__children
["SceneWriter1"]["__uiPosition"].setValue( imath.V2f( 30.608429, 60.6643295 ) )


del __children





Le vendredi 27 mars 2020 09:36:55 UTC+1, John Haddon a écrit :

William Eguienta

unread,
Apr 13, 2020, 6:01:50 AM4/13/20
to gaffer-dev
sorry a big part of the script is missing, here is the scene to reproduce the crash

parent
.addChild<span style="color:
instance.gfr

Tom Cowland

unread,
Apr 14, 2020, 5:15:41 AM4/14/20
to gaffe...@googlegroups.com
Hey William,

Are you able to share the alembic files you are using?

cheers
Tom


__children
["asset_Variables"]["variables"].addChild( Gaffer.NameValuePlug( "", Gaffer.StringPlug( "value", defaultValue = '', flags =Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), True, "member2", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )

__children
["asset_Variables"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default| Gaffer.Plug.Flags.Dynamic, ) )
__children
["Instancer"] = GafferScene.Instancer( "Instancer" )
parent
.addChild( __children["Instancer"] )
__children
["Instancer"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default |Gaffer.Plug.Flags.Dynamic, ) )
__children
["PathFilter7"] = GafferScene.PathFilter( "PathFilter7" )
parent
.addChild( __children["PathFilter7"] )
__children
["PathFilter7"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default |Gaffer.Plug.Flags.Dynamic, ) )
__children
["FreezeTransform"] = GafferScene.FreezeTransform( "FreezeTransform" )
parent
.addChild<span style="color: 
-- 
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.

Tom Cowland

unread,
Apr 14, 2020, 5:18:37 AM4/14/20
to gaffe...@googlegroups.com
Sorry, just saw the SceneWriter.. ignore me.

Tom Cowland

unread,
Apr 14, 2020, 6:19:40 AM4/14/20
to gaffe...@googlegroups.com
Hey William,

> I try to instance objects after a collectScene node but this make gaffer 0.57.0 crashing immediatly,
> do I miss something ?
> here is a scene to reproduce the crash


Thanks for the repro scene.

It seems there is a bug that we'd not spotted before that causes the crash when you filter the Instancer to a location without a primtive. I'll get that logged so we can fix it. Sorry about that!

If you update PathFilter7 to point to the mesh, rather than the group though, and put a separate filter on your Prune node, it should start working. See attached.

Hope thats some help,

cheers!
Tom

instance.gfr

John Haddon

unread,
Apr 14, 2020, 8:55:14 AM4/14/20
to gaffe...@googlegroups.com
Hello chaps,
Thanks for the bug report William, and thanks for tracking down the root cause Tom. I've made a PR with a fix here :

Cheers...
John

--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.

William Eguienta

unread,
Apr 14, 2020, 1:14:05 PM4/14/20
to gaffer-dev
Hey,
Thanks Tom for the file, works perfectly ! make sens that pointing the group doesn't work
you're welcome John !

cheers



Le mardi 14 avril 2020 14:55:14 UTC+2, John Haddon a écrit :
Hello chaps,
Thanks for the bug report William, and thanks for tracking down the root cause Tom. I've made a PR with a fix here :

Cheers...
John

On Tue, Apr 14, 2020 at 11:19 AM Tom Cowland <to...@cinesite.com> wrote:
Hey William,

> I try to instance objects after a collectScene node but this make gaffer 0.57.0 crashing immediatly,
> do I miss something ?
> here is a scene to reproduce the crash


Thanks for the repro scene.

It seems there is a bug that we'd not spotted before that causes the crash when you filter the Instancer to a location without a primtive. I'll get that logged so we can fix it. Sorry about that!

If you update PathFilter7 to point to the mesh, rather than the group though, and put a separate filter on your Prune node, it should start working. See attached.

Hope thats some help,

cheers!
Tom

--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffe...@googlegroups.com.

Sébastien Desmet

unread,
Jun 25, 2020, 6:09:19 AM6/25/20
to gaffer-dev
Hello,

I'm trying to use the gaffer instancer and I load the instancerDemo scene provided.
I have some questions:
On the example indexed roots list, it seems there is a way to change point order with a remap the per point index. How do you do that .? 
On the example indexed roots variable, it seems that it is possible to have a primvar attached to a houdini point cloud with object path who must be instanced. is it possible to provide a houdini file that show how to add the object path to the primvar ? I can't make it work.

Thx a lot,

Seb

Sébastien Desmet

unread,
Jun 25, 2020, 5:57:39 PM6/25/20
to gaffer-dev
here is an alembic file created in houdini. I'm able to see the path of my objects under the primitive variable "instance" but the var type is varying stringVectorData . it seems that I need a constant stringVectorData.
How can I change the var type ??

Thx,

Seb

Le jeudi 25 juin 2020 12:09:19 UTC+2, Sébastien Desmet a écrit :d
pointCloud_TEST_v001.abc

Andrew Kaufman

unread,
Jun 25, 2020, 8:17:57 PM6/25/20
to gaffe...@googlegroups.com
Using Houdini terms, our "Indexed (Roots Variable)" mode is expecting a Point attrib int and a Detail attrib string array, where the int is an index into the array of unique strings. I think there are several ways to generate that data in Houdini, and presumably the setup you used to make this "instance" Point attrib can be altered to produce the separated values. You could for example generate the string array from a wrangle downstream by setting the class ("Run Over") parm to Detail (eg `s[]@test={'/obj/tube1','/obj/cube1','/obj/sphere1 }`).

What I'm not sure about is if Houdini's Alembic exporter actually supports stringarray Detail attribs, or if Alembic itself supports them, or if we load them correctly in Gaffer (our Alembic support hasn't seen a ton of production use).

Note you should actually be able to use the "instance" primvar that you already have via "Root per Vertex" mode, but there are 2 issues:

(1) Its coming in as Varying rather than Vertex. I'd initially assumed this was a bug in our Alembic support, but looking at the code it seems to be down to the data in the file itself. We simply take the `Alembic::AbcGeom::GeometryScope` and translate that to an equivalent Cortex enum for `PrimitiveVariable::Interpolation`. For whatever reason, Houdini seems to be writing that abc with the `GeometryScope` set to `kVaryingScope` rather than `kVertexScope`. Since Houdini itself has no notion of Varying attribs, it seems to treat them the same and load both as Points in Houdini, so you never see the issue there.

(2) You should be able to workaround this quirk using a ResamplePrimitiveVariables node in Gaffer to convert the Varying primvars to Vertex.... but that node appears to be destroying the indices, making the resampled primvar useless for Root per Vertex mode. I expect rather than addressing that todo exactly, we could have a short-circuit when the data sizes already match (as is the case with Vertex and Varying for PointsPrimitives). Note that would be a Cortex change, so if you're relying on the public builds of Gaffer it'd take quite a while to trickle in there (Gaffer 0.58 most likely). If you're building from source you could probably get the change fairly quickly though.

Sorry its not as straightforward as we might have hoped...

Andrew


To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gaffer-dev/5abf295f-a398-4afb-b488-92a726185fb8o%40googlegroups.com.

Sébastien Desmet

unread,
Jun 26, 2020, 9:24:24 AM6/26/20
to gaffer-dev
Thx for the answers Andrew,

We have tried to generate the string array on the param detail. We can see it inside houdini. In gaffer I also see the primitive variable set to constant stringVectorData but it seems that the array is empty.
Can you take a look to the alembic file please maybe you will see something missing ?!

Thx,

Le vendredi 26 juin 2020 02:17:57 UTC+2, andrewk a écrit :
Using Houdini terms, our "Indexed (Roots Variable)" mode is expecting a Point attrib int and a Detail attrib string array, where the int is an index into the array of unique strings. I think there are several ways to generate that data in Houdini, and presumably the setup you used to make this "instance" Point attrib can be altered to produce the separated values. You could for example generate the string array from a wrangle downstream by setting the class ("Run Over") parm to Detail (eg `s[]@test={'/obj/tube1','/obj/cube1','/obj/sphere1 }`).

What I'm not sure about is if Houdini's Alembic exporter actually supports stringarray Detail attribs, or if Alembic itself supports them, or if we load them correctly in Gaffer (our Alembic support hasn't seen a ton of production use).

Note you should actually be able to use the "instance" primvar that you already have via "Root per Vertex" mode, but there are 2 issues:

(1) Its coming in as Varying rather than Vertex. I'd initially assumed this was a bug in our Alembic support, but looking at the code it seems to be down to the data in the file itself. We simply take the `Alembic::AbcGeom::GeometryScope` and translate that to an equivalent Cortex enum for `PrimitiveVariable::Interpolation`. For whatever reason, Houdini seems to be writing that abc with the `GeometryScope` set to `kVaryingScope` rather than `kVertexScope`. Since Houdini itself has no notion of Varying attribs, it seems to treat them the same and load both as Points in Houdini, so you never see the issue there.

(2) You should be able to workaround this quirk using a ResamplePrimitiveVariables node in Gaffer to convert the Varying primvars to Vertex.... but that node appears to be destroying the indices, making the resampled primvar useless for Root per Vertex mode. I expect rather than addressing that todo exactly, we could have a short-circuit when the data sizes already match (as is the case with Vertex and Varying for PointsPrimitives). Note that would be a Cortex change, so if you're relying on the public builds of Gaffer it'd take quite a while to trickle in there (Gaffer 0.58 most likely). If you're building from source you could probably get the change fairly quickly though.

Sorry its not as straightforward as we might have hoped...

Andrew


pointCloud_TEST_v001.abc

Andrew Kaufman

unread,
Jun 26, 2020, 12:25:00 PM6/26/20
to gaffe...@googlegroups.com
I'm seeing the same as you in Gaffer, but when I load that file back into Houdini I also see an empty Details attrib called "test". So maybe the wrangle didn't quite work? Or maybe the Alembic ROP doesn't support stringarray detail attribs very well...

abcecho gives me `ArrayProperty name=test;interpretation=;datatype=string;arraysize=1;numsamps=1` and that looks to be a regular string rather than an array I'd guess (though I'm no abcecho guru).

I wonder if you can find a way to get your "instance" Point attrib exporting to the abc with kVertexScope rather than kVaryingScope? Then you'd be able to use "Root per Vertex" mode...

An alternative might be to try writing a usdc file from Houdini. Though USD has seen even less use than Alembic in production in Gaffer, so I'm not too hopeful that'll work for you.

Andrew


To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gaffer-dev/eece8ddd-240a-4c19-9f16-5cc85eb9622ao%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages