Skip to content

Commit

Permalink
Merge pull request #6 from TheFoundryVisionmongers/feature/adding_win…
Browse files Browse the repository at this point in the history
…dows_build

Fixed up windows Startup example and build script
  • Loading branch information
JamesPedFoundry authored May 8, 2019
2 parents 76ef3c4 + 367891c commit 2690cdb
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 246 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.pyc
.vscode
*.dll
*.so
src/build

Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def configureAssetBrowser(self, browser):
workFilesBrowser, workFilesIndex = self.__addWorkfilesBrowser(
browser, hints
)
print "inputPath", inputPath
if utils.isShotgunPublishPath(inputPath):
loaderBrowser.setLocation(inputPath)
browser.setCurrentIndex(index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ def convertShotgunPublishDataToAssetIdFields(sgPubData):
return assetFields


def getShotgunAssetIdFromShotgunPublishData(sgPubData):
assetFields = convertShotgunPublishDataToAssetIdFields(sgPubData)
return createShotgunAssetIdFromAssetFields(assetFields)


def resolveAssetIdFromVersionPolicy(assetId, policy, engine):
Expand Down
45 changes: 6 additions & 39 deletions resources/Katana/ShotgunAsset/python/shotgun_asset/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,45 +102,12 @@ def createShotgunAssetIdFromAssetFields(assetFields):
return sgAssetPlugin.buildAssetId(assetFields)


# def getTemplateFromContext(
# context,
# isFolder=None,
# engine=None,
# isPublish=None
# ):
if not engine:
engine = publish_utils.getCurrentEngine()
tkCore = engine.sgtk
allTemplateNames = [k for k in tkCore.templates.keys() if "katana" in k]
templatePrefix = "katana_"
templateSuffix = "_work"
if isFolder:
templatePrefix = templatePrefix+"folder_"
if isPublish:
templateSuffix = "_publish"
if context.entity is None:
return engine.get_template_by_name("katana_project_work")
elif context.entity:
templateEntityName = context.entity["type"].lower()
if context.step:
templateContextStep = context.step["type"].lower()
template = engine.get_template_by_name(
"{0}{1}_{2}{3}".format(
templatePrefix,
templateEntityName,
templateContextStep,
templateSuffix
)
)
if template:
return template
return engine.get_template_by_name(
"{0}{1}{2}".format(
templatePrefix,
templateEntityName,
templateSuffix
)
)
def getShotgunAssetIdFromShotgunPublishData(sgPubData):
assetFields = publish_utils.convertShotgunPublishDataToAssetIdFields(
sgPubData
)
return createShotgunAssetIdFromAssetFields(assetFields)



def resolvePathFromTemplate(
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ target_link_libraries(ShotgunAssetAPI
PRIVATE
Katana::FnAssetPlugin
Katana::FnAsset
${PYTHON_LIB}
)

install(
Expand Down
20 changes: 20 additions & 0 deletions src/build_script.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

rm -rf build && mkdir build && cd build

SET TK_KATANA=C:/workspace/shotgun/tk-katana
SET KATANA_LOCATION="C:/Program Files/Foundry/Katana3.2dev"
SET INSTALL_PREFIX=%TK_KATANA%/resources/Katana/ShotgunAsset
SET KATANA_PYTHON=%KATANA_LOCATION%/bin/include/include/
SET PYTHON_LIB="C:\Program Files\Foundry\Katana3.2dev\bin\python27.lib"
:: Pybind required for importomatic version changing.
SET PYBIND_INCLUDE_DIR=C:/Users/james.pedlingham/Documents/Git/pybind11/include

cmake .. ^
-DCMAKE_GENERATOR_PLATFORM=x64 ^
-DPYBIND_INCLUDE_DIR=%PYBIND_INCLUDE_DIR% ^
-DPYTHON_INCLUDE_DIR=%KATANA_PYTHON% ^
-DKATANA_LOCATION=%KATANA_LOCATION% ^
-DPYTHON_LIB=%PYTHON_LIB% ^
-DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%
cmake --build . --target install

Loading

0 comments on commit 2690cdb

Please sign in to comment.