Skip to content

Commit

Permalink
GafferDelight : Import IECoreDelight on Windows
Browse files Browse the repository at this point in the history
GafferDelight does not need any symbols from IECoreDelight, so MSVC tries to be helpful and not load IECoreDelight.dll. Skipping that means that 3Delight is never registered as a renderer, so we import / register it manually.
  • Loading branch information
ericmehl committed Jan 13, 2023
1 parent 1ef5268 commit b3215a4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions python/GafferDelight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,21 @@

from ._GafferDelight import *

# GafferDelight does not need any symbols from IECoreDelight, so MSVC tries
# to be helpful and not load IECoreDelight.dll. Skipping that means that
# 3Delight is never registered as a renderer, so we import / register it manually.

import os

ieCoreDelight = None

if os.name == "nt" and ieCoreDelight is None :

import ctypes

try :
ieCoreDelight = ctypes.CDLL( "IECoreDelight.dll" )
except :
raise ImportError

__import__( "IECore" ).loadConfig( "GAFFER_STARTUP_PATHS", subdirectory = "GafferDelight" )

0 comments on commit b3215a4

Please sign in to comment.