Giter Site home page Giter Site logo

rfsp's Introduction

RfSP

⚠️ This repo is obsolete ! Go to https://github.com/prman-pixar/RfSP for the latest version. ⚠️

RenderMan for Substance Painter 2.x

This plugin exports your Substance Painter project as one or more RenderManAsset.

RenderManAsset is the format used by the preset browser that was introduced in RenderMan For Maya 21.0. It allows for easy material setup interchange and includes dependencies like textures or OSL shaders.

demo

Full demo video of 0.1.1

Features

Alt : Export to PxrDisney-based material

The asset will use the PxrDisney bxdf to re-create the Substance Painter material. There are limitations though:

  • The Substance Painter project MUST use the pbr-metal-rough shader.
  • normals MUST be in directx format.
  • Opacity is not supported.

Alt : Export to PxrSurface-based material

  • The Substance Painter project MUST use the pbr-metal-rough shader.
  • normals MUST be in directx format.
  • Opacity is not supported.

Requirements

This plugin will NOT work without the following software:

  • Substance Painter 2.3+
  • RenderMan Pro Server 21.0+
  • RenderMan For Maya 21.0+
  • Python 2.7+ (but not Python 3.x)

Install

  • Download a zip archive from the github page
  • Un-zip the archive
  • Copy the RenderMan folder inside Substance Painter's plugin folder.

    OSX: /Users/yourlogin/Documents/Substance Painter 2/plugins

Known Issues

  • No progress indication during export: be patient !
    • It takes time to export the maps and turn them into textures. The plugin will print a message in the log when done.

Usage

  1. On first use, open the "configure" dialog.

    Alt

  2. Fill ALL fields of the dialog and click "Save", otherwise the export will fail.

    Alt

  3. Once this initial configuration is done, the settings will be remembered even if you close Substance Painter.

  4. Open a SP project and click one of the pixar buttons in the shelf.

    Hint: Only the first one (PxrDisney) works for now.

    Alt

Release notes

0.3.0

  • new

    • UDIM support
    • The export code converts SP images to RenderMan textures
  • code

    • Refactored javascript json export.

0.2.2

  • new

    • Added metadata to the asset files: user, description, resolution.
    • Compatibility chunk holds Substance Painter version.
  • Fixed

    • better match with PxrSurface. Updated rules.json to fix a number of issues:
      • roughness should not be linearized
      • metallicity should not be linearized
      • normal map should use directx orientation
    • exported normal map contains mesh normals + bump + normal map.
  • code

    • Added a new "settings" section to rules.json to set node param values in the shading graph.
    • Some refactoring

0.2.1

  • Fixed
    • Fix ui error in Substance Painter 2018 (was ok in SP 2.x)

0.2.0

  • New
    • Added support for RenderMan 22.x.
      • REMEMBER to change the SP prefs to point to RenderMan 22.x
    • The assets are now named after the SP project's name.
  • Fixed
    • The specular was incorrect when outputing for PxrSurface.
    • The correct renderman version number is saved in the asset file.
  • code
    • Refactored file path management.
    • Used logging module instead of my own.
    • Doc strings and PEP-8 fixes

0.1.4

  • Initial support for PxrSurface
    • Simply use the rough metal workflow in Substance Painter and it will be converted to work with PxrSurface.
    • Also fixed Issue #2, reported by dayelov. Thanks !

0.1.2

  • windows file paths were not correctly serialized to json.
  • mention python dependency in README
  • Final cleanup was inadvertantly disabled
  • Fixed incorrect path on windows.

0.1.1

  • Added license text to all source files.

0.1.0

  • Initial Release
  • Implemented configure dialog to specify the path to RenderMan Pro Server and RenderMan For Maya. This is necessary because SP uses javascript, a sandboxed language that can not get access to environment variables.
  • Export all channels from all textureSets to png files.
  • Implemented basic export to PxrDisney-based asset.
    • Each TextureSet will be exported as a RenderManAsset directory.

rfsp's People

Contributors

king-wally avatar pleprince avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rfsp's Issues

Select Material(s) to export

If a model has a number of materials, RfsP always exports all of the materials.
Would it be possible to select which materials to export, rather than everything every time

Subprocess error: "python.exe rmanAssetsSubstancePainter.py"

We are really hoping to be able to use this plugin in our senior film pipeline. I followed the instructions on ​https://renderman.pixar.com/substance-to-renderman best I could. I made sure that I downloaded the most recent version of the plugin from git hub and placed the files correctly within my system. I also made sure that I installed python 2.7.17. When running the plugin, substance painter reported the following warnings and errors (see attatched files) Any help or ideas would be welcome! Thanks!

