NVil Forum

General Category => NVILL Discussion => Topic started by: Passerby on April 07, 2014, 04:47:31 pm

Title: NvilClipboard (Blender)
Post by: Passerby on April 07, 2014, 04:47:31 pm
done

NvilClipboard.zip (http://www.cmcproductions.co.uk/scripts/scripts/NvilClipboard.zip)

Install that zip file into blender using the install from file feature of the Addon browser, than enable the add on.
Once that is done you should be able to search 'nvil' in the spacebar menu, and will see 2 options one to pick up things from the nvilclipboard, and one to drop the selected object to the nvilclipboard.

If you want to bind it to a key, just create a new keybind in the Input editor.
The command to pickup a item from the clipboard is.
Code: [Select]
wm.nvilimport
The command to drop a item to the clipboard is.
Code: [Select]
wm.nvilexport

If you want to ask for features or report bugs, can just do so on this topic, or you can post on the github repo for this addon.

https://github.com/cmcpasserby/BlenderNvilClipboard
Title: Re: Blender Nvil Clipboard
Post by: polyxo on April 07, 2014, 04:56:43 pm
Brilliant! Now have to run - but I'll check this out later tonight.
Title: Re: Blender Nvil Clipboard
Post by: Vaquero on April 07, 2014, 07:55:53 pm
Thanks a lot! The timing is right, because just this week I begun to explore the Blender Python API. I don't know an awful lot about it, but I took your script and extended it with a panel for the Tools Shelf (for people who like to press buttons). I'm still not quite sure which bl_idname to give to classes. I also don't know if I have to register & unregister all 3 classes, or just the one for the panel. Anyway, it's attached as a zip file. Improve upon it, if you like!
Title: Re: Blender Nvil Clipboard
Post by: Vaquero on April 07, 2014, 08:01:16 pm
Oh, and if you'd rather have it in the scene tab of your properties window, you need to change/add the following in the NvilClipboardPanel class inside the NvilClipboard.py:

Code: [Select]
    # put this right under the class defintiion
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"
Title: Re: Blender Nvil Clipboard
Post by: Passerby on April 07, 2014, 08:04:10 pm
looks right to me.
for idnames i tend use a dot syntax "nvilclipboard.drop" where i got the general category, than the command.

but it's up to personal preference, just in the case of operators, they user might see the id if they have to bind it to a key or something.

Also i would make sure to register the UI after the operators it uses.

EDIT:
sinec i know most people dont want to dig into code, lets just ask where everybody rather have it, in the file menu, the scene tab or in the toolbar?

Than we can implement it in the one they want.
Title: Re: Blender Nvil Clipboard
Post by: Asticles on April 08, 2014, 08:30:49 am
Hi to all,

I'm new on this forum, I'm Asticles (Salva), from Spain. I'm currently working as a lowpoly modeler with 3dmax and Blender and I saw in a forum nvil existence so I'm considering to buy it if it fits to my workflow.

As a Blender user I have tried this addon but always I get "File not found" error.

Also, is there anything similar with Max (I try not to model with it because it makes me upset xD).

Also, If anyone has Blender questions I will be glad to answer them, so everyone can learn new things.

Regards!

PS: A bit more documentation on the wiki would be great. ;)

Title: Re: Blender Nvil Clipboard
Post by: Passerby on April 08, 2014, 11:28:14 am
Make sure to use the clipboard feature from nvil first, so the needed file can be created first.
Title: Re: Blender Nvil Clipboard
Post by: Asticles on April 08, 2014, 11:40:56 am
I click first on file-clipboard-copy(obj) ? If is this, I have already tried with an object selected on voidworld. I understand that there could be a lot of possible causes.
Title: Re: Blender Nvil Clipboard
Post by: Passerby on April 08, 2014, 12:10:35 pm
ya that should be the right button,

workflow would be file>clipboard>copy in nvil, than using the NvilClipboard Pickup command in blender.

