Jump to content

JulienH

Members
  • Posts

    2
  • Joined

  • Last visited

JulienH's Achievements

Newbie

Newbie (1/14)

  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi, I am working on building a Blender add-on that can interacts with multiple versions control systems. In this specific situation, I am writing the add-on in python. I was wondering what is the best way to interact with Plastic from my plugin. So far I chose to use the "cm" CLI to do that, starting sub-processes in python and reading the outputs. I am wondering if using the Rest api would be a better solution? If it is, how would you do it? As far as I know, I would need to manually start the Plastic server using "cm api", but I already some possible issues here : -It looks like only one rest API can be started at a time. If multiple software/add-ons/plugins start to use the rest API, this can leads to problem: if the server runs as a subprocess of one of the plugin it could be terminated while another plugin is accessing it. One plugin could start the server with a specific port and the other plugins would not be able to connect to it nor to start a new server... (Would it not be nice if the rest server was started automatically as a service, and plugins could query the used port via the cli?) Then, the practicality: Would you recommend to start the rest server when the plugin starts, and kill the process when the plugin stops? To keep the process running indefinitely? Or to start it just when the plugin needs to interact with plastic and kill it right after? (last one sounds too slow) Thank you!
  2. Hi! I am working on a blender addon that should help users by checking out/adding exported files and the current blender file on the plastic workspace automatically. For that, I planned to use the cli "cm" commands. In some situations I need to get the status, add or checkout multiple files. And I want to do that at once, to make it quick. Looking at the documentation, I can do that by piping multiple files after running one of the command followed by a "-". It seems to work fine, but my problem is that it seems to be inconsistant with running cm commands normally. And just fails for example when trying to add a file that is not in the repository. Some example: >cm add "C:/File/Not/In/Repository.txt" C:/File/Not/In/Repository.txt is not in a workspace. >cm add - >C:/File/Not/In/Repository.txt The selected items are about to be added. Please wait ... Error: AssertForNullParams has found an empty string. Which leads me to a second issue: I thought I could check the status of the file to check if it is in the workspace. The issue here is that I can only user the 'getstatus' command using the 'pipe' method, and getstatus on a file that is not in the workspace returns 'the item C:/File/Not/In/Repository.txt is private.' The 'getstatus' command behavior is also inconsistent with the 'status' command that would correctly output 'C:/File/Not/In/Repository.txt is not in a workspace.' It would be amazing if a pass on the cli commands could be done, and unify all this. 'pipe' commands should have the same behaviour/output as running the command on a single file. getstatus should probably output the same as the status message. It would help users create tools for plastic.
×
×
  • Create New...