SethQuestion

Also, it seems as the though the textures aren't being sent to the renderman asset library that I specified in the configuration of the plugin in, as they are being sent to to the default substance export folder.

Here's a pic of where I placed the plugin folders:
question2

Thanks again!

plugin hangs substance painter

Hi,
I am using win 10 pro, substance painter 7.4.0 and renderman 24.2
The plugins loads fine in substance, I can see the asset browser working, I can add new library folder and so on.
But when I try to export a material, even on a very simple scene, painter will hangs after the export progress bar is complete.
see video link:
https://youtu.be/8l7iU96dAKo

I have tried with a few different projects and waited up to 1h before I force quit the app.
at the moment I have only python 3.7 and 3.9 installed, do I need 2.7 in order for this to work?
also I only have copied this plugin into substance plugin folder (in documents so it is writable) do I need to install the master plugin as well?

thank you.

Export failed 'RmanExport.json failed to start'

Hello!

I have followed the instructions the best I can, but I'm hitting a brick wall. On clicking export for either Disney or Pixar materials, Substance Painter claims the export is done but no materials are showing in the preset browser. I check the log and sure enough:

[Plugin - RenderMan] ERROR: SubprocessError: Program 'python.exe rmanAssetsSubstancePainter.py "D:\Work\Maya\Weapon Shop\sourceimages\Textures\RenderMan\RmanExport.json"' failed to start

The textures are all made and exported fine, but nothing is done to take them into Renderman/Maya and form materials with them. I just have a bunch of image files in the sourceimages/textures/renderman folder. I took a look at the preset browser and noticed a few things:

  1. The SubstancePainter folder did not appear. I had to make it as a category in the UI itself, then redirect SP to this folder and tried again. Same result.

  2. As far as I can tell, maya is pointed at the right RendermanAssetLibrary folder. As in, the duplicate I made that is outside the default location. However the preferences UI differs from what the tutorial documents and video showed, so I am not 100% sure I've done it right. Any help here would be good, but as the newly created categories are showing as folders within the duplicated directory I think that isn't the problem. I fiddled back and forth with different locations and nadda.

  3. I noticed the newly made library was 'protected'. I managed to disable it in the library's json file but this didn't fix the issue.

  4. I cannot 'create new material' within the preset browser. I can however create new environment maps, it even opens to the exact folder where my textures are kept. But clicking the new material button doesn't do anything.

On the upside I could manually make the materials from here, but I could have achieved this by making a new PxrMat export in Substance Painter. Any help getting the plugin working entirely would be appreciated.

For reference I am using Windows 10 and both Maya and Substance 2018.

[Plugin - RenderMan] failed to retrieve project url ?????

Hello Everyone ! I have a big problem and it is an urgent matter !

When i want to export my texture from substance painter with the Renderman Plugin i get an error "[Plugin - RenderMan] rman: failed to retrieve project url" it's weird because everything is correclty set I use the last version of substance painter 2018.2.3 and the 22.2 of Renderman.

So if anyone get a issue could be great.
Thank you !

Disable tiling

Would it be possible to add a toggle to disable tiling since it can make it a bit difficult to see what the material is in the preset browser for certain materials?

Error when exporting after plugin says successful export

Thu, 27 Sep 2018 23:41:04
C:\Users\matt\Documents\Allegorithmic\Substance Painter\plugins\RenderMan\log.txt

Start !
OK: json read
err: <type 'exceptions.ImportError'>
: No module named rfm.rmanAssets
Traceback (most recent call last):
File "rmanAssetsSubstancePainter.py", line 144, in export
import rfm.rmanAssets as ra
ImportError: No module named rfm.rmanAssets
ERROR: failed to import rfm.rmanAssets
sys.path : ['C:\Users\matt\Documents\Allegorithmic\Substance Painter\plugins\RenderMan'
'C:\WINDOWS\SYSTEM32\python27.zip'
'C:\Python27\DLLs'
'C:\Python27\lib'
'C:\Python27\lib\plat-win'
'C:\Python27\lib\lib-tk'
'C:\Python27'
'C:\Python27\lib\site-packages'
u'C:\Program Files\Pixar\RenderManForMaya-22.1\scripts']
err: <type 'exceptions.Exception'>
:
Traceback (most recent call last):
File "rmanAssetsSubstancePainter.py", line 426, in
export()
File "rmanAssetsSubstancePainter.py", line 149, in export
raise Exception
Exception
Exit.

substance designer to ( maya for renderman assetslibrary)