could you go to this path, in a file browser
Code: [Select]
%appdata%/DigitalFossils/NVil/Media/Clipboard/
and let me know what path it expands out to be, and let me know if the ClipboardObj.obj file is there, after you use the file-clipboard-copy(obj) feature in nvil?
Title: Re: Blender Nvil Clipboard
Post by: Asticles on April 08, 2014, 12:23:47 pm
Ok, I've seen that the directory structure is not there, creating it does help to the blender side, but voidworld does not seem to use it.

It should be the voidworld version, I'm using free one (2.4).
Title: Re: Blender Nvil Clipboard
Post by: Darcvizer on April 08, 2014, 12:45:17 pm
Thank you very very very very very much!!!!
Unfortunately in Saturdays video card broke, not possible to use
Title: Re: Blender Nvil Clipboard
Post by: Passerby on April 08, 2014, 12:51:04 pm
@Asticles

ah that is the problem than, the older version of NVIL uses a different path, and the addon is meant for the newest version.

Title: Re: NvilClipboard (Blender)
Post by: Asticles on April 08, 2014, 01:52:51 pm
Ok I figured out, changing from:

objPath = os.environ['APPDATA']
objPath = objPath + '/DigitalFossils/NVil/Media/Clipboard/ClipboardObj.obj'

To:
objPath =  '%s\\My Documents' % os.environ['USERPROFILE']
objPath = objPath + '/DigitalFossils/VoidWorld/Media/Animation Data/Base Data Sets/SoundTemp/ClipboardObj.obj'

The problem seems solved.

Thanks
Title: Re: NvilClipboard (Blender)
Post by: Passerby on April 08, 2014, 01:59:57 pm
ya less a problem with the script, than just old nvil's using a differnt path
Title: Re: NvilClipboard (Blender)
Post by: Asticles on April 08, 2014, 02:01:45 pm
I think this is ok, it's working for me, I'm not a programmer.
Title: Re: NvilClipboard (Blender)
Post by: polyxo on April 08, 2014, 02:32:38 pm
I have now tried the script out - works very nicely!
A few comments: It was great if the script allowed setting import and export preferences in Blender (on Ngons, Smoothing Groups, Polygroups, Axis remapping etc.). I would not need a GUI for this, just some additions in the script which one then could set to true or false and simply resave. Maybe one could also manually create import/export presets which get stored by Blender (that pulldown in the im/exporter) and the script got pointed to that preset?

Now for instance when Polygroups are inside the Nvil-model they cause the model to be split into separate objects in Blender. Unchecking that option on the left hand side in the importer leaves the model uncut. On export there's again a polygroup section in the Blender exporter but I failed getting groups back to Nvil, maybe someone with more experience knows what to do here?

I'm too stupid to create hotkeys for this script - could anyone give me a hand?
In User-Preferences in the Input Tab one needs to do what exactly? Searching for the Script-commands yields no results.



Title: Re: NvilClipboard (Blender)
Post by: Passerby on April 08, 2014, 03:03:51 pm
well i could take a few approach to this, could make a 3rd command that pops up a UI for setting these options.

Or i could have a config file that goes along side, so you can set these options.

or i could just have these options are clearly defined vars, at the start of the script.

what would you prefer, im kinda learning towards addeding a 3rd command that lets the user configure it.


To create hotkeys, what you have to do, is in the Input tab, open up the category you want to add the key too, and at the bottom of the list click Add New
This will create a new hot key entry, expand the item open, and in the first text field copy this in.
Code: [Select]
nvilclipboard.pickupto make the key to pick things up from the clipboard
or this
Code: [Select]
nvilclipboard.dropfor the command to drop things to the clipboard.


you cant just search it in the editor, because the editor only displays operators that got keys assigned to them, so unless i create a default mapping in the script you have to add it this way.


This might be a good reason to add it to a menu or the UI somewhere, since you can rightclick UI buttons or menu items to give them hotkeys.
Title: Re: NvilClipboard (Blender)
Post by: polyxo on April 08, 2014, 03:40:25 pm
Thanks!
@options: I tend to a non modal version. The beauty of these bridges is exactly not having to deal with settings and stuff - plop - the model is there.
That said: Settings make sense. Maybe really a third command indeed was best. It brought up a dialog which included a "reload" button to test the just dialed in settings. When closing that dialog, the last chosen options go sticky. Would that work?

