File tree Expand file tree Collapse file tree 3 files changed +44
-4
lines changed
DynamoPythonNet3Extension Expand file tree Collapse file tree 3 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 1616 <NoWarn >MSB3539;CS1591;NUnit2005;NUnit2007;CS0618;CS0612;CS0672</NoWarn >
1717 </PropertyGroup >
1818 <ItemGroup >
19- <PackageReference Include =" DynamoVisualProgramming.Core" Version =" 3.3 .0-beta6171 " ExcludeAssets =" runtime" />
20- <PackageReference Include =" DynamoVisualProgramming.DynamoServices" Version =" 3.3 .0-beta6171 " ExcludeAssets =" runtime" />
19+ <PackageReference Include =" DynamoVisualProgramming.Core" Version =" 3.4 .0-beta6616 " ExcludeAssets =" runtime" />
20+ <PackageReference Include =" DynamoVisualProgramming.DynamoServices" Version =" 3.4 .0-beta6616 " ExcludeAssets =" runtime" />
2121 <PackageReference Include =" pythonnet" Version =" 3.1.0-preview-ADSK-*" />
2222 </ItemGroup >
2323 <ItemGroup >
Original file line number Diff line number Diff line change @@ -457,6 +457,46 @@ private static string GetTraceBack(Exception e)
457457
458458 #region Marshalling
459459
460+ /// <summary>
461+ /// Add additional data marshalers to handle host data.
462+ /// </summary>
463+ [ SupressImportIntoVM ]
464+ internal override void RegisterHostDataMarshalers ( )
465+ {
466+ DataMarshaler dataMarshalerToUse = HostDataMarshaler as DataMarshaler ;
467+ dataMarshalerToUse ? . RegisterMarshaler ( ( PyObject pyObj ) =>
468+ {
469+ try
470+ {
471+ using ( Py . GIL ( ) )
472+ {
473+ if ( PyDict . IsDictType ( pyObj ) )
474+ {
475+ using ( var pyDict = new PyDict ( pyObj ) )
476+ {
477+ var dict = new PyDict ( ) ;
478+ foreach ( PyObject item in pyDict . Items ( ) )
479+ {
480+ dict . SetItem (
481+ ConverterExtension . ToPython ( dataMarshalerToUse . Marshal ( item . GetItem ( 0 ) ) ) ,
482+ ConverterExtension . ToPython ( dataMarshalerToUse . Marshal ( item . GetItem ( 1 ) ) )
483+ ) ;
484+ }
485+ return dict ;
486+ }
487+ }
488+ var unmarshalled = pyObj . AsManagedObject ( typeof ( object ) ) ;
489+ return dataMarshalerToUse . Marshal ( unmarshalled ) ;
490+ }
491+ }
492+ catch ( Exception e )
493+ {
494+ DynamoLogger ? . Log ( $ "error marshaling python object { pyObj . Handle } { e . Message } ") ;
495+ return pyObj ;
496+ }
497+ } ) ;
498+ }
499+
460500 /// <summary>
461501 /// Data Marshaler for all data coming into a Python node.
462502 /// </summary>
Original file line number Diff line number Diff line change 99 </PropertyGroup >
1010
1111 <ItemGroup >
12- <PackageReference Include =" DynamoVisualProgramming.Core" Version =" 3.3 .0-beta6171 " >
12+ <PackageReference Include =" DynamoVisualProgramming.Core" Version =" 3.4 .0-beta6616 " >
1313 <PrivateAssets >all</PrivateAssets >
1414 <ExcludeAssets ></ExcludeAssets >
1515 </PackageReference >
16- <PackageReference Include =" DynamoVisualProgramming.DynamoServices" Version =" 3.3 .0-beta6171 " >
16+ <PackageReference Include =" DynamoVisualProgramming.DynamoServices" Version =" 3.4 .0-beta6616 " >
1717 <PrivateAssets >all</PrivateAssets >
1818 <ExcludeAssets ></ExcludeAssets >
1919 </PackageReference >
You can’t perform that action at this time.
0 commit comments