Hi, Thank you for sharing "substance painter" (rmanAssetslibrary) on renderman's official website
I have a question that needs to be consulted. I'm in: "substance designer" production, how to use rmanAssetslibrary's process Export to maya for renderman

SSS on export

The baseColor Texture is being plugged into both the SubsufaceColor and Subsurface DMFP color even though SSS is not selected or any SSS channels painted in Painter.

This means, that every time a material is exported, you need to unconnect them from the PxrSurface inputs manually.

Replace maps

Hey PLP.

One day, when you're not super busy, can we have an option to decide whether to replace updated maps on export from Painter.

For instance. If I create a map and export it. When I go back into substance to make a change to that map, I need to re-name the shader to get it to appear in the browser. I just want to update the current shader with the new maps. Otherwise, I end up with multiple shaders and versions.

Hope this makes some sense.

Thanks

Eugene

Bad RMANTREE picked by user

user entered: "C:/Program Files/Pixar/RenderManProServer-24.1/lib/RenderManAssetLibrary".
Need to validate the picked directory.

Issue while exporting 'textureSetResolution' not a function

Hello everyone !
I just installed the plugin following the step by step on renderman's website. But each time I try to export for pixar disney or pixar surface I get this error message :

[Script] Scene name: armchair
[Script] UDIM = false
[Script] rman: Property 'textureSetResolution' of object [object Object] is not a function

Any idea what I did to cause that ? and how to fix it ?

I am using substance painter 2.4.1 (with a PBR MetalRoughHQ), maya 2019, I installed python 2,7 and added it to the PATH Environmental Variable.

Error at exporting

Hello!

I'm getting this when I try to export
[Plugin - RenderMan] rman: Program 'python.exe rmanAssetsSubstancePainter.py "H:\Users\Harry\Documents\Substance Painter 2\export\RenderMan\RmanExport.json"' failed to start

failed to retrieve project url

Hey!
I've got a problem on Windows and on Mac!
I'm using Maya2018, Renderman 22.1 and Substancepainter 2018.3
I installed python2.7 (by default) and I set the paths for the plugin correctly.
This happens when I set up a new project. When I pick an old project or sample, it says export was successfully. The files are under SubstancePainter/export but there are no files in the folder for the preset Browser. When I open the preset browser in Maya, there is nothing added too.
Any ideas?

Update: Everything was working for the first time with the SubstancePainter sample project called "MeetMat", I tried another sample/ did a new project nothing was working again...

[Plugin - resources-updater] No project open, resources updater discarded
[Plugin - RenderMan]

[Plugin - RenderMan] rman: failed to retrieve project url

Thank you!

Normal map

the normal map are not generated correctly
otherwise everything is fine

Plugin Updates

Currently I am a student with CGSpectrum and have been looking into the Pixar Renderman challenges and all things Renderman to learn a bit more and to use it to expand my portfolio.

This lead me to this plugin after watching the fundamentals videos about the Preset Library. As you are no doubt already aware things have moved on a little within the latest version of Substance Painter.