There's one thing I forgot: The settings panel should also include a "replace" option (the way Zbrush reloads updated clipboard-geometry). Currently reloaded items get added as separate items to the scene. I'll now look into the keyboard mapping, thanks for the explanation!

Title: Re: NvilClipboard (Blender)
Post by: Passerby on April 08, 2014, 05:19:20 pm
Im actually re-working the whole add-on from scratch, right now.

When im done the new version, will have the import and export commands, right in the import and export menus of blender, and will support binding keys by just right clicking the menu items.

I will also add a command for configuring all the options.


What options do you feel is important to have configurable?
Also what do you think the defaults should be?
Title: Re: NvilClipboard (Blender)
Post by: polyxo on April 08, 2014, 06:44:58 pm
What options do you feel is important to have configurable?
Also what do you think the defaults should be?
Others should chime in as well. I think the default setting should be to keep poly-groups and it was great to get them out of Blender too. I don't have a need for smoothing groups but this is important to others so it should be configurable. Axis remapping seems fine already and probably doesn't need to be configurable.
Title: Re: NvilClipboard (Blender)
Post by: Passerby on April 08, 2014, 06:55:42 pm
this build has the group option as a default, and i have it intergrated into the import and export menues, which should also make it easier to bind keys, via right cliking the menu items, and selecting "Add ShortCut"

https://raw.githubusercontent.com/cmcpasserby/BlenderNvilClipboard/master/NvilClipboard.py

will add the options manager in later
Title: Re: NvilClipboard (Blender)
Post by: Darcvizer on May 17, 2014, 02:29:17 am
Hi, I have a problem
http://joxi.ru/hsl2UxjKTJAoU4d7fck
http://joxi.ru/lsl2UxjKTJC_RgONmww
Title: Re: NvilClipboard (Blender)
Post by: Darcvizer on May 17, 2014, 02:33:31 am
Please using Clipboard .dae
Title: Re: NvilClipboard (Blender)
Post by: Passerby on May 17, 2014, 02:00:24 pm
What are you even trying to show in those screens,but ya I could add a date option.
Title: Re: NvilClipboard (Blender)
Post by: polyxo on June 14, 2014, 04:48:58 pm
Hi All,
the exchange script shared passerby script works nicely but I missed a couple of options...
Blender interprets obj scale different from Nvil, so when passing things back and forth the meshes will not retain their scale, which ich quite a problem. The second thing is polygroups. By default Blender would split your mesh by polygroups, now it turns them into Vertexgroups, which even keep their names. When bringing back the geometry to Nvil, Polygroups are still there.

The updated script is attached. Please note that you might have to edit numbers in clamp scale (on import) and scale factor (on export), depending on the units you use in Nvil. You can quickly try out required values by using Blender's default Im/Exporters, then change the according values in the script.
Title: Re: NvilClipboard (Blender)
Post by: Palle on January 17, 2017, 08:53:11 am
The links seem to be broken. Any chance they could fixed?
Title: Re: NvilClipboard (Blender)
Post by: Asticles on April 30, 2017, 11:41:53 am
Yes, lots of ads when trying to download it.
Title: Re: NvilClipboard (Blender)
Post by: Palle on October 13, 2017, 01:36:13 pm
Could anyone that has the applink copy paste the code here if no one wants to upload it?
Title: Re: NvilClipboard (Blender)
Post by: miica on June 23, 2020, 06:58:20 am
Hi,

I created a very simple Blender addon to transfer mesh between Nvil and Blender,

The addon script:
https://drive.google.com/file/d/1mWiyZUjWznLq2phq4jsuM9mh2nWzmgX_/view?usp=sharing (https://drive.google.com/file/d/1mWiyZUjWznLq2phq4jsuM9mh2nWzmgX_/view?usp=sharing)

(https://www.dropbox.com/s/nrvclt4btos7rep/Nvil-Clipboard-blender-addon.jpg?raw=1)

Install it just like other addon, then you will be able to access it under File Context Menu (Hotkey: <F4>).

The import/export options are hardcoded, it works ok dealing with one mesh, it will preserve the vertex order which is my priority; for import/export multiple meshes, I believe there will be some issues.. it also doesn't take care of naming.