How do I call the getInputHtml() method of a custom fieldtype plugin from another plugin? Plugin 1

I have a plugin that is a custom fieldtype.  It works fine, and has a getInputHtml() method that behaves as expected.

Plugin 2

Now, I have a second plugin, where I want to output the HTML from the Plugin 1 getInputHtml() method.  

I have the FieldModel:

$field = $field-&gt;getField();


I have the Plugin 1 fieldtype object

$fieldtype = craft()-&gt;fields-&gt;populateFieldType($field, $element);


And I call the getInputHtml() method:

$fieldtype-&gt;getInputHtml($field-&gt;handle, $value);


If I place the necessary files at the base of Plugin 2 plugin2/templates/plugin1/_field/input everything works fine.  But I can't seem to access the input HTML template in the context of Plugin 1: plugin1/templates/_field/input

I've tried to update the Template Path in various ways before calling $fieldtype->getInputHtml():

craft()-&gt;path-&gt;setTemplatesPath(craft()-&gt;path-&gt;getPluginsPath());
craft()-&gt;path-&gt;setTemplatesPath(craft()-&gt;path-&gt;getPluginsPath() . 'plugin1/');
craft()-&gt;path-&gt;setTemplatesPath(craft()-&gt;path-&gt;getCpTemplatesPath());


Everything I have tried has resulted in a template error:

Unable to find the template "plugin1/_field/input".


Any ideas on what I'm doing wrong?
The problem as I see it is that the call is happening on the front-end. Because of this, the template renderer is not looking for the template at plugin1/templates/_field/input as it normally would, but at plugin1/_field/input, which explains the error message.

If Plugin 1 is your own plugin then you should be able to include the templates part of the path in the render call, for example:

return craft()-&gt;templates-&gt;render('templates/_field/input');


I haven't tested this but I think it should work. 

Alternatively, and I would recommend this, since this is a front-end call, you could create your own function getFrontEndInputHtml() to return the html appropriately.