I started writing a new version based heavily on this plugin and just wondered if the plugin is something you are actively working on (I don't want to reinvent the wheel). If not, would you like me to raise a Pull Request on this repository if I can get it done in the coming months ?

Currently have switched to use the Substance Python API, and rather than using mapexport I used the new template preset that now has been added for Renderman (PxrSurface) within Substance Painter. I also added a Preset Library browser UI so you can see materials and what not within Substance Painter.

Demo of current progress:
https://vimeo.com/476245605/3b12e98022

Some current Renderman import / dependency issues:

  • Had to update rmanAssets/core.py to work with Python 3
  • Had to update vstruct.py to work with Python 3

Are there plans at all to update Renderman bin to migrate to Python 3 at all ?

Stay safe !

export

[Python] Traceback (most recent call last):

[Python] File "C:/Program Files/Pixar/RenderManProServer-24.2\bin\rman_utils\rman_assets\ui.py", line 310, in newMaterial

[Python] if self.hostPrefs.exportMaterial(category, infodict, previewtype):
[Python] File "C:/Users/pagho/Documents/Adobe/Adobe Substance 3D Painter/python\plugins\renderman_for_sp.py", line 508, in exportMaterial

[Python] ch_colorspace = mappings[ch_type]['ocio']
[Python] KeyError
[Python] :
[Python] 'Anisotropylevel'

RfSP not working with 24.2

Hello Philippe,
First of all, thanks a lot for your work, it's proven to have been really helpful in our workflow on making a short film.
Since we've updated to Renderman 24.2, the RfSP plugin interface suddenly changed. A section was added, named "Store Dependencies" with a tab offering either Asset, Library or External. It wasn't there beforehand, and we have tried using it nonetheless.
Upon trying, we've noticed the same errors occurring:
[Python] File "C:/Users/t.giandoriggio/Documents/Adobe/Adobe Substance 3D Painter/python\plugins\renderman_for_sp.py", line 457, in exportMaterial
[Python] func()
[Python] File "C:/Users/t.giandoriggio/Documents/Adobe/Adobe Substance 3D Painter/python\plugins\renderman_for_sp.py", line 897, in add_texture_node
[Python] func()
[Python] File "C:/Users/t.giandoriggio/Documents/Adobe/Adobe Substance 3D Painter/python\plugins\renderman_for_sp.py", line 897, in add_texture_node
[Python] asset.addDependency(pdict['value'])
[Python] AttributeError
[Python] 'RmanAsset object has no attribute 'addDependency'.

We've tried messing with the py file, adding an 'addDependency' attribute, but then it needs to be defined, and that's where we're stumped.

Hope this is enough for you to work with, thank you again for your work!
All the best,
Tristan

Purple Texture After Export from substance painter

Hey everyone,

After succeed export my texture from Substance Painter, I have now to apply it on my modelisation. So I import my Library into the RendermanAssetLibrary, my texture is correctly in the folder, but when i want to make a previz or apply on my mesh the texture is purple. So it's weird, previously when i did it when the 21 version it was working perfectly and now no :/ so if you guys get a solution I'm in :D Thanks a lot

Substance to Maya not export

There is no texture in the folder directory while exporting texture from substance. Then i open the folder directory and exported it. It got deleted right after exporting so whats the issue here???
I am useing python 2.7 and renderman 23.2 and substance 2018.3.3

Export to Substance default folder

Hi there,
small post dedicated to a default Substance export localization. By default textures are exported to
Substance Painter export folder on local drive.

Guys in my studio starts to export textures, and basically work with assets and save them. After I try to open asset made by other artist on my machine and try export textures, an error comes out. And this is because Substance saves user export path with substance project itself, so instead of C:\Users\mymachine... you will have C:\Users\JohnDoe....

So the one thing in mind is to make some temp folder on a network drive, so everybody can have ecces to it and export textures before conversion to that path. In this scenario one path saves with all substance projects which allows to freely share assets in team. That can work.

But if you start to work on a new asset, the path is again set to local export folder by default. And in this case you should manually make a first export to chosen location on a network drive and save your project.

So basically to avoid all those steps we can add our path to a renderman.js script or to a settings.ini file and read it in script as exportPath = osPath(alg.settings.value("tempDir")). It's good when you work alone but required a little more tweaking when you work with team)

Also I've add UDIM support, you can see it in action
https://youtu.be/vRY6w9zhimE

Issue on windows

Hello, got the same issue as Pluneaucan you help me please ?
[Plugin - RenderMan] ERROR: SubprocessError: Program 'python.exe rmanAssetsSubstancePainter.py "D:\RenderManAssetLibrary\Materials\Substance_Painter\RenderMan\RmanExport.json"' failed to start

The export is done but not in the folder I choose in the plugin setup but in the export textures folder.
So the shaders are not created.

Renderman Texture Manager adds .png to .tex files needed

The Renderman to Substance Painter stuff is working good I think but unfortunately naming stuff is getting in the way each time I export.

The pxrSurface the plug in makes is looking for glove.tex but Renderman Texture Manager outputs glove.png.tex when I run it on the Substance painter export directory.

Other than editing each .tex file's name to remove the .png is there a way to fix this naming issue?
namingissue

RfSP Stopped working after 24.2 -> 24.3 update (Painter 7.4.1)

Hi Philippe,

I know this is early as they just released 24.3 but maybe doesn't hurt to give you info from this side :)

  • I have the latest renderman_for_sp.py file (Latest commit ff6ad88 on Nov 25, 2021)
  • Just updated RenderMan to 24.3
  • Windows 10 Pro has all the latest updates installed.
  • Painter 7.4.1 build 1418 (latest version)
  • The plugin was working fine with RMan 24.2
  • I uninstalled RM 24.2 before updating (maybe not the smartest move)

ERROR LOG BEFORE CHANGING "Log(loglevel=spl.ERROR)" to line 103:

[Resources List Model] Icons memory budget set to 100MB.
[RenderMan 24.2.0] RMANTREE = 'C:/Program Files/Pixar/RenderManProServer-24.3'
[RenderMan 24.2.0] Failed to import: cannot import name 'replace_img_with_tex' from 'rman_utils.rman_assets.common.external_files' (C:/Program Files/Pixar/RenderManProServer-24.3\bin\rman_utils\rman_assets\common\external_files.py)
[Python] Traceback (most recent call last):

[Python] File "C:/Users/danij/Documents/Adobe/Adobe Substance 3D Painter/python\plugins\renderman_for_sp.py", line 215, in build_panel
from rman_utils.rman_assets.common.external_files import (Storage, ExternalFileManager, replace_img_with_tex)

[Python] ImportError: cannot import name 'replace_img_with_tex' from 'rman_utils.rman_assets.common.external_files' (C:/Program Files/Pixar/RenderManProServer-24.3\bin\rman_utils\rman_assets\common\external_files.py)

[RenderMan 24.2.0] RenderMan started
[Plugin - resources-updater] No project open, resources updater discarded

ERROR LOG AFTER ADDING "Log(loglevel=spl.DBG_INFO)" to line 103:

[Resources List Model] Icons memory budget set to 100MB.
[RenderMan 24.2.0] Log Level: LogSeverity.DBG_INFO (3)
[RenderMan 24.2.0] SP python: 3.7.6
[RenderMan 24.2.0] Log Level: LogSeverity.DBG_INFO (3)
[RenderMan 24.2.0] SP python: 3.7.6
[RenderMan 24.2.0] root = 'C:/Users/danij/Documents/Adobe/Adobe Substance 3D Painter/python\plugins'
[RenderMan 24.2.0] Loaded: C:\Users\danij\renderman_for_substance_painter.prefs
[RenderMan 24.2.0] Prefs created
[RenderMan 24.2.0] build_panel
[RenderMan 24.2.0] RMANTREE = 'C:/Program Files/Pixar/RenderManProServer-24.3'
[RenderMan 24.2.0] Failed to import: cannot import name 'replace_img_with_tex' from 'rman_utils.rman_assets.common.external_files' (C:/Program Files/Pixar/RenderManProServer-24.3\bin\rman_utils\rman_assets\common\external_files.py)
[Python] Traceback (most recent call last):

[Python] File "C:/Users/danij/Documents/Adobe/Adobe Substance 3D Painter/python\plugins\renderman_for_sp.py", line 215, in build_panel
from rman_utils.rman_assets.common.external_files import (Storage, ExternalFileManager, replace_img_with_tex)

[Python] ImportError: cannot import name 'replace_img_with_tex' from 'rman_utils.rman_assets.common.external_files' (C:/Program Files/Pixar/RenderManProServer-24.3\bin\rman_utils\rman_assets\common\external_files.py)

[RenderMan 24.2.0] |_ done
[RenderMan 24.2.0] RenderMan started
[Plugin - resources-updater] No project open, resources updater discarded

Finally, thank you again for your work! I hope this was not too long of a post.

Normal map Bake issue

Hi,
i have encountered another thing

during export from Substance, one of the maps, which is normal map, saves in world space with no additional details to it. I manually export tangent space normal map and connect it to a network.

Thanks

Export Substance Painter Texture Renderman failed

Hello Everyone this is my problem,

When i want to export my texture from substance painter with the Renderman Plugin i get an error "[Plugin - RenderMan] rman: failed to retrieve project url" it's weird because everything is correclty set so if anyone get a issue could be great. I use the last verion of substance painter 2018.2.3 and the 22.2 of Renderman.

Thanks everyone

Possible to change resolution from 4k to 8k?

I was wondering if it was possible to make the plugin use the export settings resolution for the export since I can choose a higer resolution there? Or make it possible to choose the resolution in the export dialog itself?

SyntaxError: invalid syntax

Hi! I've been trying to install the plugin and I've fixed as much as I could, but I still got something I can't solve;
and I've run the code into phyton, to get this response :

 >>> python.exe rmanAssetsSubstancePainter.py "D:\cobb\aversianda\RenderMan\RmanExport.json"
  File "<stdin>", line 1
    python.exe rmanAssetsSubstancePainter.py "D:\cobb\aversianda\RenderMan\RmanExport.json" 
                                        ^
SyntaxError: invalid syntax 

Thanks!

Problem on Windows

[Script] RenderMan: Writing C:\Users\philippe\Documents\Substance Painter 2\export\RenderMan\RmanExport.json...
[Script] rman: Program 'python.exe rmanAssetsSubstancePainter.py "C:\Users\philippe\Documents\Substance Painter 2\export\RenderMan\RmanExport.json"' failed to start

Pink Icons - Windows.

Hey.

For some reason, when I create a Substance material on Windows, it only creates a pink render icon ..

Any ideas PlP ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.