sideeffects / HoudiniEngineForUnreal

Houdini Engine Plugin for Unreal Engine.
http://www.sidefx.com/unreal
Other
1.36k stars 374 forks source link

Allow use of Houdini plugin without Houdini (Engine) installed... #10

Closed JaapSuter closed 8 years ago

JaapSuter commented 8 years ago

...as well as allow usage with more than one version.

Note, I don't expect you to accept this pull request as is (it's specific to our use and contains a bunch of company specific comments). But it should give an idea of what we'd like to see and provide a start for how you may put this feature in the official version (i.e., I welcome discussions or suggestions on alternate ways to do the things below).

There are three separate requests in this pull request (and a third minor one):

Allow use with more than one Houdini version. Some of us are using Houdini 15.0.355, others are still on 15.0.244. Meanwhile, HAPI has not changed in a significant manner, so the plugin works fine with either version of Houdini installed. This way we don't force everybody to upgrade at the exact same time. Obviously when a breaking upgrade in HAPI/Houdini happens, we will in fact upgrade.

The way I've implemented this currently is not ideal. I'm just hard coding a list of versions I've seen in the wild, and running a for-each over that:

string[] HoudiniVersions = { "15.0.355", "15.0.347", "15.0.244.16", };
foreach (var HoudiniVersion in HoudiniVersions)

Instead, perhaps you can enumerate the available Houdini installs, extract the version number, and check if the minor or patch part of that number is within a supported range.

Not everybody on our team has Houdini installed.

The Unreal plugin system doesn't allow selective disabling of plugins based on decisions made in the plugin build file itself. That's why the Houdini plugin files throw a BuildException when it can't find a Houdini installed.

I've changed it so that it merely becomes a silent fail. The plugin will continue to be build and enabled. The key part is that it now has to refer to an embedded version of the five HAPI headers.

I'm not sure how you'll feel about including these five HAPI files with the plugin (since they come with Houdini already, but it's precisely to allow compilation when Houdini is not available).

At runtime, Unreal will load the plugin, but it just won't initialize properly. This isn't a problem as long as people without Houdini don't try to change Houdini assets (they just see the baked versions).

These two files are very similar. Is there a way to share some code between these two? Perhaps we can extract things into a separate 'FindCompatibleHoudiniOrEngineInstallation' function that lives in a common place? I don't know how easy the C# Unreal build system makes this. This is pretty minor,

Yelmond commented 8 years ago
ttvd commented 8 years ago

Filed:

JaapSuter commented 8 years ago

Adding HAPI stubs instead of duplicating the actual HAPI headers into the plugin is an even better solution, thanks for doing that!

If you're generating the two .cs build files for runtime and editor from a single source, then the duplication doesn't matter to me. (I just noticed that it actually says as much at the top of those files: This file is generated. Do not modify directly., sorry about that).

As for supporting more than one installed version of Houdini. While I can see how there may be breaking changes within a major or even minor version number change, is it fair to assume that many version increments are not breaking in a way that affects the common uses Houdini Engine for Unreal?

Or to be more specific, it appears to me that we've been able to use Houdini assets regardless of whether they're cooking on 15.0.355, 15.0.347, or 15.0.244.16 (the three versions that happen to be used by people here).

If Houdini updated itself similar to evergreen browsers (e.g., incrementally, mostly in the background), then having to keep in sync with the latest wouldn't be a huge deal. But in as far as I can tell, every Houdini update is delivered via a complete 650-ish MB download and a reinstall (which actually installs it side-by-side with the previous version). So updating a local install of Houdini isn't quite trivial enough to force everybody to keep up with plugin increments.

I'm closing this pull request since you've addressed all the other requests (which is fantastic, thank you so much!). For now, we'll lock everybody in the company down to the same patch number, and do lock-step increments of Houdini updates.

If this proves to be a burden, then perhaps I'll open up a new issue or create a pull request specifically for that in at some point in the future.

Thanks again for the great work and the quick turn-around!

Jaap Suter - http://jaapsuter.com